I have ExitLongStopMarket and ExitLongLimit and for each the signal is @"MES_Stop1", Stop2, and so on. For Profit Targets, they are @"MES_Profit1", Profit2, and so on... The Entry signal name is "MES_Long1", Long2, Long3, Short1, 2, and 3... hopefully you get the point.
When I run the strategy, it will work as expected on the first trade in either direction, long or short. However, when it triggers a 2nd time in either direction, in the output, I get Ignored with a reason of 'SignalName does not have a matching FromEntrySignal to exit'. I can't quite make sense of this. Of course this works great in playback mode, but has only surfaced when trading live on a sim account. Also, when looking at the logs, there are no errors and it says the orders were accepted and filled, leaving me more confused.
I'd also be very interested in ways to use ATM strategies instead of trying to manage the entries and exits myself, but I'm not sure ATM strategies would work with what I'm trying to accomplish. What I have attempted to program is for dynamic stops, profits, breakeven targets, and trail stops. I know ATM can do trails by ticks, but I'm looking to dynamically set that based on risk and other factors. My limited understanding is that isn't possible, however I hope to be wrong about that as that probably makes things both much simpler and safer than programming something on my own.
Below are the lines from the output window:
Shows the original entry.
1/27/2025 3:15:59 PM Strategy 'SHStrategyReversalBarMES/347506803': Entered internal SubmitOrderManaged() method at 1/27/2025 3:15:59 PM: BarsInProgress=0 Action=SellShort OrderType=Market Quantity=4 LimitPrice=0 StopPrice=0 SignalName='MES_Short1' FromEntrySignal=''
1/27/2025 3:15:59 PM Strategy 'SHStrategyReversalBarMES/347506803': Entered internal SubmitOrderManaged() method at 1/27/2025 3:15:59 PM: BarsInProgress=0 Action=SellShort OrderType=Market Quantity=4 LimitPrice=0 StopPrice=0 SignalName='MES_Short2' FromEntrySignal=''
1/27/2025 3:15:59 PM Strategy 'SHStrategyReversalBarMES/347506803': Entered internal SubmitOrderManaged() method at 1/27/2025 3:15:59 PM: BarsInProgress=0 Action=SellShort OrderType=Market Quantity=2 LimitPrice=0 StopPrice=0 SignalName='MES_Short3' FromEntrySignal=''
Shows the Stop1 and Profit1 for Short1 are created, before Short2 and Short3 are ignored. ON the chart, I get the orders for 4 of the 10 contracts, leaving 6 active with no exit orders created.
Placing stop and targets short1: firstTick = False, secondTick = True, p1Contracts = 4, p2Contracts = 4, p3Contracts = 2
1/27/2025 3:15:59 PM Strategy 'SHStrategyReversalBarMES/347506803': Entered internal SubmitOrderManaged() method at 1/27/2025 3:15:59 PM: BarsInProgress=0 Action=BuyToCover OrderType=StopMarket Quantity=4 LimitPrice=0 StopPrice=6022.75 SignalName='MES_Stop1' FromEntrySignal='MES_Short1'
1/27/2025 3:15:59 PM Strategy 'SHStrategyReversalBarMES/347506803': Entered internal SubmitOrderManaged() method at 1/27/2025 3:15:59 PM: BarsInProgress=0 Action=BuyToCover OrderType=Limit Quantity=4 LimitPrice=6018.25 StopPrice=0 SignalName='MES_Profit1' FromEntrySignal='MES_Short1'
Placing stop and targets short2: firstTick = False, secondTick = True, p1Contracts = 4, p2Contracts = 4, p3Contracts = 2
1/27/2025 3:15:59 PM Strategy 'SHStrategyReversalBarMES/347506803': Entered internal SubmitOrderManaged() method at 1/27/2025 3:15:59 PM: BarsInProgress=0 Action=BuyToCover OrderType=StopMarket Quantity=4 LimitPrice=0 StopPrice=6022.75 SignalName='MES_Stop2' FromEntrySignal='MES_Short2'
1/27/2025 3:15:59 PM Strategy 'SHStrategyReversalBarMES/347506803': Ignored SubmitOrderManaged() method at 1/27/2025 3:15:59 PM: BarsInProgress=0 Action=BuyToCover OrderType=StopMarket Quantity=4 LimitPrice=0 StopPrice=6022.75 SignalName='MES_Stop2' FromEntrySignal='MES_Short2' Reason='SignalName does not have a matching FromEntrySignal to exit'
1/27/2025 3:15:59 PM Strategy 'SHStrategyReversalBarMES/347506803': Entered internal SubmitOrderManaged() method at 1/27/2025 3:15:59 PM: BarsInProgress=0 Action=BuyToCover OrderType=Limit Quantity=4 LimitPrice=6013.25 StopPrice=0 SignalName='MES_Profit2' FromEntrySignal='MES_Short2'
1/27/2025 3:15:59 PM Strategy 'SHStrategyReversalBarMES/347506803': Ignored SubmitOrderManaged() method at 1/27/2025 3:15:59 PM: BarsInProgress=0 Action=BuyToCover OrderType=Limit Quantity=4 LimitPrice=6013.25 StopPrice=0 SignalName='MES_Profit2' FromEntrySignal='MES_Short2' Reason='SignalName does not have a matching FromEntrySignal to exit'
Placing stop and targets short3: firstTick = False, secondTick = True, p1Contracts = 4, p2Contracts = 4, p3Contracts = 2
1/27/2025 3:15:59 PM Strategy 'SHStrategyReversalBarMES/347506803': Entered internal SubmitOrderManaged() method at 1/27/2025 3:15:59 PM: BarsInProgress=0 Action=BuyToCover OrderType=StopMarket Quantity=2 LimitPrice=0 StopPrice=6022.75 SignalName='MES_Stop3' FromEntrySignal='MES_Short3'
1/27/2025 3:15:59 PM Strategy 'SHStrategyReversalBarMES/347506803': Ignored SubmitOrderManaged() method at 1/27/2025 3:15:59 PM: BarsInProgress=0 Action=BuyToCover OrderType=StopMarket Quantity=2 LimitPrice=0 StopPrice=6022.75 SignalName='MES_Stop3' FromEntrySignal='MES_Short3' Reason='SignalName does not have a matching FromEntrySignal to exit'
1/27/2025 3:15:59 PM Strategy 'SHStrategyReversalBarMES/347506803': Entered internal SubmitOrderManaged() method at 1/27/2025 3:15:59 PM: BarsInProgress=0 Action=BuyToCover OrderType=Limit Quantity=2 LimitPrice=6009.25 StopPrice=0 SignalName='MES_Profit3' FromEntrySignal='MES_Short3'
1/27/2025 3:15:59 PM Strategy 'SHStrategyReversalBarMES/347506803': Ignored SubmitOrderManaged() method at 1/27/2025 3:15:59 PM: BarsInProgress=0 Action=BuyToCover OrderType=Limit Quantity=2 LimitPrice=6009.25 StopPrice=0 SignalName='MES_Profit3' FromEntrySignal='MES_Short3' Reason='SignalName does not have a matching FromEntrySignal to exit'
Setting profit and stop orders Short -- 15:16:00
Thanks in advance!!
Scott


Comment