Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

Problems with Indicator values displayed in Data Box

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

    Problems with Indicator values displayed in Data Box

    Hello,

    I created a simple indicator using the ninja indicator wizard. But the values being dispalyed and plotted do not align with the same data processed through the same equation in excel. I have provided my code and how I tested the values...wondering if you have any ideas why the values ( angles ) I calculate are not the same....



    I inserted the following code where appropriate in my simple indicator

    if (CurrentBar < 2)
    return;

    double delta_ema60 = EMA(60)[0] - EMA(60)[1];
    double ema60angle = Math.Atan( delta_ema60 )*57.29577;

    EMA60.Set( Math.Abs(ema60angle) );





    I next tried to validate the values returned using an excel formula. This formula was as follows:

    angle_excel = ATAN(delta)*57.29577


    Note1 delta is defined as the EMA[0] - EMA[1] (current - previous)
    Note2 I validated the excel angles using a hand held calculator
    Note3 I realize the source code using the ABS function, but it's N/A with data I tested with

    The following is data I obtained from the Data Window using 1 minute bars for the SnP Emini on 8/24/09 along with the angle I belive it should be...

    time EMA60 delta angle_ninja angle_excel
    8/24/09 14:00:00 1024.08 N/A N/A N/A
    8/24/09 14:01:00 1024.14 0.06 3.13 3.433629792
    8/24/09 14:02:00 1024.19 0.05 3.03 2.862404751
    8/24/09 14:03:00 1024.24 0.05 2.93 2.862404751


    I would expect these angles to be the same. More of a concern is the angle_ninja for 14:02 and 14:03, the angle should be the same becasue the delta value are the same. Any ideas?


    thanks,
    -t

    #2
    Originally posted by tulanch View Post
    ...The following is data I obtained from the Data Window ...
    ...More of a concern is the angle_ninja for 14:02 and 14:03, the angle should be the same becasue the delta value are the same...?
    The data window rounds the values to 2 digits. I don't think that your EMA differences are identical, that should be nearly impossible. You could obtain the real values with a print statement: Print(EMA(60)[0] - EMA(60)[1]);

    Regards
    Ralph

    Comment


      #3
      hi tulanch,
      the data-box-window rounds the values to the digits of your used instrument :
      FESX+YM = only full numbers
      ES = 2 digits
      6E = 4 digits and so on
      Not to real ticksize but to the number of the digits.
      you can make your own "data-box" as textbox (as an indicator in the chart) to show you the real+needed values in a format you want it.
      Last edited by max-td; 08-25-2009, 01:33 AM.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by PaulMohn, Today, 12:36 PM
      2 responses
      16 views
      0 likes
      Last Post PaulMohn  
      Started by Conceptzx, 10-11-2022, 06:38 AM
      2 responses
      53 views
      0 likes
      Last Post PhillT
      by PhillT
       
      Started by Kaledus, Today, 01:29 PM
      0 responses
      4 views
      0 likes
      Last Post Kaledus
      by Kaledus
       
      Started by yertle, Yesterday, 08:38 AM
      8 responses
      37 views
      0 likes
      Last Post ryjoga
      by ryjoga
       
      Started by rdtdale, Today, 01:02 PM
      1 response
      6 views
      0 likes
      Last Post NinjaTrader_LuisH  
      Working...
      X