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 helpwanted, Today, 03:06 AM
    1 response
    8 views
    0 likes
    Last Post sarafuenonly123  
    Started by Brevo, Today, 01:45 AM
    0 responses
    7 views
    0 likes
    Last Post Brevo
    by Brevo
     
    Started by aussugardefender, Today, 01:07 AM
    0 responses
    5 views
    0 likes
    Last Post aussugardefender  
    Started by pvincent, 06-23-2022, 12:53 PM
    14 responses
    242 views
    0 likes
    Last Post Nyman
    by Nyman
     
    Started by TraderG23, 12-08-2023, 07:56 AM
    9 responses
    385 views
    1 like
    Last Post Gavini
    by Gavini
     
    Working...
    X