Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

settrailstop - script

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

    settrailstop - script

    Hello,

    as I can not connect to zenfire after the upgrade to NTx18 I´m working round with my scripts to see what I can improve. I have a simple idea now but this doesn´t work: I want to add a SetTrailStop if there is an overfill. So I added to my "longstrategy" (where there should only be long trades referring to the conditions) in case of shorts (I added in OnBarUpdate as I understand from the helpguide that SetTrailStop will not work in OnExecution):

    else if (Position.MarketPosition == MarketPosition.Short)
    SetTrailStop(CalculationMode.Ticks, 12);

    When I do simulate an overfill with simulated datafeed there is no trailstop for my overfill.

    and there is also no trailstop with
    SetTrailStop("", CalculationMode.Ticks, 12, false);


    Thank you!

    Best regards
    Tony
    Last edited by tonynt; 12-31-2013, 06:54 AM. Reason: typing error

    #2
    Hello Tony,

    Since you are using the Managed Approach you would not be able to use the "SetTrailStop" method when you get an "over fill" since NinjaTrader will automatically try to close out of your position and disable your strategy.

    If you wanted NinjaTrader to ignore an over fill you will have to use the Unmanaged Apporoach to be able to set the "IgnoreOverFill" variable.

    JCNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by argusthome, 03-08-2026, 10:06 AM
    0 responses
    77 views
    0 likes
    Last Post argusthome  
    Started by NabilKhattabi, 03-06-2026, 11:18 AM
    0 responses
    45 views
    0 likes
    Last Post NabilKhattabi  
    Started by Deep42, 03-06-2026, 12:28 AM
    0 responses
    27 views
    0 likes
    Last Post Deep42
    by Deep42
     
    Started by TheRealMorford, 03-05-2026, 06:15 PM
    0 responses
    32 views
    0 likes
    Last Post TheRealMorford  
    Started by Mindset, 02-28-2026, 06:16 AM
    0 responses
    62 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Working...
    X