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 Mindset, 04-21-2026, 06:46 AM
    0 responses
    116 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by M4ndoo, 04-20-2026, 05:21 PM
    0 responses
    163 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by M4ndoo, 04-19-2026, 05:54 PM
    0 responses
    83 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by cmoran13, 04-16-2026, 01:02 PM
    0 responses
    127 views
    0 likes
    Last Post cmoran13  
    Started by PaulMohn, 04-10-2026, 11:11 AM
    0 responses
    87 views
    0 likes
    Last Post PaulMohn  
    Working...
    X