Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Enhanced On Balance Volume Indicator

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

    #16
    Originally posted by roonius View Post
    Actually, your version is good, just missing one little (or may be big) thing - whenever you divide something , ALWAYS check your divisor !=0.
    I corrected your mistake.
    Thanks a lot. I knew it was probably something small I was overlooking. I've never considered the divide by zero error, but I'll have to make sure I do from now on.

    Comment


      #17
      Thank you both ! for taking the time to work on this .
      Much appreciated .

      Comment


        #18
        Follow up question

        The indicator updates on bar completion . I changed one statement like this :
        CalculateOnBarClose = false; : ,but there must be something else the needs to changed ,maybe this : if (CalculateOnBarClose) : ??? Nope , lost
        again .

        Comment


          #19
          Originally posted by T2020 View Post
          The indicator updates on bar completion . I changed one statement like this :
          CalculateOnBarClose = false; : ,but there must be something else the needs to changed ,maybe this : if (CalculateOnBarClose) : ??? Nope , lost
          again .
          What are you trying to do?
          Just set calculate on bar close to false in the indicators windows if you want it to update every tick.

          Comment


            #20
            Originally posted by Elliott Wave View Post
            What are you trying to do?
            Just set calculate on bar close to false in the indicators windows if you want it to update every tick.
            I did ,but it didn't change anything . That's why I thought maybe something
            needed to be changed in the code .... ?Does it update every tick for you when you set it that way ?

            Comment


              #21
              Here you go
              Attached Files
              Last edited by roonius; 01-08-2009, 08:39 PM.

              Comment


                #22
                Originally posted by roonius View Post
                Here you go
                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 .

                Comment


                  #23
                  Roonius,

                  I clipped this code from your indicator.

                  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]);



                  You have this exception in there twice:

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

                  i don't see any exceptions if ((Open[0]-Low[0])were to equal zero.

                  It looks like it could pop with an infinite number.


                  What are your thoughts,


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

                  Comment


                    #24
                    Originally posted by rt6176 View Post
                    Roonius,

                    I clipped this code from your indicator.

                    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]);

                    You mave this in there twice:

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

                    i don't see any exceptions if ((Open[0]-Low[0])==0)

                    It looks like it could pop with an infinite number.


                    What are your thoughts,


                    RJay
                    (Open[0]-Low[0]) is not a divisor

                    The only divisor we have is High[0] - Low[0]
                    Last edited by roonius; 01-08-2009, 08:39 PM.

                    Comment


                      #25
                      Variable * 0 / Variable.

                      Punch it in a calculator and see what happens.
                      RJay
                      NinjaTrader Ecosystem Vendor - Innovative Trading Solutions

                      Comment


                        #26
                        Originally posted by rt6176 View Post
                        Variable * 0 / Variable.

                        Punch it in a calculator and see what happens.

                        As long as Variable !=0 it's ok
                        Last edited by roonius; 01-08-2009, 08:38 PM.

                        Comment


                          #27
                          You covered (High - Low) but not (Open - Low)
                          RJay
                          NinjaTrader Ecosystem Vendor - Innovative Trading Solutions

                          Comment


                            #28
                            I might be repeating myself, but Open - Low is not a divisor; So is not High - Open;
                            The only divisor is High - Low
                            Last edited by roonius; 01-08-2009, 08:38 PM.

                            Comment


                              #29
                              Maybe your right and I just don't get it.

                              variable * 0 = What?

                              0 / Variable = What?

                              I thought this would make any equation explode.
                              RJay
                              NinjaTrader Ecosystem Vendor - Innovative Trading Solutions

                              Comment


                                #30
                                Originally posted by rt6176 View Post
                                Maybe your right and I just don't get it.

                                variable * 0 = What?
                                0 / Variable = What?
                                I thought this would make any equation explode.
                                variable * 0 = What? --- 0

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

                                You can do 0/Variable but can not Variable/0
                                Last edited by roonius; 01-08-2009, 08:38 PM.

                                Comment

                                Latest Posts

                                Collapse

                                Topics Statistics Last Post
                                Started by TheWhiteDragon, 01-21-2019, 12:44 PM
                                4 responses
                                541 views
                                0 likes
                                Last Post PaulMohn  
                                Started by GLFX005, Today, 03:23 AM
                                0 responses
                                2 views
                                0 likes
                                Last Post GLFX005
                                by GLFX005
                                 
                                Started by XXtrader, Yesterday, 11:30 PM
                                2 responses
                                11 views
                                0 likes
                                Last Post XXtrader  
                                Started by Waxavi, Today, 02:10 AM
                                0 responses
                                7 views
                                0 likes
                                Last Post Waxavi
                                by Waxavi
                                 
                                Started by TradeForge, Today, 02:09 AM
                                0 responses
                                14 views
                                0 likes
                                Last Post TradeForge  
                                Working...
                                X