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 CarlTrading, 03-31-2026, 09:41 PM
      1 response
      68 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 04-01-2026, 02:41 AM
      0 responses
      38 views
      0 likes
      Last Post CarlTrading  
      Started by CaptainJack, 03-31-2026, 11:44 PM
      0 responses
      63 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