So my entry instruction looks like this: EnterLong(tradedInstrument,1, @orderTag); and the short entry would be the same except with EnterShort. But both the running output and the log file are showing both long and short positions held concurrently and I'm confused as to why this might be happening.
Here's a snapshot of the log. Notice entry and exit times and the order in which the trade numbers appear on the left. Order 1 opened Long @ 08:35:35 and closed at 15:59:46. However in between that order 2 opened short at 08:46:21 and closed @ 10:11:53.
And here's output from instructing the program to TraceOrders which adds to the confusion. It appears to keep opening orders both long and short simultaneously then at some point it tries to close orders 7 and 1 and claims they don't exist and then winds up closing them both on a session close on the 4th along with other orders ...so in other words they did exist?
1/3/2022 8:35:35 AM Strategy 'A1Current/-1': Entered internal SubmitOrderManaged() method at 1/3/2022 8:35:35 AM: BarsInProgress=2 Action=Buy OrderType=Market Quantity=1 LimitPrice=0 StopPrice=0 SignalName='L-REG3-1' FromEntrySignal=''
1/3/2022 8:46:21 AM Strategy 'A1Current/-1': Entered internal SubmitOrderManaged() method at 1/3/2022 8:46:21 AM: BarsInProgress=2 Action=SellShort OrderType=Market Quantity=1 LimitPrice=0 StopPrice=0 SignalName='S-REG3-2' FromEntrySignal=''
1/3/2022 10:11:53 AM Strategy 'A1Current/-1': Entered internal SubmitOrderManaged() method at 1/3/2022 10:11:53 AM: BarsInProgress=2 Action=BuyToCover OrderType=Market Quantity=1 LimitPrice=0 StopPrice=0 SignalName='S-REG3-2-close' FromEntrySignal='S-REG3-2'
1/3/2022 5:02:50 PM Strategy 'A1Current/-1': Entered internal SubmitOrderManaged() method at 1/3/2022 5:02:50 PM: BarsInProgress=2 Action=SellShort OrderType=Market Quantity=1 LimitPrice=0 StopPrice=0 SignalName='S-REG3-3' FromEntrySignal=''
1/3/2022 7:01:00 PM Strategy 'A1Current/-1': Entered internal SubmitOrderManaged() method at 1/3/2022 7:01:00 PM: BarsInProgress=2 Action=Buy OrderType=Market Quantity=1 LimitPrice=0 StopPrice=0 SignalName='L-REG3-4' FromEntrySignal=''
1/3/2022 7:06:30 PM Strategy 'A1Current/-1': Entered internal SubmitOrderManaged() method at 1/3/2022 7:06:30 PM: BarsInProgress=2 Action=Sell OrderType=Market Quantity=1 LimitPrice=0 StopPrice=0 SignalName='L-REG3-4-close' FromEntrySignal='L-REG3-4'
1/3/2022 7:06:58 PM Strategy 'A1Current/-1': Entered internal SubmitOrderManaged() method at 1/3/2022 7:06:58 PM: BarsInProgress=2 Action=Buy OrderType=Market Quantity=1 LimitPrice=0 StopPrice=0 SignalName='L-REG3-5' FromEntrySignal=''
1/3/2022 7:16:43 PM Strategy 'A1Current/-1': Entered internal SubmitOrderManaged() method at 1/3/2022 7:16:43 PM: BarsInProgress=2 Action=BuyToCover OrderType=Market Quantity=1 LimitPrice=0 StopPrice=0 SignalName='S-REG3-3-close' FromEntrySignal='S-REG3-3'
1/3/2022 7:16:43 PM Strategy 'A1Current/-1': Ignored SubmitOrderManaged() method at 1/3/2022 7:16:43 PM: BarsInProgress=2 Action=BuyToCover OrderType=Market Quantity=1 LimitPrice=0 StopPrice=0 SignalName='S-REG3-3-close' FromEntrySignal='S-REG3-3' Reason='This was an exit order but no position exists to exit'
1/4/2022 4:00:45 AM Strategy 'A1Current/-1': Entered internal SubmitOrderManaged() method at 1/4/2022 4:00:45 AM: BarsInProgress=2 Action=BuyToCover OrderType=Market Quantity=1 LimitPrice=0 StopPrice=0 SignalName='S-REG3-6-close' FromEntrySignal='S-REG3-6'
1/4/2022 6:04:10 AM Strategy 'A1Current/-1': Entered internal SubmitOrderManaged() method at 1/4/2022 6:04:10 AM: BarsInProgress=2 Action=SellShort OrderType=Market Quantity=1 LimitPrice=0 StopPrice=0 SignalName='S-REG3-7' FromEntrySignal=''
1/4/2022 6:50:36 AM Strategy 'A1Current/-1': Entered internal SubmitOrderManaged() method at 1/4/2022 6:50:36 AM: BarsInProgress=2 Action=Buy OrderType=Market Quantity=1 LimitPrice=0 StopPrice=0 SignalName='L-REG3-8' FromEntrySignal=
1/4/2022 7:21:25 AM Strategy 'A1Current/-1': Entered internal SubmitOrderManaged() method at 1/4/2022 7:21:25 AM: BarsInProgress=2 Action=BuyToCover OrderType=Market Quantity=1 LimitPrice=0 StopPrice=0 SignalName='S-REG3-7-close' FromEntrySignal='S-REG3-7'
1/4/2022 7:21:25 AM Strategy 'A1Current/-1': Ignored SubmitOrderManaged() method at 1/4/2022 7:21:25 AM: BarsInProgress=2 Action=BuyToCover OrderType=Market Quantity=1 LimitPrice=0 StopPrice=0 SignalName='S-REG3-7-close' FromEntrySignal='S-REG3-7' Reason='This was an exit order but no position exists to exit'
1/4/2022 10:02:54 AM Strategy 'A1Current/-1': Entered internal SubmitOrderManaged() method at 1/4/2022 10:02:54 AM: BarsInProgress=2 Action=Sell OrderType=Market Quantity=1 LimitPrice=0 StopPrice=0 SignalName='L-REG3-1-close' FromEntrySignal='L-REG3-1'
1/4/2022 10:02:54 AM Strategy 'A1Current/-1': Ignored SubmitOrderManaged() method at 1/4/2022 10:02:54 AM: BarsInProgress=2 Action=Sell OrderType=Market Quantity=1 LimitPrice=0 StopPrice=0 SignalName='L-REG3-1-close' FromEntrySignal='L-REG3-1' Reason='SignalName does not have a matching FromEntrySignal to exit'
01/04/2022 03:59:46 PM - Closing L-REG3-1 on SESS condition at 63.15
Net: 185 Cumulative Profit: -59
01/04/2022 03:59:46 PM - Closing S-REG3-3 on SESS condition at 63.15
Net: -127 Cumulative Profit: -59
01/04/2022 03:59:46 PM - Closing L-REG3-5 on SESS condition at 63.15
Net: 108 Cumulative Profit: -59
01/04/2022 03:59:46 PM - Closing S-REG3-7 on SESS condition at 63.15
Net: -96 Cumulative Profit: -59
01/04/2022 03:59:46 PM - Closing L-REG3-8 on SESS condition at 63.15
Net: 85 Cumulative Profit: -59

Comment