Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

difference between data box value and strategy calculations

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

    difference between data box value and strategy calculations

    Hello,
    I need help finding out what causes difference between indicator values displayed in data box and the way a strategy calculates it. When simplifying my strategy in order to find out why it doesn't behave the way I expected, it eventually came down to a single statement: buy when indicator value is rising. Surprisingly the strategy enters long even though the indicator value remains the same as it was bar ago. The strategy plots the indicator on the chart, the line is clearly flat and the data box shows the indicator value has not changed on those two adjacent bars yet the strategy enters long anyway. I tried using the "rising" function as well as comparing the values on current and previous bar but the same result. Does a strategy calculates the indicator value differently than the indicator function or with more decimal places than the data box displays so that the difference can be on third or fourth decimal place and therefore not displayed in the data box? The bar type is Renko but I don't think this would be the problem since the market order is based on a change of an indicator value. Any help is appreciated. Thanks in advance.

    #2
    Hello grany,

    That depends on how the Indicator is programmed but yes, it is possible to have more decimal places inside of the Indicator plot values programmatically as the values displayed on a chart will be based on the Instruments size.

    You can verify the values with the Print() statement and get the full values displayed in the Output window (under the Tools menu). Here is a thread to that goes over this that you may view.


    Let us know if this helps out.
    JCNinjaTrader Customer Service

    Comment


      #3
      Originally posted by grany View Post
      ... Does a strategy calculates the indicator value differently than the indicator function or with more decimal places than the data box displays so that the difference can be on third or fourth decimal place and therefore not displayed in the data box? ....
      Yes. Such is the problem with floating point arithmetic in computers. Now you know why I always round my indicator values to the TickSize of the instrument, so that I have a result which has valid statistical meaning.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Geovanny Suaza, 02-11-2026, 06:32 PM
      0 responses
      637 views
      0 likes
      Last Post Geovanny Suaza  
      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
      0 responses
      366 views
      1 like
      Last Post Geovanny Suaza  
      Started by Mindset, 02-09-2026, 11:44 AM
      0 responses
      107 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by Geovanny Suaza, 02-02-2026, 12:30 PM
      0 responses
      569 views
      1 like
      Last Post Geovanny Suaza  
      Started by RFrosty, 01-28-2026, 06:49 PM
      0 responses
      572 views
      1 like
      Last Post RFrosty
      by RFrosty
       
      Working...
      X