I know this has been discussed a couple of times but I just can't get it to work. What is the easiest way to place a limit order that will stay open in a strategy that is tick-based, please? I have a simple strategy with a few lagging indicators and parabolic stop loss configured and it works like a charm. The two limit orders, one is names golong and one is named goshort. All orders are unique, max 1 entry per direction and 1 trade in total allowed.
All I would like is to have a parameter to keep the trade open for, say 2 bars.
Can anybody point me into the right direction please?
all the initial code... protected override void OnBarUpdate() { if (BarsInProgress != 0) return; if (CurrentBars[0] < 1) return; // Set 1 ... EnterLongLimit(Convert.ToInt32(DefaultQuantity), GetCurrentAsk(0), @"golong"); // Set 2 ... EnterShortLimit(Convert.ToInt32(DefaultQuantity), GetCurrentAsk(0), @"goshort"); }
Comment