Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Setting TrailingStop for index-strategy

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

    Setting TrailingStop for index-strategy

    Hallo,

    this is a piece of my code i´m using in my strategy (LONG):

    if (WMA(Weighted, 20)[0] > WMA(Weighted, 50)[0]
    && Low[0] > WMA(Weighted, 20)[0]
    && WMA(Weighted, 20)[0] > WMA(Weighted, 20)[4]
    && Close[0] > Swing(5).SwingHigh[0])
    {
    EnterLong(DefaultQuantity, "Long");
    BarColor = Color.CornflowerBlue;
    CandleOutlineColor = Color.CornflowerBlue;
    BackColor = Color.MidnightBlue;

    I´m trading DAX-, Dow Jones- and Bund - Future.

    My question is:

    How can i set the the trailingstop correctly?
    My favourite trailing stop ist the last swing point (Swing.Low or .High like in the code above)
    LONG : ever when the next swing.low ist passed - this ist the next SL.
    SHORT vice versa.

    Thanks for your help
    Blackburn

    #2
    Hi Blackbun,

    If you want to set stop loss at a specific value, then use CalculationMode.Price, like
    SetStopLoss(CalculationMode.Price, yourValue);

    I would be sure to Print() the value of swing you plan on putting in, so you know what to expect.

    Ryan M.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by DannyP96, 05-18-2026, 02:38 PM
    1 response
    26 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 05-11-2026, 05:56 AM
    0 responses
    115 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 05-10-2026, 08:12 PM
    0 responses
    69 views
    0 likes
    Last Post CarlTrading  
    Started by Hwop38, 05-04-2026, 07:02 PM
    0 responses
    226 views
    0 likes
    Last Post Hwop38
    by Hwop38
     
    Started by CaptainJack, 04-24-2026, 11:07 PM
    0 responses
    412 views
    0 likes
    Last Post CaptainJack  
    Working...
    X