DislikedSimultaneous buy/sell orders are being removed by the NFA, I prefer to keep the pending orders internal to the EA, so the broker cannot see that I have two orders open in opposite directions (implying a straddle).
As for your code, are you saying there is the possibility where the bar will close inside the box, then the next bar gaps outside the box?
If that's the case, it probably wouldn't be a good idea, and here's why I think why. Had you put in a plain pending order there, and the price gaps across a bar, the pending order will still get...Ignored
Thanks.
Lubo.
If I know how, I tell You!! Few but Good!!