How to create a breakout box between 2 hours, Code please?

Forums ProRealTime English forum ProOrder support How to create a breakout box between 2 hours, Code please?

Tagged: 

Viewing 12 posts - 46 through 57 (of 57 total)
  • #83115

    This version waits for the breakout to occur, then places pending LIMIT orders to enter at a better price when it retraces to the range border (but you can enter AT MARKET if you prefer):

     

    1 user thanked author for this post.
    #83120

    Many thanks again. 😉

    I’ll give it a try.

    #83446

    Roberto, Many thanks for all your help. 😉

    5mins, Wall Street.

    Using today as an example, a LIMIT order would have entered at 12:00, after the re-test.

    AT MARKET would have entered at 07:45, after the close under the yl.

    Is it not possible to enter during the 07:40 candle, as it crosses the yl line, using any code?

    I have changed the settings, crossover yl, low of yl, but the code seems to require a close below the yl, to setup the trades.

    I have attached a chart to show examples, I would like to buy on the cross (not necessarily the close) of the yl or yh?

    I can set a deal to open / limit order, through IG and they will buy/sell whenever.

    I think I am going to have to give up shortly, but being so close and after all the help you have given me, it seems a shame. ;(

    #83482

    Replace LIMIT with STOP at lines 25 and 28, since you are willing to enter a new trade at a worse price, while LIMIT should be uses to enter at a better price, instead.

    If the entry price is not exactly the one you wanted (which I experienced backtesting the trade you pointed out in your screenshot), I guess it’s due to the current price (last pending order placed at the closing of the bar preceding the entry one) being too close to your desired entry price.

     

    1 user thanked author for this post.
    #83517

    Roberto,

    Many thanks for looking into it again. 😉

    I have changed it to STOP, but as you experienced in the backtest, it still doesn’t work all the time.

    I’ll have to monitor it.

    Thanks for all your help, it is much appreciated. 🙂

    #83525

    You can use IF…ENDIF to make it work at all times:

     

    1 user thanked author for this post.
    #83533

    This is picking up trades I was expecting, but it is also taking more trades.

    I have added AND NOT ALREADY BUY / SELL to the above code, but it still produces 7 trades today, I was after 1 long / 1 short per day. (which is coded)

    It should have entered at 08:25 only today. (Screenshot attached) For some reason it also entered at 08:30,13:45,13:50 etc.

    The other point is that on the 24/10/18, even after your amended code, the short trade at 07:40 does still not occur. (Screen shot attached.)

    Is it to do with the candle close and it going straight through the yl / yh.

    #83537

    The problem with ALREADYBUY/ALREADYSELL is that at lines 3 and 6 ProOrder takes 1 bar to become aware of being OnMarket. In case (as it happens) the pending orders is entered and exited within the same bar ProOrder will never be aware of them, thus leaving those variables unset.

    That’s why so many trades are entered!

    There’s no work around, unless you use MTF to launch your strategy from a lower TF (say 1 minute), but this won’t grant you that a single 1-minute bar cannot have a range of 15+ pips! For sure this solution will work in most cases, though not always. MTF is still being beta tested and not recommended for real trading.

     

     

    #83538

    Roberto,

    Many thanks again. 🙂

    I will have to keep monitoring the trades for the anomalies that are deleted by prorealtime.

    Last question, (I sound like Columbo, 😉 ) Is there anyway prorealtime will alert me, SMS, when a trade is deleted?

    I know they can SMS, when a trade is: opened/closed / edited.

    #83542

    What do you mean by DELETED?

    Anyway, I think I cannot help you because I’ve never used that kind of alert.

     

    #83567

    I trade through IG and the trades get set up through the pro-order automatic trading system.

    On the 24/10/18, Wall Street, 5m, using the system I had running, I had orders in the system at 25303.1 BUY & 25165.1 SELL.

    At 7:40, Instead of selling short at 25165.1 the order got deleted (by ProOrder)

    This happens every now and again, I don’t know why the trades get deleted?

    (I did amend the time to 0730-2050 so it isn’t a time issue)

    Thanks for your reply anyway. 🙂

    #83569

    All pending oreders are DELETED at every bar’s closure.

    You need to place then again and again, bar after bar, if you wish to keep them pending.

    1 user thanked author for this post.
Viewing 12 posts - 46 through 57 (of 57 total)

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