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 Mindset, 04-21-2026, 06:46 AM
      0 responses
      101 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by M4ndoo, 04-20-2026, 05:21 PM
      0 responses
      144 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Started by M4ndoo, 04-19-2026, 05:54 PM
      0 responses
      71 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Started by cmoran13, 04-16-2026, 01:02 PM
      0 responses
      125 views
      0 likes
      Last Post cmoran13  
      Started by PaulMohn, 04-10-2026, 11:11 AM
      0 responses
      79 views
      0 likes
      Last Post PaulMohn  
      Working...
      X