I have put together these codes after borrowing from codes available here. And ofcourse it does not work.
The objective of the strategy is to
1) Look back the desired number of bars.
2) a) If high of the highest bar minus Low of the lowest bar is greater than specified number of ticks
2 b) and the previous bar closes higher than its prior bar; place buy limit order
2 c) the previous bar closes lower than its prior bar: place sell limit order.
3) Cancel the Limit orders if it does not trigger within a specified number of bar.
It is required that the trade is managed through the dome.
Appreciate if you could highlight the errors which is nor allowing to trade.
Regards
Arshad
Comment