Forums ProRealTime English forum ProOrder support Adjustment in code because combined stops can not be used with pro order Reply To: Adjustment in code because combined stops can not be used with pro order

#107853

Hi

This part of the code is not to add 60 points to my entry but 60 points to my sl. I want it to buy as close as possible to the high of the previous 6 bars (5 min) and sell as close to the low of the last 6 bars. I want the sl to be 60 points below the high for a buy trade and 60 points above the low of the last 6 bars.

The problem i have is that its not placing trades in real time.. in backtest the code works but in real time it doesnt place any trades.. how can i change the code so that it does place a trade even if price is volatile and already moved and orders are too close to price?

Another  thing is it also doesnt keep orders open till its filled,, if not filled in first 5 min it cancels all pending orders.

Please run a backtest and see some days it doesnt place any trades. This is the code i have now.

 

If you can please adjust code.

Thank you