Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

setup stop on multitimeframe strategy

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

    setup stop on multitimeframe strategy

    i have multitimeframes in my strategy. how do i setup stops.
    i am trying to setup in the initialize method but dunno how to set ATR(14) value as the stop. how do i do do it.

    #2
    Hello,

    Thank you for your forum post.

    You will not want to set SetStopLoss in initialize if you are using a stop that will change. This needs to be down in OnBarUpdate();

    You must set your stop before you submit your entry so that it is in the correct BarsInProgress check and gets the correct value.

    So before you use EnterLong() for example to get into your trade set you stop.

    SetStopLoss(YourStopPriceHere);
    EnterLong();

    Set YourStopPriceHere variable with whatever price you want to use. If you want to use an ATR specify ATR[0] here.



    Let me know if I can be of further assistance.
    BrettNinjaTrader Product Management

    Comment


      #3
      when i setup as ATR(14)[0] Should the CalculationMode be in ticks?

      Comment


        #4
        Hello,

        Sure you will use CalculationMode.Ticks. You will want to insure that ATR()[0] is in fact a value integer. So you would want to typecast/convert to an int for this to make sure there are no issues.

        int stopLoss = (int)ATR(14)[0];

        then SetStopLoss(CalculationMode.Ticks, stoploss);

        Let me know if I can be of further assistance.

        BrettNinjaTrader Product Management

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        600 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        346 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        103 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        558 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        558 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X