Detect cross 4 hour pivots? (incl. example)

Forums ProRealTime English forum ProScreener support Detect cross 4 hour pivots? (incl. example)

  • This topic has 10 replies, 3 voices, and was last updated 3 months ago by avatarJS.
Viewing 11 posts - 1 through 11 (of 11 total)
  • #225165

    I am working on creating a strategy in which a candle passes through the lines of a 4-hour pivot. The formulas of the pivots correspond to IG Markets, so the values of the pivots correspond to the standard indicator in pro real time.
    The script below does not work during testing. It gives random results, but not when the lines go through a pivot. What am I overlooking here? In the attachment there is another image to explain the situation.

     

    #225167
    JS

    Hi @Robin81

    Remove “TimeFrame(Default)” in line 14

    A “screener” instruction in an “If… Then” isn’t going to work:

    If C1 or C2 or C3 then

    Signal=1

    EndIf

    Screener[Signal=1]

    #225186

    @JS,

    I adjusted it, but to no avail. It still gives random notifications.
    It seems like he doesn’t want to take over the value of the pivot?

    #225194
    JS

    Try using High and Low instead of High[1] and Low[1]

    #225199

    @JS,

    Just did it, but unfortunately without success. I chose [1] so that it looks at the recently closed candle. Unfortunately that’s not the problem. In any case, thanks for your thoughts.

    #225201

    If I place the pivots as a ‘separate indicator’ under the graph, you see that the values of the outcome are equal to the standard pivot in PRT. So the formulas for all pivot values 4 hours are correct. Only detecting when a candle is closed on the line has not been possible so far 🙁

    #225210
    JS

    Hi,

    Try using:
    c1= high > P4[1] AND low < P4[1] (change also for c2 and c3)

    #225226

    @JS,

    Do you know the reason why you use P4[1] instead of P4? Your idea was the right way, looks like it works! I am very curious about the explanation…. I will continue testing in the coming days.
    Thanks for your quick response, great!

     

    #225227
    JS

    Hi Robin,

    It’s great that it worked.

    For example, suppose you use a current price (Close) to check whether the price is higher or lower than the same current price (Close), then you understand that this is not going to work.

    The solution is to use the previous price (Close[1]) and check it with the current price…

    Close>Close[1] or in this case High>P4[1]

    #226653

    Hi @Robin81

    A “screener” instruction in an “If… Then” isn’t going to work:

    Not correct. You can use a SCREENER command in an IF statement.

    #226654
    JS

    That’s right, that was already clear and was not the problem…

Viewing 11 posts - 1 through 11 (of 11 total)

Create your free account now and post your request to benefit from the help of the community
Register or Login