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 Brevo, Today, 01:45 AM
      0 responses
      2 views
      0 likes
      Last Post Brevo
      by Brevo
       
      Started by aussugardefender, Today, 01:07 AM
      0 responses
      3 views
      0 likes
      Last Post aussugardefender  
      Started by pvincent, 06-23-2022, 12:53 PM
      14 responses
      238 views
      0 likes
      Last Post Nyman
      by Nyman
       
      Started by TraderG23, 12-08-2023, 07:56 AM
      9 responses
      384 views
      1 like
      Last Post Gavini
      by Gavini
       
      Started by oviejo, Today, 12:28 AM
      0 responses
      6 views
      0 likes
      Last Post oviejo
      by oviejo
       
      Working...
      X