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 rtwave, 04-12-2024, 09:30 AM
    4 responses
    31 views
    0 likes
    Last Post rtwave
    by rtwave
     
    Started by yertle, Yesterday, 08:38 AM
    7 responses
    29 views
    0 likes
    Last Post yertle
    by yertle
     
    Started by bmartz, 03-12-2024, 06:12 AM
    2 responses
    22 views
    0 likes
    Last Post bmartz
    by bmartz
     
    Started by funk10101, Today, 12:02 AM
    0 responses
    7 views
    0 likes
    Last Post funk10101  
    Started by gravdigaz6, Yesterday, 11:40 PM
    1 response
    9 views
    0 likes
    Last Post NinjaTrader_Manfred  
    Working...
    X