Forums › ProRealTime English forum › ProOrder support › Two stop orders at high and low. › Reply To: Two stop orders at high and low.
Hi Vonasi,
I’m sorry for putting my issue into previous thread.
Yes, I tried this backtest in excel on 1H TF where about 5% of trades ended on TP and SL during the same bar, so I cannot identify what hit first. I think for the purpose of this a 15M TF would be more then enough.
Now, I’m not that much in the logic of this code yet (I miss the explanation of basic logic of this language in the instruction videos), so though coding is no problem for me in general, it take a lot of time for me to find and learn things. That’s why I ask for help. So here it the idea again (edited):
The strategy is aimed at working on 4h chart, but for the purpose of backtesting I want to run this on 15M chart.
After end of each 4h bar i.e. in this case after each 16 15m bars) I want to open 2 orders:
- BuyStop order at High of ended 4H bar (=highest[16]? as it will ru normally on 4H TF) – I think we should take Ask price
- SellStop order at Low of ended 4H bar (=lowest[16]?) – I think we should take Bid price
StopLoss will be set in the middle of BuyStop and SellStop, TargetProfit will be 2* StopLoss size
Trade size should be 1% of equity.
If the TargetProfit is hit, its “twin” order will be cancelled. If StopLoss is hit, still the twin order can end up at Target of StopLoss.
At the end of the week
- all orders should be cancelled at 15:00 GMT (16:00 CET)
- all open trades should be closed at 20:00 GMT (21:00 CET)
Assuming we have max 42 4H bars during the week, there will be more open orders at the same time and the program should manage each separately and each order will have different trade size, stops and targets.
That’s all. Thanks for any help.
Peter