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 charlesugo_1, 05-26-2026, 05:03 PM
          0 responses
          64 views
          0 likes
          Last Post charlesugo_1  
          Started by DannyP96, 05-18-2026, 02:38 PM
          1 response
          149 views
          0 likes
          Last Post NinjaTrader_ChelseaB  
          Started by CarlTrading, 05-11-2026, 05:56 AM
          0 responses
          162 views
          0 likes
          Last Post CarlTrading  
          Started by CarlTrading, 05-10-2026, 08:12 PM
          0 responses
          99 views
          0 likes
          Last Post CarlTrading  
          Started by Hwop38, 05-04-2026, 07:02 PM
          0 responses
          286 views
          0 likes
          Last Post Hwop38
          by Hwop38
           
          Working...
          X