I only have one Entry condition and the entry name is "EntryLong". Here what appears in strategy builder in the exit condition:
I am aware about the Entries PerDirection configuration. But as far as I can see, in both cases there was an open order at 03/01/2021 12:05:PM , Why on one case it exited at that time and on the other didn't.. Take a look:
This is the execution on the backtest with "Start date = 03/01/2021"
This is the output log:
7/28/2021 11:42:44 AM Strategy 'RSIBollingerU/-1': Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='' Mode=Ticks Value=400 IsSimulatedStop=False IsMarketIfTouched=False 7/28/2021 11:42:44 AM Strategy 'RSIBollingerU/-1': Entered internal SetStopTarget() method: Type=Target FromEntrySignal='' Mode=Ticks Value=600 IsSimulatedStop=False IsMarketIfTouched=False 3/1/2021 12:00:00 AM Strategy 'RSIBollingerU/-1': Entered internal SubmitOrderManaged() method at 3/1/2021 12:00:00 AM: BarsInProgress=0 Action=Buy OrderType=Market Quantity=1 LimitPrice=0 StopPrice=0 SignalName='EntryLong' FromEntrySignal='' 3/1/2021 6:30:00 AM Strategy 'RSIBollingerU/-1': Entered internal SubmitOrderManaged() method at 3/1/2021 6:30:00 AM: BarsInProgress=0 Action=Buy OrderType=Market Quantity=1 LimitPrice=0 StopPrice=0 SignalName='EntryLong' FromEntrySignal='' 3/1/2021 6:30:00 AM Strategy 'RSIBollingerU/-1': Ignored SubmitOrderManaged() method at 3/1/2021 6:30:00 AM: BarsInProgress=0 Action=Buy OrderType=Market Quantity=1 LimitPrice=0 StopPrice=0 SignalName='EntryLong' FromEntrySignal='' Reason='Exceeded entry signals limit based on EntryHandling and EntriesPerDirection properties' 3/1/2021 8:10:00 AM Strategy 'RSIBollingerU/-1': Entered internal SubmitOrderManaged() method at 3/1/2021 8:10:00 AM: BarsInProgress=0 Action=Buy OrderType=Market Quantity=1 LimitPrice=0 StopPrice=0 SignalName='EntryLong' FromEntrySignal='' 3/1/2021 8:10:00 AM Strategy 'RSIBollingerU/-1': Ignored SubmitOrderManaged() method at 3/1/2021 8:10:00 AM: BarsInProgress=0 Action=Buy OrderType=Market Quantity=1 LimitPrice=0 StopPrice=0 SignalName='EntryLong' FromEntrySignal='' Reason='Exceeded entry signals limit based on EntryHandling and EntriesPerDirection properties' 3/1/2021 12:00:00 PM Strategy 'RSIBollingerU/-1': Entered internal SubmitOrderManaged() method at 3/1/2021 12:00:00 PM: BarsInProgress=0 Action=Sell OrderType=Market Quantity=1 LimitPrice=0 StopPrice=0 SignalName='Exit_Long_RSI' FromEntrySignal='' 3/1/2021 12:00:00 PM-76.137991129318 3/1/2021 12:00:00 PM Strategy 'RSIBollingerU/-1: Cancelled pending exit order, since associated position is closed, orderId='NT-00002-288' account='Backtest' name='Profit target' orderState=Working instrument='YM 09-21' orderAction=Sell orderType='Limit' limitPrice=31498 stopPrice=0 quantity=1 tif=Gtc oco='NT-00000-288' filled=0 averageFillPrice=0 onBehalfOf='' id=-1 time='2021-03-01 00:00:00' gtd='2099-12-01' statementDate='2021-07-28' 3/1/2021 12:00:00 PM Strategy 'RSIBollingerU/-1: Cancelled pending exit order, since associated position is closed, orderId='NT-00001-288' account='Backtest' name='Stop loss' orderState=Working instrument='YM 09-21' orderAction=Sell orderType='Stop Market' limitPrice=0 stopPrice=30498 quantity=1 tif=Gtc oco='NT-00000-288' filled=0 averageFillPrice=0 onBehalfOf='' id=-1 time='2021-03-01 00:00:00' gtd='2099-12-01' statementDate='2021-07-28' 3/1/2021 12:05:00 PM Strategy 'RSIBollingerU/-1': Entered internal SubmitOrderManaged() method at 3/1/2021 12:05:00 PM: BarsInProgress=0 Action=Sell OrderType=Market Quantity=1 LimitPrice=0 StopPrice=0 SignalName='Exit_Long_RSI' FromEntrySignal='' 3/1/2021 12:05:00 PM Strategy 'RSIBollingerU/-1': Ignored SubmitOrderManaged() method at 3/1/2021 12:05:00 PM: BarsInProgress=0 Action=Sell OrderType=Market Quantity=1 LimitPrice=0 StopPrice=0 SignalName='Exit_Long_RSI' FromEntrySignal='' Reason='This was an exit order but no position exists to exit' 3/1/2021 12:05:00 PM-76.137991129318 3/1/2021 12:10:00 PM Strategy 'RSIBollingerU/-1': Entered internal SubmitOrderManaged() method at 3/1/2021 12:10:00 PM: BarsInProgress=0 Action=Sell OrderType=Market Quantity=1 LimitPrice=0 StopPrice=0 SignalName='Exit_Long_RSI' FromEntrySignal='' 3/1/2021 12:10:00 PM Strategy 'RSIBollingerU/-1': Ignored SubmitOrderManaged() method at 3/1/2021 12:10:00 PM: BarsInProgress=0 Action=Sell OrderType=Market Quantity=1 LimitPrice=0 StopPrice=0 SignalName='Exit_Long_RSI' FromEntrySignal='' Reason='This was an exit order but no position exists to exit' 3/1/2021 12:10:00 PM-76.137991129318 3/1/2021 12:15:00 PM Strategy 'RSIBollingerU/-1': Entered internal SubmitOrderManaged() method at 3/1/2021 12:15:00 PM: BarsInProgress=0 Action=Sell OrderType=Market Quantity=1 LimitPrice=0 StopPrice=0 SignalName='Exit_Long_RSI' FromEntrySignal='' 3/1/2021 12:15:00 PM Strategy 'RSIBollingerU/-1': Ignored SubmitOrderManaged() method at 3/1/2021 12:15:00 PM: BarsInProgress=0 Action=Sell OrderType=Market Quantity=1 LimitPrice=0 StopPrice=0 SignalName='Exit_Long_RSI' FromEntrySignal='' Reason='This was an exit order but no position exists to exit' 3/1/2021 12:15:00 PM-76.137991129318 3/1/2021 12:20:00 PM Strategy 'RSIBollingerU/-1': Entered internal SubmitOrderManaged() method at 3/1/2021 12:20:00 PM: BarsInProgress=0 Action=Sell OrderType=Market Quantity=1 LimitPrice=0 StopPrice=0 SignalName='Exit_Long_RSI' FromEntrySignal='' 3/1/2021 12:20:00 PM Strategy 'RSIBollingerU/-1': Ignored SubmitOrderManaged() method at 3/1/2021 12:20:00 PM: BarsInProgress=0 Action=Sell OrderType=Market Quantity=1 LimitPrice=0 StopPrice=0 SignalName='Exit_Long_RSI' FromEntrySignal='' Reason='This was an exit order but no position exists to exit' 3/1/2021 12:20:00 PM-76.137991129318 3/1/2021 12:25:00 PM Strategy 'RSIBollingerU/-1': Entered internal SubmitOrderManaged() method at 3/1/2021 12:25:00 PM: BarsInProgress=0 Action=Sell OrderType=Market Quantity=1 LimitPrice=0 StopPrice=0 SignalName='Exit_Long_RSI' FromEntrySignal='' 3/1/2021 12:25:00 PM Strategy 'RSIBollingerU/-1': Ignored SubmitOrderManaged() method at 3/1/2021 12:25:00 PM: BarsInProgress=0 Action=Sell OrderType=Market Quantity=1 LimitPrice=0 StopPrice=0 SignalName='Exit_Long_RSI' FromEntrySignal='' Reason='This was an exit order but no position exists to exit' 3/1/2021 12:25:00 PM-76.137991129318 3/1/2021 12:30:00 PM Strategy 'RSIBollingerU/-1': Entered internal SubmitOrderManaged() method at 3/1/2021 12:30:00 PM: BarsInProgress=0 Action=Sell OrderType=Market Quantity=1 LimitPrice=0 StopPrice=0 SignalName='Exit_Long_RSI' FromEntrySignal='' 3/1/2021 12:30:00 PM Strategy 'RSIBollingerU/-1': Ignored SubmitOrderManaged() method at 3/1/2021 12:30:00 PM: BarsInProgress=0 Action=Sell OrderType=Market Quantity=1 LimitPrice=0 StopPrice=0 SignalName='Exit_Long_RSI' FromEntrySignal='' Reason='This was an exit order but no position exists to exit' 3/1/2021 12:30:00 PM-76.137991129318
Let's take a look at the difrerences:
Trade 1)
- The first order (2/25) was not before (this is OK as the start date in the previous example was 3/31)
Trade 2)
- Entry: entry time is on 28/2, (instead of 3/1 as in the previous example. This is OK. It entered before because the earlier start date was letting this happen)
- Exit: - This is what I don't understand- Why the exit in this case is on 3/4/2021 3:45pm while the exit in the previous example was 03/1 12:05pm? In both cases there was one order opened.
Here is the output: ( I am adding it as a screenshot to avoid exceding number of characters in the post)
Thanks again to all of you,
Comment