Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Stop loss vs trailing stop

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

    Stop loss vs trailing stop

    I saw in the help guide that The SetStopLoss() method can NOT be used concurrently with the SetTrailStop() method for the same position...
    But this is possible in ATM Stategy...
    So if in my code I use
    protectedoverridevoid Initialize()
    {
    SetStopLoss(CalculationMode.Percent, perstop);
    SetTrailStop(CalculationMode.Percent,
    2*perstop);

    CalculateOnBarClose =
    true;
    }
    it seems that SetStopLoss will take the precedence...
    So how to manage both orders like in the ATM Strategy?

    #2
    Unfortunately the helpguide is correct and you can't use them on the same position concurrently.

    You can either call an ATM template to manage the exit then, or you use the SetStopLoss and trail / change the price manually in your code as needed -



    To see a sample strategy calling ATM's, please consult the SampleAtmStrategy we have provided per default with NinjaTrader.
    BertrandNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Mongo, Today, 11:05 AM
    2 responses
    7 views
    0 likes
    Last Post Mongo
    by Mongo
     
    Started by guillembm, Today, 11:25 AM
    0 responses
    3 views
    0 likes
    Last Post guillembm  
    Started by Tim-c, Today, 10:58 AM
    1 response
    3 views
    0 likes
    Last Post NinjaTrader_Jesse  
    Started by traderqz, Yesterday, 09:06 AM
    4 responses
    27 views
    0 likes
    Last Post traderqz  
    Started by traderqz, Today, 12:06 AM
    4 responses
    8 views
    0 likes
    Last Post traderqz  
    Working...
    X