Is possible in a strategy to enter in a trade multiple times (if condition is true) with different TP/SL generated by ATR?
I mean, each time formation is formed, enter a trade, regardless number of current opened positions. TP and SL would be generated by ATR(4), TP - ATR4 and SL - ATR4, Each new trade would have different TP/SL.
Currently in my strategy i use iorders but i dont really know how to program multiple entries and have several opened positions with each unique TP/SL generated by ATR.
EntriesPerDirection = 1000; EntryHandling = EntryHandling.AllEntries; if (High[1] > High[2] && High[1] > High[3] && High[1] > Hi}gh[4] && High[0] > High[1]) && High[1] > upperValue_BB ) { DrawArrowUp(CurrentBar.ToString(), false, 0, Low[0], Color.Lime); entryOrderLong = EnterLongStop(0, false, 1, High[0] + 1 * TickSize, "enter"); } protected override void OnOrderUpdate(IOrder order) { if (entryOrderLong != null && entryOrderLong == order) { if (order.OrderState == OrderState.Filled) { exitLimitLong = ExitLongLimit(0, true, 1, entryOrderLong.AvgFillPrice + ATR(value)[0], "TP", "enter"); exitStopLong = ExitLongStop(0, true, 1, entryOrderLong.AvgFillPrice - ATR(value)[0], "SL", "enter"); } }
I would not like to program multiple blocks of code in OnOrderUpdate to set limit/stop orders.
Thank you
Comment