I want to find if condition has been met in the last few bars

Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #181610 quote
    pdrhpdrh
    Participant
    Average

    I want to find if a condition has been met in the last few bars .

    Is there something similar to Lowest[N](close ) or could somebody give a code to do this .

    #181613 quote
    paisantraderpaisantrader
    Participant
    Senior

    a = summation[5](close > close[1])

    “a” will contain how many times the condition “close > close[1]” was met within the last 5 bars

    Nicolas and pdrh thanked this post
    #181618 quote
    NicolasNicolas
    Keymaster
    Legend
    #181625 quote
    pdrhpdrh
    Participant
    Average

    what I am wanting to find whether an as yet undefined condition has been met in the last few bars.

    #181627 quote
    nonethelessnonetheless
    Participant
    Master

    you mean like, have any unicorns been discovered within last 5 bars?

    you have to tell the summation what to look for (unless i have completely misunderstood ???)

    pdrh thanked this post
    #181662 quote
    pdrhpdrh
    Participant
    Average

    So would i write

    a=summation[5](unicorns)

    #181664 quote
    nonethelessnonetheless
    Participant
    Master

    You got it. Easy peasy.

    Let us know the result.

    pdrh thanked this post
    #181678 quote
    JSJS
    Participant
    Master
    #181709 quote
    pdrhpdrh
    Participant
    Average

    I wanted to find when the price is rejected at a resistance level more than once and this gave a result

    a=supertrend[3,10]
    b=a-close
    ind=0
    If b<2.5 AND b>0 Then
    ind=1
    Endif
    d=summation[7](ind)
    Return d

    #181717 quote
    NicolasNicolas
    Keymaster
    Legend

    You should now use that new instruction: BARSSINCE ! Enjoy.

    #181725 quote
    PeterStPeterSt
    Participant
    Master

    Nice !

Viewing 11 posts - 1 through 11 (of 11 total)
  • You must be logged in to reply to this topic.
ProRealAI ProRealAI New

Stuck on this ProBuilder code?

Describe what this topic is trying to build, in plain English, and ProRealAI writes the ProRealTime™ indicator, screener or system for you.

Available in 7 languages
Try ProRealAI

I want to find if condition has been met in the last few bars


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
pdrh @pdrh Participant
Summary

This topic contains 10 replies,
has 6 voices, and was last updated by PeterStPeterSt
4 years, 11 months ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 11/15/2021
Status: Active
Attachments: 1 files
ProRealCode ProRealCode
Loading...