Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

SetProfitTarget() is not updating dynamically during Backtest

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

    SetProfitTarget() is not updating dynamically during Backtest

    Hi-

    I have created a strategy that sends a profit target at the time of entry in the OnBarUpdate() method in the following manner:
    SetProfitTarget("", CalculationMode.Price, NNNN);


    In addition, after entry has occurred, I have additional code that is below the entry code in the following manner:

    if (Position.MarketPosition == MarketPosition.Long)
    {
    SetProfitTarget("", CalculationMode.Price, NNNN);
    }


    However, only one set of orders (i.e., the orders generated at entry) is generated during the backtest according to the Strategy Analyzer's Order page. It appears that Ninjatrader is not updating the dynamic profit targets.

    How do I get Ninjatrader to dynamically adjust Profit Targets on each bar update buring a BACKTEST?

    #2
    You need to actually be submitting a price that is different if you want it to change. Please also see this reference sample: http://www.ninjatrader-support2.com/...ead.php?t=3222
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      Originally posted by NinjaTrader_Josh View Post
      You need to actually be submitting a price that is different if you want it to change. Please also see this reference sample: http://www.ninjatrader-support2.com/...ead.php?t=3222

      Never mind. I had it fixed...I just forgot to change to the corrected strategy in the drop down list

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by NullPointStrategies, Yesterday, 05:17 AM
      0 responses
      72 views
      0 likes
      Last Post NullPointStrategies  
      Started by argusthome, 03-08-2026, 10:06 AM
      0 responses
      143 views
      0 likes
      Last Post argusthome  
      Started by NabilKhattabi, 03-06-2026, 11:18 AM
      0 responses
      76 views
      0 likes
      Last Post NabilKhattabi  
      Started by Deep42, 03-06-2026, 12:28 AM
      0 responses
      47 views
      0 likes
      Last Post Deep42
      by Deep42
       
      Started by TheRealMorford, 03-05-2026, 06:15 PM
      0 responses
      51 views
      0 likes
      Last Post TheRealMorford  
      Working...
      X