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 CarlTrading, 03-31-2026, 09:41 PM
          1 response
          67 views
          0 likes
          Last Post NinjaTrader_ChelseaB  
          Started by CarlTrading, 04-01-2026, 02:41 AM
          0 responses
          36 views
          0 likes
          Last Post CarlTrading  
          Started by CaptainJack, 03-31-2026, 11:44 PM
          0 responses
          60 views
          1 like
          Last Post CaptainJack  
          Started by CarlTrading, 03-30-2026, 11:51 AM
          0 responses
          62 views
          0 likes
          Last Post CarlTrading  
          Started by CarlTrading, 03-30-2026, 11:48 AM
          0 responses
          53 views
          0 likes
          Last Post CarlTrading  
          Working...
          X