Buying in the middle of the candle

Forums ProRealTime English forum ProOrder support Buying in the middle of the candle

Viewing 11 posts - 1 through 11 (of 11 total)
  • #39715

    Hi everyone,

    I am sending attached a very simple breakout strategy that I have been on and off for a week. I have one problem with the coding.

    Every time the price breakouts the highest or lowest from the 4 previous candles, I would like to buy exactly at the point where the price breaks the ceiling of floor, not at the beginning of next candle. I have removed MARKET from the equation and created an STOP order, but still not working.

    I am attaching a pdf drawing of an example of what I am intending to do, for a better understanding.

    Thanks to everyone,

    Juan

     

    #39720

    ,

     

    #39726

    You can’t!

    Strategies, at least until the Multitimeframe feature is provided, are only executed at each new candle, not in the middle or elsewere.

    You may try to switch to 1 minute TF and adjust computations so that it “looks like” (not exactly, especially if you want to deal with Moving Averages) being executed in a 15min TF.

    Examnple with your code (15 1-minute bars for each 15-minute bar):

    Hope you can manage to run your strategy as expected.

     

    #39731

    Hi Roberto,

    Thanks for your answer!!! It seems a good idea to convert the one 15′ candle into 15/one minute candles, so the breakout moment can be pinpoint with more precision than before.

    Nevertheless, I thought that putting a limit or stop order at an specific point would spark the order in the middle of the candle. I have struggling with this for a week.

    Thanks so much for your help!!!

    Juan

    #39759

    you can also use intradaybarindex to count the bars

    (indicator)

    x = bars from start of the day

    y = range (4 if you want 1 hour of 15-min bars)

    and then use stoporder

    but i wonder if the 1 trade per day will work with stoporders?

     

     

    1 user thanked author for this post.
    #39769

    Thanks Eric. Yes the “1 trade per day” should work if the variable is incremented like the way Juan did in his first post. But the STOP order will only be set during 1 bar (stop orders expire each new bar). To count pending orders, there is no other way I’m afraid.

    #39791

    Hi Eric,

    Thanks for your contribution. I will study your option. Right not, I am applying what Roberto said and it seems a good idea since I can’t buy right at the break-out at the same candle. So, I am breaking the 15′ candle in 15 small ones.

    I thought that placing an stop order at that point will work (BUY 1 CONTRACT AT resistance STOP), but it doesn’t work.

    Thanks,

    Juan

    #39930

    I have the same problem as Juan.  In the Assisted ProBacktest Creation window, there is a drop-down box under the ‘Buy’ section at the bottom with one item in it – ‘next bar open’.

    Presumably, since this is a drop-down box, it would be expected that there would be a range of options there (eg ‘on next tick’ and/or ‘x pips higher’).  Is that correct?  Presumably, Roberto, that’s what you meant when you referred to the Multitimeframe feature being provided?  When will this upgrade be available, does anyone know?

    Also, Roberto, you referred to converting a 15-minute candle into 15 one-minute candles, but I don’t understand your code (I’m a complete beginner).  How do I make that conversion?

    #39957

    To switch from a 15-min TF to a 1-min TF all you have to do is multiply bar references by 15 (there are 15 1-minute bars in a single 15-min bar).

    This is pretty simple in the above case (the example with HIGHEST/LOWEST), but it is not as easy if you are within minute 20 bar (say 102000) and want to know the closing price of the previous 15-minute candle, because if you write

    you get the closing price at 10:05:00 which is NOT the closing price of the previous 15-minute bar (that was at 10:15:00), just the closing price 15 bars ago.

    As you can see there are cases in which you can find a solution using such conversions/adjustments, but in many other cases you can’t make it work as expected.

    The final solution is….. we all have to wait for the MultiTimeFrame feature in a (hopefully near) future release of ProOrder!

     

    #40187

    Yes, noted, thanks.

    #40189

     

    The only way to buy “in the middle of a candle” are stop-orders.

    1 user thanked author for this post.
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