Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

One candle difference between Strategy and Indicator

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

    One candle difference between Strategy and Indicator

    I have discovered an inconsistency between the strategy analyzer and my indicator. If I make the measurements directly over the indicator, then I have the right entry point (IsFalling(buy short) or IsRising(buy long)). If I do the whole thing within a strategy, then the trade is always delayed for one candle (see the attached Screenshot)...

    Where does this difference come from and how can i set the trade in the strategy to the same candle as the indicator is drawing an arrow down/up?

    PS: I have already excluded Calculate.OnBarClose.
    Attached Files

    #2
    Hello Sweet&Sour,

    When using Strategy Analyzer, backtesting the strategy will run exactly the same as if CalculateOnBarClose is set to true. This is true whenever the strategy runs on historical type data. The reason for this is because the only info known historically is the Bar open, High, Low and close and not all of the ticks that make up the bar.

    You can also get extremely misleading results if you are using a bar that changes shape such as renko bar type as the finished bar does not show the true range of price movement.

    You may want to try testing on live data or Market replay data to get a better sense of your strategy performance.

    Please let us know if we can be of further assistance.
    Alan P.NinjaTrader Customer Service

    Comment


      #3
      Hi Alan,

      Thanks for the explanation. I'm using a 1500 Tick chart. Using real time data or playback data, trades "would be" placed as expected. The indicator itself also uses the Calculate.OnBarClose property.

      In my case it seems that the NT strategy back testing could be extremely misleading. In a simple case like an MA which is falling/rising, i would expect that as soon as a candle has been completed and the MA direction has changed, a trade should be placed at the opening right on the next bar, not one bar after.

      Fortunately, I have programmed my own back testing calculations (by trade, daily and historical) directly into my indicator set, so i'm able to see visually in the chart, how the strategy would exactly perform. During a six months NT back testing (in comparison to an indicator back testing), i just noticed that I've lost a huge amount of profit (in a middle four-digit range), just because of a single bar of delay per trade :-(
      Last edited by Sweet&Sour; 09-06-2017, 10:24 AM.

      Comment


        #4
        Hello Sweet&Sour,

        To resolve this you could add a secondary series of type tick. Please see the following link,



        Please let us know if you need further assistance.
        Alan P.NinjaTrader Customer Service

        Comment


          #5
          Looks like setting the barsInProgressIndex qualifier in the EnterLong method could solve this "inconvenience"

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by judysamnt7, 03-13-2023, 09:11 AM
          4 responses
          57 views
          0 likes
          Last Post DynamicTest  
          Started by ScottWalsh, Today, 06:52 PM
          4 responses
          36 views
          0 likes
          Last Post ScottWalsh  
          Started by olisav57, Today, 07:39 PM
          0 responses
          7 views
          0 likes
          Last Post olisav57  
          Started by trilliantrader, Today, 03:01 PM
          2 responses
          19 views
          0 likes
          Last Post helpwanted  
          Started by cre8able, Today, 07:24 PM
          0 responses
          9 views
          0 likes
          Last Post cre8able  
          Working...
          X