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

Automated strategy: Adjust StopLoss

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

    Automated strategy: Adjust StopLoss

    I am trying to reset my StopLoss in an Automated Strategy while in a trade.

    I have the Initial StopLoss set as:

    SetStopLoss("", CalculationMode.Ticks, iStopLoss, false);

    Where the StopLoss setting is set when you configure the strategy based on your risk tolerance.

    So then I try to set the StopLoss as the trade progresses to minimize any losses by using:

    SetStopLoss("", CalculationMode.Currency, dCurrStopLoss, false);

    Where dCurrStopLoss is adjusted based on current price compared to purchase price.

    I get this message in the Output Window:

    Stop/target handling set to 'By strategy position' since currency based stop order was placed.

    And even though the StopLoss target that is set is reached the position does not close.
    What is the preferred method for adjusting stop loss in an Automated Trade?

    Thanks.

    #2
    Hello ATMtrader0001,

    You could use CalculationMode.Price or any of the other modes instead of Currency here. Currency is used for "PnL away from average entry. Calculated by the dollar per tick value for the order quantity used." however this also toggles the target handling. To avoid that you can use any of the other modes and modify how you are calculating what you want for the new value.

    I look forward to being of further assistance.
    JesseNinjaTrader Customer Service

    Comment


      #3
      Thank you. Changing it to .Price worked like a champ.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by DJ888, 04-16-2024, 06:09 PM
      6 responses
      18 views
      0 likes
      Last Post DJ888
      by DJ888
       
      Started by Jon17, Today, 04:33 PM
      0 responses
      1 view
      0 likes
      Last Post Jon17
      by Jon17
       
      Started by Javierw.ok, Today, 04:12 PM
      0 responses
      6 views
      0 likes
      Last Post Javierw.ok  
      Started by timmbbo, Today, 08:59 AM
      2 responses
      10 views
      0 likes
      Last Post bltdavid  
      Started by alifarahani, Today, 09:40 AM
      6 responses
      41 views
      0 likes
      Last Post alifarahani  
      Working...
      X