Several times strategy terminated after trail stop adjustment.
I use following call to start trail stop
SetTrailStop(CalculationMode.Ticks, trailStopTicks );
How can i prevent that strategy termitates itself ?
attached from log
3/9/2011 5:10:17 PM|1|128|Starting NinjaScript strategy 'TendlineBreaksS/a3d234e507b6419caf4fffcfa66f84e5' : On starting a real-time strategy - StrategySync=WaitUntilFlat EntryHandling=AllEntries EntriesPerDirection=1 StopTargetHandling=PerEntryExecution ErrorHandling=StopStrategyCancelOrdersClosePositio ns ExitOnClose=True/ triggering 30 before close Set order quantity by=Strategy
3/9/2011 5:13:58 PM|1|32|Order='dbcf6abb6ad64e3c94f91531f19d829f/Sim101' Name='TLB' New State=PendingSubmit Instrument='CL 04-11' Action=Buy Limit price=0 Stop price=0 Quantity=1 Type=Market Filled=0 Fill price=0 Error=NoError Native error=''
3/9/2011 5:13:58 PM|1|32|Order='dbcf6abb6ad64e3c94f91531f19d829f/Sim101' Name='TLB' New State=Accepted Instrument='CL 04-11' Action=Buy Limit price=0 Stop price=0 Quantity=1 Type=Market Filled=0 Fill price=0 Error=NoError Native error=''
3/9/2011 5:13:58 PM|1|32|Order='dbcf6abb6ad64e3c94f91531f19d829f/Sim101' Name='TLB' New State=Working Instrument='CL 04-11' Action=Buy Limit price=0 Stop price=0 Quantity=1 Type=Market Filled=0 Fill price=0 Error=NoError Native error=''
3/9/2011 5:13:58 PM|1|32|Order='dbcf6abb6ad64e3c94f91531f19d829f/Sim101' Name='TLB' New State=Filled Instrument='CL 04-11' Action=Buy Limit price=0 Stop price=0 Quantity=1 Type=Market Filled=1 Fill price=104.42 Error=NoError Native error=''
3/9/2011 5:13:58 PM|1|16|Execution='7f147e3a35174625bf7426ad8fa2e3c 0' Instrument='CL 04-11' Account='Sim101' Exchange=Default Price=104.42 Quantity=1 Market position=Long Operation=Insert Order='dbcf6abb6ad64e3c94f91531f19d829f' Time='3/9/2011 5:13:58 PM'
3/9/2011 5:13:58 PM|1|64|Instrument='CL 04-11' Account='Sim101' Avg price=104.42 Quantity=1 Market position=Long Operation=Insert Currency=Unknown
3/9/2011 5:13:58 PM|1|32|Order='4721b5ef94a04732bcfcc4e62a28427a/Sim101' Name='Trail stop' New State=Rejected Instrument='CL 04-11' Action=Sell Limit price=0 Stop price=104.42 Quantity=1 Type=Stop Filled=0 Fill price=0 Error=OrderRejected Native error='Sell stop or sell stop limit orders can't be placed above the market.'
3/9/2011 5:13:58 PM|0|32|Sell stop or sell stop limit orders can't be placed above the market. Affected Order: Sell 1 Stop @ 104.42
3/9/2011 5:13:58 PM|1|32|Order='30bc62525e0245f2aea8c18868df0f6c/Sim101' Name='Profit target' New State=PendingSubmit Instrument='CL 04-11' Action=Sell Limit price=104.52 Stop price=0 Quantity=1 Type=Limit Filled=0 Fill price=0 Error=NoError Native error=''
3/9/2011 5:13:58 PM|0|128|Strategy 'TendlineBreaksS' submitted an order that generated the following error 'OrderRejected'. Strategy has sent cancel requests, attempted to close the position and terminated itself.
3/9/2011 5:13:58 PM|1|32|Order='30bc62525e0245f2aea8c18868df0f6c/Sim101' Name='Profit target' New State=Accepted Instrument='CL 04-11' Action=Sell Limit price=104.52 Stop price=0 Quantity=1 Type=Limit Filled=0 Fill price=0 Error=NoError Native error=''
3/9/2011 5:13:58 PM|1|32|Order='30bc62525e0245f2aea8c18868df0f6c/Sim101' Name='Profit target' New State=Working Instrument='CL 04-11' Action=Sell Limit price=104.52 Stop price=0 Quantity=1 Type=Limit Filled=0 Fill price=0 Error=NoError Native error=''
3/9/2011 5:13:58 PM|1|32|Order='30bc62525e0245f2aea8c18868df0f6c/Sim101' Name='Profit target' New State=PendingCancel Instrument='CL 04-11' Action=Sell Limit price=104.52 Stop price=0 Quantity=1 Type=Limit Filled=0 Fill price=0 Error=NoError Native error=''
3/9/2011 5:13:59 PM|1|32|Order='30bc62525e0245f2aea8c18868df0f6c/Sim101' Name='Profit target' New State=Cancelled Instrument='CL 04-11' Action=Sell Limit price=104.52 Stop price=0 Quantity=1 Type=Limit Filled=0 Fill price=0 Error=NoError Native error=''
3/9/2011 5:13:59 PM|1|32|Order='49b25c014b5845f79e1cea29c501093e/Sim101' Name='Close' New State=PendingSubmit Instrument='CL 04-11' Action=Sell Limit price=0 Stop price=0 Quantity=1 Type=Market Filled=0 Fill price=0 Error=NoError Native error=''
3/9/2011 5:13:59 PM|1|32|Order='49b25c014b5845f79e1cea29c501093e/Sim101' Name='Close' New State=Accepted Instrument='CL 04-11' Action=Sell Limit price=0 Stop price=0 Quantity=1 Type=Market Filled=0 Fill price=0 Error=NoError Native error=''
3/9/2011 5:13:59 PM|1|32|Order='49b25c014b5845f79e1cea29c501093e/Sim101' Name='Close' New State=Working Instrument='CL 04-11' Action=Sell Limit price=0 Stop price=0 Quantity=1 Type=Market Filled=0 Fill price=0 Error=NoError Native error=''
3/9/2011 5:13:59 PM|1|32|Order='49b25c014b5845f79e1cea29c501093e/Sim101' Name='Close' New State=Filled Instrument='CL 04-11' Action=Sell Limit price=0 Stop price=0 Quantity=1 Type=Market Filled=1 Fill price=104.37 Error=NoError Native error=''
3/9/2011 5:13:59 PM|1|16|Execution='26d4939266034217a2986aebf1b3c8b 7' Instrument='CL 04-11' Account='Sim101' Exchange=Default Price=104.37 Quantity=1 Market position=Short Operation=Insert Order='49b25c014b5845f79e1cea29c501093e' Time='3/9/2011 5:13:59 PM'
3/9/2011 5:13:59 PM|1|64|Instrument='CL 04-11' Account='Sim101' Avg price=104.37 Quantity=0 Market position=Long Operation=Remove Currency=Unknown
Comment