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 argusthome, Yesterday, 10:06 AM
          0 responses
          20 views
          0 likes
          Last Post argusthome  
          Started by NabilKhattabi, 03-06-2026, 11:18 AM
          0 responses
          18 views
          0 likes
          Last Post NabilKhattabi  
          Started by Deep42, 03-06-2026, 12:28 AM
          0 responses
          14 views
          0 likes
          Last Post Deep42
          by Deep42
           
          Started by TheRealMorford, 03-05-2026, 06:15 PM
          0 responses
          9 views
          0 likes
          Last Post TheRealMorford  
          Started by Mindset, 02-28-2026, 06:16 AM
          0 responses
          38 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Working...
          X