Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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 DawnTreader, 05-08-2024, 05:58 PM
          7 responses
          27 views
          0 likes
          Last Post NinjaTrader_Gaby  
          Started by sgordet, Today, 05:24 AM
          0 responses
          7 views
          0 likes
          Last Post sgordet
          by sgordet
           
          Started by royhagerman, Today, 04:30 AM
          0 responses
          1 view
          0 likes
          Last Post royhagerman  
          Started by haas88, 03-21-2024, 02:22 AM
          18 responses
          211 views
          0 likes
          Last Post haas88
          by haas88
           
          Started by Board game geek, Today, 02:20 AM
          0 responses
          11 views
          0 likes
          Last Post Board game geek  
          Working...
          X