Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Enhanced On Balance Volume Indicator

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

    #31
    It'd be nice if what ever was doing it could be resolved , but doesn't appear to be very obvious .... ???

    Comment


      #32
      Originally posted by roonius View Post
      variable * 0 = What? --- 0

      0 / Variable = What? --- 0 as long as Variable != 0

      You can do 0/Variable but can not Variable/0

      Your Right, I apologise. Don't ever get old.

      I should have checked before saying anything.

      I guess I'm the "zero".

      RJay
      Last edited by RJay; 12-16-2008, 03:55 PM.
      RJay
      NinjaTrader Ecosystem Vendor - Innovative Trading Solutions

      Comment


        #33
        if (CurrentBar == 0)
        {
        if((High[0]-Low[0])!=0)
        {
        volUp.Set(Volume[0]*((High[0]-Open[0])/(High[0]-Low[0])));
        volDn.Set(Volume[0]*((Open[0]-Low[0])/(High[0]-Low[0])));
        } else
        {
        volUp.Set(0);
        volDn.Set(0);
        }
        } else

        if((High[0]-Low[0])!=0)
        {

        volUp.Set(volUp[1] + Volume[0]*((High[0]-Open[0])/(High[0]-Low[0])));
        volDn.Set(volDn[1] + Volume[0]*((Open[0]-Low[0]) /(High[0]-Low[0])));
        }

        OBVplot.Set(volUp[0] - volDn[0]);

        Is the "
        if((High[0]-Low[0])!=0)" suppose to take
        care of any divide by zero problems ? Maybe it's not doing what it's suppose to . What
        if You just went
        ((High[0]-Open[0])/(High[0]-Low[0] +.00001)));
        ??

        Comment


          #34
          Guys you may be running into double.Epsilon issues. Please review this article: http://www.ninjatrader-support2.com/...ead.php?t=3929

          To check for zero do this:
          Code:
          if (High[0] - Low[0] < double.Epsilon)
             // It is zero;
          Josh P.NinjaTrader Customer Service

          Comment


            #35
            Thank you Ray for reminding me this isue
            Last edited by roonius; 01-08-2009, 08:38 PM.

            Comment


              #36
              Originally posted by T2020 View Post
              Thanks again roonius . I notice that there is an extreme spike in the indicator
              right at the beginning of a new bar occasionally ,but resumes normal working
              almost immediately . Just something I'm leaving feed back on .
              I wish i knew how to do this . I'd be adding moving averages to it , trying
              certain period summations of the same formula . I could do all that on my
              previous software , unfortunately it didn't have anything remotely as good as
              the Ninja chart trader ,which I've come to rely on . Oh well . Thanks again .
              Let me know if this will solve extreme spikes. I am not experiensing them my self, so I can not test
              Attached Files
              Last edited by roonius; 01-08-2009, 08:38 PM.

              Comment


                #37
                Originally posted by roonius View Post
                Let me know if this will solve extreme spikes. I am not experiensing them my self, so I can not test
                Will do , thanks again .

                Comment


                  #38
                  Following up

                  This hasn't seemed to cure the problem here . I did notice the spike is less
                  extreme on a 30 second chart as opposed to a 1 minute chart . Changing
                  the 1 min to 60 second actually reduced the severity of the spike . I wonder
                  if it has something to do with me being on a wireless ISP . Not quite the quality of a land line . Packets get dropped . Using TT not Zen fire ??? It works well enough for me to stick with it . I do think it's better than the regular OBV .

                  Comment


                    #39
                    Originally posted by NinjaTrader_Josh View Post
                    Guys you may be running into double.Epsilon issues. Please review this article: http://www.ninjatrader-support2.com/...ead.php?t=3929

                    To check for zero do this:
                    Code:
                    if (High[0] - Low[0] < double.Epsilon)
                       // It is zero;
                    Were you suggesting to add this code to the indicator ? Tried it for the heck
                    of it . Makes the indicator flat line .

                    Comment


                      #40
                      No, I think this was just an example how the syntax is to be used.
                      BertrandNinjaTrader Customer Service

                      Comment


                        #41
                        Still spiking away . If it's above zero ,it spikes down to zero and the reverse
                        if it's below zero . Gets annoying . Mainly watching a 30 second chart .

                        Comment


                          #42
                          The code snippet I provided is just for your comparisons. When subtracting doubles, a value greater than epsilon would mean it is not zero. Do a <= check for an equality check of 0.
                          Josh P.NinjaTrader Customer Service

                          Comment


                            #43
                            Originally posted by NinjaTrader_Josh View Post
                            The code snippet I provided is just for your comparisons. When subtracting doubles, a value greater than epsilon would mean it is not zero. Do a <= check for an equality check of 0.
                            Any other thoughts why this continues to spike to the zero line ? I added this to the code as a " I'll try anything that might help " .00001 ..... code snip >'

                            if((High[0]-Low[0])!=0)
                            {
                            volUp.Set(volUp[1] + Volume[0]*((High[0]-Open[0])/(High[0]-Low[0]+.00001)));

                            volDn.Set(volDn[1] + Volume[0]*((Open[0]-Low[0])/(High[0]-Low[0]+.00001)));
                            }

                            Comment


                              #44
                              T2020, please post a screenshot what you mean by spiking through the zero line...we do not have the bandwidth to debug this, but I would make sure to Plot / Print any calculated value and isolate the one that is being miscalculated...step by step...
                              BertrandNinjaTrader Customer Service

                              Comment


                                #45
                                This is as close as I can come because the spike only lasts about 1 second .
                                What I mean is the OBV line will spike down and touch the zero line . I have
                                drawn a blue line to mark it . Not sure what you mean by not having the bandwidth ?
                                Attached Files

                                Comment

                                Latest Posts

                                Collapse

                                Topics Statistics Last Post
                                Started by burtoninlondon, Today, 12:38 AM
                                0 responses
                                10 views
                                0 likes
                                Last Post burtoninlondon  
                                Started by AaronKoRn, Yesterday, 09:49 PM
                                0 responses
                                14 views
                                0 likes
                                Last Post AaronKoRn  
                                Started by carnitron, Yesterday, 08:42 PM
                                0 responses
                                11 views
                                0 likes
                                Last Post carnitron  
                                Started by strategist007, Yesterday, 07:51 PM
                                0 responses
                                14 views
                                0 likes
                                Last Post strategist007  
                                Started by StockTrader88, 03-06-2021, 08:58 AM
                                44 responses
                                3,983 views
                                3 likes
                                Last Post jhudas88  
                                Working...
                                X