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 Tim-c, Today, 03:54 AM
      0 responses
      3 views
      0 likes
      Last Post Tim-c
      by Tim-c
       
      Started by FrancisMorro, Today, 03:24 AM
      0 responses
      2 views
      0 likes
      Last Post FrancisMorro  
      Started by Segwin, 05-07-2018, 02:15 PM
      10 responses
      1,770 views
      0 likes
      Last Post Leafcutter  
      Started by Rapine Heihei, 04-23-2024, 07:51 PM
      2 responses
      31 views
      0 likes
      Last Post Max238
      by Max238
       
      Started by Shansen, 08-30-2019, 10:18 PM
      24 responses
      945 views
      0 likes
      Last Post spwizard  
      Working...
      X