Wait for x bars before entry

Forums ProRealTime English forum ProOrder support Wait for x bars before entry

Viewing 10 posts - 1 through 10 (of 10 total)
  • #171194

    Hello!

    I’ve been using PRT  and reading the forums for about 7 months, but haven’t posted anything before now.

    My question is quite simple. I would like to wait for x bars before taking an entry when my conditions are met.

    Let’s say my system is something like this

    How can i get the buy function to first wait x bars before taking position?
    I’ve searched the forums, but haven’t been able to find anything like this.

    Thanks!

    #171196

    Not tested:

     

    1 user thanked author for this post.
    #171223

    Works like a charm!

    Thanks for your help and all the good work you do here, Roberto!

    Appreciate it!

    #171224

    I’m experiencing a strange issue. The code works, but sometimes it reverses the position compared to an identical system that doesn’t wait x bars before taking position. The code should only count and then buy/sell, yes? I made it like this to buy and short. Can you see a problem with this, or a reason why it would take a different position?

    #171225

    Try replacing line 5 with:

    and line 10 with:

    #171226

    It still reverses some positions. It’s quite odd since the conditions are identical..

    #171230

    What exactly do you mean by “it reverses the position” because it can’t reverse as checking if NOT ON MARKET bans  from entering if a trade is open?

     

     

    #171235

    Quite! It was poorly explained by me. What I mean is that the system without this code takes a long position, and the one with the code then takes a short position instead, but 3 candles later. I believe this picture will make it clearer.

    #171242

    Try this one:

    1 user thanked author for this post.
    #171252

    Yes, now it’s working flawlessly! Thanks again, Roberto. Much appreciated

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

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