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 argusthome, 03-08-2026, 10:06 AM
    0 responses
    68 views
    0 likes
    Last Post argusthome  
    Started by NabilKhattabi, 03-06-2026, 11:18 AM
    0 responses
    41 views
    0 likes
    Last Post NabilKhattabi  
    Started by Deep42, 03-06-2026, 12:28 AM
    0 responses
    24 views
    0 likes
    Last Post Deep42
    by Deep42
     
    Started by TheRealMorford, 03-05-2026, 06:15 PM
    0 responses
    27 views
    0 likes
    Last Post TheRealMorford  
    Started by Mindset, 02-28-2026, 06:16 AM
    0 responses
    54 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Working...
    X