Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

SetStopLoss Method

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

    SetStopLoss Method

    If I want to place a stoploss at 2%, should I write
    SetStopLoss(CalculationMode.Percent,0.02);
    OR
    SetStopLoss(CalculationMode.Percent,2);

    Thanks

    #2
    Hello sherazwaqar,
    Thanks for writing in and I am happy to assist you.

    To place a stop of 2% using the CalculationMode.Percent, please use the 0.02 as the value.
    Code:
    SetStopLoss(CalculationMode.Percent, .02);
    The value the stop loss order is offset from the position entry price (exception is using .Price mode where 'value' will represent the actual price)


    Please let me know if I can assist you any further.
    JoydeepNinjaTrader Customer Service

    Comment


      #3
      This may be a dumb question, but it's not clear to me how percent mode works. Can I use percent mode in Initialize()? If so, what price is the % being calculated on?

      Thanks.

      Comment


        #4
        Yes, you can use CalculationMode.Percent in Initialize.

        The price of the stop order will be in terms of percent of the avg entry price.
        MatthewNinjaTrader Product Management

        Comment


          #5
          Thanks much! That's what I thought but needed to verify for a client.

          Comment

          Latest Posts

          Collapse

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