Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

% Change From Open

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

    % Change From Open

    Hi,

    Thought I had this but it is off somewhere...

    I am looking for the % change from open for market analyzer and created this:

    Plot0.Set((Close[0] - CurrentDayOHL().CurrentOpen[0]) / (CurrentDayOHL().CurrentOpen[0]) * 100);

    with "caculate on bar close" set to false... it seems to change values with any time frame I change... should this not just grab the last price and do the math to create the value against the days open price?

    Thanks for any help...

    #2
    Hello,

    Thanks for the forum post.

    What internvals are you changing too that is changing this value?

    Also, who is your data feed provider?

    I look forward to assisting you further.
    BrettNinjaTrader Product Management

    Comment


      #3
      Thanks Brett,

      any interval changes the value, I was under the assumption that any value for "close" with calculate on bar close set in MA would just grab the current price to do the calculation.. is that not correct?

      I use IB data... and would switch to Kinetick if you guys can get the MA to scan the database (i'm going to keep saying that cause it is something I really want/need)

      Thanks for any help!
      RT

      Comment


        #4
        Hello,

        Its not the Close[0] I'm worried about.

        Its the CurrentDayOHL().

        Can you please add a Print() statement.

        Print(CurrentDayOHL().CurrentOpen[0]);

        Does this output change when you change intervals? If so which intervals are you changing too?

        I look forward to assisting you further.
        BrettNinjaTrader Product Management

        Comment


          #5
          I just changed intervals to see if I could get the correct %value... it was set for 30 minute bars, I then tried the 1 day bar, 1 minute bar and 1 second bar, each deliver a different reading in MA

          Comment


            #6
            add the Print statement before the code or into the code?

            Comment


              #7
              Hello,

              Add the Print statement right before you set Plot0 with this calculated value.

              Then let me know what outputs to the print window when you change intervals and if it changes.

              Let me know if I can be of further assistance.
              BrettNinjaTrader Product Management

              Comment


                #8
                Also in case you need it:

                BrettNinjaTrader Product Management

                Comment


                  #9
                  Okay, i did this but nothing has changed...

                  Print(CurrentDayOHL().CurrentOpen[0]);
                  Plot0.Set((Close[0] - CurrentDayOHL().CurrentOpen[0]) / (CurrentDayOHL().CurrentOpen[0]) * 100);

                  Comment


                    #10
                    Hello,

                    What I need is the output of this variable in the output window. How to do this is decribed in the link I linked to you on debugging your NinjaTrader. Control Center-Tools->Output window.

                    Then let me know what the value is here and also let me know what the value is after you change it.

                    I look forward to assisting you further.
                    BrettNinjaTrader Product Management

                    Comment


                      #11
                      Hi Brett,

                      Honestly I have to instruments in MA and it is creating hundreds of numbers, many the same but all different ones... do you want me to send them to you in here? When I change intervals there is a clear change in values ..

                      for the 1 day interval i only get 33.24 and 6.9

                      then on the 15 minute interval i get 46.15, 47.55, 47.60 and 12.62, 11.94, 11.85, 11.34 and so on...

                      Thanks,
                      Reed

                      Comment


                        #12
                        Hello,

                        Please narrow this down to one stock. What I suggest is closing our this column in your current MA, or close the worksapce and open a new one. Then do a fresh MA with one instrument in it and then add your indicator column. Then we want to out put this. Print value. Then you want to pull up a chart of the instrument and compare this to the actualy Current day low. Does it match up?

                        No change the interval?

                        How does it match up now with the current low?

                        Also, I might add if(Historical) return; to the top of OnBarUpdate() right after the OnBarUpdate
                        {

                        if (Historical)
                        return;



                        ..

                        This way this indicator does not run on historical and only runs live only which is what you want on a MA column.

                        I look forward to assisting you further.


                        I look forward to assisting you further.
                        BrettNinjaTrader Product Management

                        Comment


                          #13
                          okay, with doing that I get 2 values for the 15 minute interval on the output window

                          47.60 and 47.26

                          47.60 is the correct open, the MA value is still incorrect (seems to be using the 47.26 value)

                          on the 1 day interval I get one open value of 57.91 and obviously the MA value is way off

                          Comment


                            #14
                            the "add historical" just gives me a number of 47.69

                            Comment


                              #15
                              tshirtdeal,

                              At this point in time I believe it would be beneficial for us if you just attached your exact script for us to see what exactly you see on your end. Thank you.
                              Josh P.NinjaTrader Customer Service

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                              0 responses
                              582 views
                              0 likes
                              Last Post Geovanny Suaza  
                              Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                              0 responses
                              338 views
                              1 like
                              Last Post Geovanny Suaza  
                              Started by Mindset, 02-09-2026, 11:44 AM
                              0 responses
                              103 views
                              0 likes
                              Last Post Mindset
                              by Mindset
                               
                              Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                              0 responses
                              554 views
                              1 like
                              Last Post Geovanny Suaza  
                              Started by RFrosty, 01-28-2026, 06:49 PM
                              0 responses
                              552 views
                              1 like
                              Last Post RFrosty
                              by RFrosty
                               
                              Working...
                              X