Extending a limit order

Forums ProRealTime English forum ProOrder support Extending a limit order

Viewing 15 posts - 1 through 15 (of 17 total)
  • #212748

    Hello folks,

    I’m trying to enter the market on a pullback that can occur up to five bars after one of the entry conditions is met.

    I would like to enter on the furthermost right bar in this screengrab (when price pulls back to the 15EMA), but it currently doesn’t work. I can tell from the graph drawing that it is because my entry rule of close >=highfractal+7 has become invalid. How can I save this entry rule to memory and allow the system to wait 5 bars for the price to pull back to the EMA?

    Thanks in advance for your help 🙂



    You should post more details about the strategy conditions, along with a screenshot where trigger and entry points are highlighted.


    1 user thanked author for this post.

    Thank you for bumping this, Roberto.

    Rules are:

    1. New higher high, 7 points or more higher than previous
    2. Enter when price pulls back to 15ema


    I’ve attached a better screengrab showing what ought to be trigger bar and entry bar.



    @Mike Boorman
    I want to try to understand and help, wich Time Frame for your strategy to do some test ?

    and maybe also you can change de first groupe of condition to C1 and draw the C1 condition, maybe it’s can be help you :

    1 user thanked author for this post.

    Thanks for the response, @ZeroCafeine

    I’ve amended the code like you said and created a screengrab.

    I’m working on the DAX 5 minute, April 14 2023.


    1 user thanked author for this post.

    I don’t understand every think from your code, if you can explain more what do you want to do,

    But after cheking your code and try to understand it, I saw a first problem in the line 8 :

    this last condition is useless because it will always be true,

    First case : when you use the Highset function on the last 4 candles, don’t forget that you also include the last candle (Candle[0]), so if the High of the last candle is higher than the last 3 then your code means the same thing as this: Highest[0] = High[0] and this is always true, so you don’t need this condition,

    Second case : if you don’t want to include the last candle [0] in the Highest fonction, it’s possible but you have to use like this :

    in this case you compare the last high with the high of the other candlestick, on the other hand in this case you want the high of the last candle to be equal to the highest high you will find, and then in this case there is a high probability that you will not find this case, it is possible but rare

    I hope to be clear and not to be mistaken, if you do not understand I can make you a diagram


    I’ve changed the code to the high=highest[4](high[1]) you suggested, but this isn’t the problem. My problem is that I want PRT to remember that the high condition WAS true, and then enter the market once the price drops back to the 15EMA.

    I’ve done another screengrab with the new code, pointing to the bar I want to enter (in this case it comes two bars after the high condition is true). How can I enter the market here?



    @Mike Boorman

    I don’t understand what you want to do between line 19 and 29, but maybe this can helo you, change all your buy condition to one condition and graph it like that :

    and you will see on the graphique, your BuyConditions is all the time false so all the time the BuyConditions = 0, So that is maybe why your code no buy anythink


    There you go:


    1 user thanked author for this post.

    Thank you for your help Roberto. I’ve just run a test. As you can see from the screengrab, signal = 1 even when the market is going down, which isn’t what I want.

    If the market is going down with red bars, I can’t understand how the high of the current bar could possibly be greater than the high[1] + 7? But PRT is saying it’s true.


    It’s because the SIGNAL is never cleared, unless OnMarket, so if the trend reverses the signals is still retained.

    This version will clear the SIGNAL whenever a candle closes BELOW Ema15:


    1 user thanked author for this post.

    Thanks Roberto. It’s getting closer 🙂

    I want to be more clever with the previous high. At the moment signal is true if high is +7 from the previous bar, but I’d like it to be +7 from a previous high. I’m not exactly sure how to define the ‘previous high’ I am seeing with my eyes, but I’ve attached a screengrab to show what I mean.



    I was trying to understand what’s the issue, but I need your latest code used.


    1 user thanked author for this post.

    Thanks for you offer of help, Roberto. These are the rules:

    -New higher high, 7 points or more higher than last significant high
    -Enter when price pulls back to 15ema

    The problem is that ‘signal’ is currently derived from high[1], which is the previous bar. I don’t want to consider the previous bar. I want to consider the previous significant high with a look back. In the screengrab I have attached, I want ‘signal’ to become true on the bar where I have put the left green arrow. Once the signal becomes true, the green arrow to the right should then become an entry when the price pulls back to the 15ema.

    Thank you again for your help.


    Try replacing line 9 with:



    1 user thanked author for this post.
Viewing 15 posts - 1 through 15 (of 17 total)

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