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

Bollinger on OBV ?

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

    Bollinger on OBV ?

    Shouldn't something like this work . A minor change to the original Bollinger
    indicator to make bands of OBV ?
    Value.Set(OBV(SMA(Period))[0] + NumStdDev * StdDev(Period)[0]); Value.Set(OBV(SMA(Period))[0]);
    Value.Set(OBV(SMA(Period))[0] - NumStdDev * StdDev(Period)[0]);

    #2
    Would imagine you would get something plotted out of that, but you can't just use Value.Set for all 3. Value is a single plot. Going .Set 3 different times is just going to overwrite prior .Set calls.
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      Originally posted by NinjaTrader_Josh View Post
      Would imagine you would get something plotted out of that, but you can't just use Value.Set for all 3. Value is a single plot. Going .Set 3 different times is just going to overwrite prior .Set calls.
      Changed to Upper.set and Lower.set ,but didn't make any difference . With
      my limited knowledge , all I can do is try to edit existing indicators ,if it
      doesn't work .... I don't see any real complete tutorials how to do this on your
      own .

      Comment


        #4
        T2020,

        You can't just change the names to different plots. You actually have to have a plot named those names. Please ensure in the Properties region there actually are plots with those names.
        Josh P.NinjaTrader Customer Service

        Comment


          #5
          You mean some thing like this ?

          #region Properties
          /// <summary>
          /// Gets the lower value.
          /// </summary>
          [Browsable(false)]
          [XmlIgnore()]
          public DataSeries Lower
          {
          get { return Values[2]; }

          I'm just trying to modify the standard " Bollinger " indicator . Your right I get
          something to plot in a lower pane , but it's a long way away from OBV .

          Comment


            #6
            You will need to debug your values. Whatever value you set is the value that will be plotted. If those values just don't make sense in relation to OBV then you will have to adjust the logic you are using to generate those values.
            Josh P.NinjaTrader Customer Service

            Comment


              #7
              Originally posted by NinjaTrader_Josh View Post
              You will need to debug your values. Whatever value you set is the value that will be plotted. If those values just don't make sense in relation to OBV then you will have to adjust the logic you are using to generate those values.
              I think your trying to help and I am trying to learn more , but I have no clue
              what that means . Yes there's obviously some logic off some where . The
              snap shot looks like it should work to me . ???
              Attached Files

              Comment


                #8
                Take those lines and do a Print of the value.

                Print(OBV(SMA)Period .....);
                Print(..whatever value you need printed..);

                Then you will be able to understand why your indicator plots where it does.
                Josh P.NinjaTrader Customer Service

                Comment


                  #9
                  Originally posted by NinjaTrader_Josh View Post
                  Take those lines and do a Print of the value.

                  Print(OBV(SMA)Period .....);
                  Print(..whatever value you need printed..);

                  Then you will be able to understand why your indicator plots where it does.
                  Well , looked all over Ninja and help files trying figure out what that was ?

                  Comment


                    #10
                    Not following you. Just use the Print() method to print whatever you want printed. Print the values so you can see what the values are and evaluate it by hand. Prints go to the Output Window.
                    Josh P.NinjaTrader Customer Service

                    Comment


                      #11
                      Originally posted by NinjaTrader_Josh View Post
                      Not following you. Just use the Print() method to print whatever you want printed. Print the values so you can see what the values are and evaluate it by hand. Prints go to the Output Window.
                      OK , I thought maybe you were talking about some special analysis app in
                      Ninja ...... . Still , forgive my ignorance but "Print() method" ? Not seeing
                      anyway to get something to the output window . And where
                      are these values suppose to come from ? I feel like I'm being sent on a wild
                      goose chase .

                      Comment


                        #12
                        T2020,

                        Just place these lines above your .Set lines. Then run your indicator with the Output Window open and you will get the print out of the values as your indicator processes them.

                        Josh P.NinjaTrader Customer Service

                        Comment


                          #13
                          OK , now this is starting to make some sense . The Output values are way
                          off . The Orange line ...should mimic ... the Blue line below . So , whats next ?
                          Not sure how this tells me what correction I should make . How the Code should be changed ?
                          Attached Files

                          Comment


                            #14
                            T2020, make sure you're printing out exactly what you want to. Here you can see exactly how the values are being set:
                            Code:
                            protected override void OnBarUpdate()
                                    {
                                        Print("");
                                        Print("Bar:\t" + CurrentBar);
                                         
                                        Print("OBV(SMA(Period))[0]=\t\t" + OBV(SMA(Period))[0]);
                                        Print("NumStdDev * StdDev(Period)[0]=\t" + NumStdDev * StdDev(Period)[0]);
                            
                                        Upper.Set(OBV(SMA(Period))[0] + NumStdDev * StdDev(Period)[0]);
                                        Print("Upper set at:\t" + Upper[0]);
                                        
                                        Middle.Set(OBV(SMA(Period))[0]);
                                        Print("Middle set at:\t" + Middle[0]);
                                        
                                        Lower.Set(OBV(SMA(Period))[0] - NumStdDev * StdDev(Period)[0]);
                                        Print("Lower set at:\t" + Lower[0]);
                                    }
                            AustinNinjaTrader Customer Service

                            Comment


                              #15
                              That is more detailed . All the numbers are positive on the output window and
                              OBV itself is a very negative number on this chart . Seems to me that :

                              Middle.Set(OBV(SMA(Period))[0]);
                              Should be :
                              Middle.Set(SMA(OBV(Period))[0]);

                              But that won't compile . So , ???

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by magnatauren, 08-15-2020, 02:12 PM
                              5 responses
                              206 views
                              0 likes
                              Last Post RaddiFX
                              by RaddiFX
                               
                              Started by rene69851, 05-02-2024, 03:25 PM
                              1 response
                              21 views
                              0 likes
                              Last Post rene69851  
                              Started by ETFVoyageur, Yesterday, 07:05 PM
                              5 responses
                              45 views
                              0 likes
                              Last Post ETFVoyageur  
                              Started by jpeep, 08-16-2020, 08:31 AM
                              13 responses
                              487 views
                              0 likes
                              Last Post notenufftime  
                              Started by realblubb, 04-28-2024, 09:28 AM
                              2 responses
                              32 views
                              0 likes
                              Last Post realblubb  
                              Working...
                              X