Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Stratgey with trail stop terminated on target filled

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Stratgey with trail stop terminated on target filled

    I run a strategy on NT 6.5 with target 10 ticks and trail stop 6 ticks.
    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
    Last edited by Klaus Hengher; 03-09-2011, 04:40 PM.

    #2
    You can set your own error handling actions. This page can help with this and provide some examples:


    TrailStop is a little more involved since you do not have the IOrder object directly. Can refer to this sample for help monitoring for this type of order (orders placed with Set statements).
    Ryan M.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by argusthome, 03-08-2026, 10:06 AM
    0 responses
    110 views
    0 likes
    Last Post argusthome  
    Started by NabilKhattabi, 03-06-2026, 11:18 AM
    0 responses
    59 views
    0 likes
    Last Post NabilKhattabi  
    Started by Deep42, 03-06-2026, 12:28 AM
    0 responses
    37 views
    0 likes
    Last Post Deep42
    by Deep42
     
    Started by TheRealMorford, 03-05-2026, 06:15 PM
    0 responses
    41 views
    0 likes
    Last Post TheRealMorford  
    Started by Mindset, 02-28-2026, 06:16 AM
    0 responses
    78 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Working...
    X