Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Bollinger Band Squeeze Indicator (BBS)

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

    Bollinger Band Squeeze Indicator (BBS)

    I am looking for the Bollinger Band Squeeze Indicator for NT 7...
    (BBS)

    Anyone who could point me in the right direction??

    thanks

    #2
    Hello jharonis,

    Thanks for the post and welcome to the NinjaTrader forums. If you dont find what you're looking for in the file sharing section, consider a NinjaScript consultant who can be hired to write indicator scripts for you.
    Ryan M.NinjaTrader Customer Service

    Comment


      #3
      Hi,
      I am trying to create a costum indicator which will calculate the spread between of the Upper to Lower Bolinger Band. I have compiled the code and it is fine, however it doesnt show the indicator on a chart. Do you have any ideas about this issue? Please have a look at the code below

      protected override void Initialize()
      {
      Add(new Plot(Color.FromKnownColor(KnownColor.Red), PlotStyle.Line, "BBSpread"));
      BBSpread_chg = new DataSeries(this);
      BBUpper_chg = new DataSeries(this);
      BBLower_chg = new DataSeries(this);
      CalculateOnBarClose = true;
      Overlay = false;
      }
      if (CurrentBar < Period)
      return;

      BBLower_chg.Set(Bollinger(Close,2,14).Lower[0]);
      BBUpper_chg.Set(Bollinger(Close,2,14).Upper[0]);
      BBSpread_chg.Set(BBUpper_chg[0]-BBLower_chg[0]);

      Comment


        #4
        Loukas, I only see you defining a BBSpread Plot, but never filling it with any values, the other data series are just series and not plots that would be visualized.
        BertrandNinjaTrader Customer Service

        Comment


          #5
          I am still working on how to present the indicator
          BBSpread=BBSpread_chg

          Add(new Plot(Color.FromKnownColor(KnownColor.Red), PlotStyle.Line, "BBSpread_chg"));

          Comment


            #6
            Loukas,

            That is not enough code to create a plot. To create a plot requires multiple components. It may be easiest to see how these components are made by looking at a preexisting indicator. Please open up the MACD indicator and take a look at how there are multiple plots created in the Initialize() section. Then expand the Properties region of the code and take a look at the required components in there too. There is one for each plot. You will need to do similar in your own code.
            Josh P.NinjaTrader Customer Service

            Comment


              #7
              Thanks, I have done the Spread and now I stuck with the EMA of Spread.
              Add(new Plot(Color.FromKnownColor(KnownColor.Orange), PlotStyle.Line, "Plot2"));

              double emaBSpread = EMA((Bollinger(2,14).Upper[0]-Bollinger(2,14).Lower[0]),23);
              Plot2.Set(emaBSpread);

              At Properties I have the Plot2 as a dataseries

              Comment


                #8
                That would not compile Loukas, please create a series holding the difference between the upper and lower values and then feed this series in your EMA.
                BertrandNinjaTrader Customer Service

                Comment


                  #9
                  Thanks Bertrand,

                  Which is the way to create a new indicator by combining two existing indicators ?

                  eg ROCema.Set(ROC(EMA(14)[0])) ;

                  Comment


                    #10
                    You're missing the ROC period here, for example the snippet below should compile well :

                    Value.Set(ROC(EMA(14), 14)[0]);

                    In general please work with Intellisense to guide you through the overloads available :

                    BertrandNinjaTrader Customer Service

                    Comment


                      #11
                      I would like also to find the lowest value of EMA for the last 252 days.

                      double MEMA=(Math.Min(EMA,252)) ;

                      Is this correct or it finds the lowest value at that day?

                      Comment


                        #12
                        Sorry, my reply needs changing here, I missed the Math.Min in your code snippet:

                        For the mininum value of a series (your EMA here) please use the MIN() method instead.
                        Last edited by NinjaTrader_Bertrand; 07-01-2011, 07:59 AM.
                        BertrandNinjaTrader Customer Service

                        Comment


                          #13
                          Yes I applied it on daily Chart but I wondering if it takes the lowest value on the 252 day or it finds the lowest value from all these days

                          Comment


                            #14
                            It gives you the minimum value of the series over the full lookback, so the last 252 bars here.
                            BertrandNinjaTrader Customer Service

                            Comment


                              #15
                              Loukas,

                              You can also check out bigmiketrading. I saw a few BB Squeeze indicators there. You might find just what you need or maybe can get additional help.

                              Reviews, Strategies, Indicators & more | NexusFi community forum

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by quantismo, 04-17-2024, 05:13 PM
                              5 responses
                              32 views
                              0 likes
                              Last Post NinjaTrader_Gaby  
                              Started by proptrade13, Today, 11:06 AM
                              1 response
                              5 views
                              0 likes
                              Last Post NinjaTrader_Clayton  
                              Started by love2code2trade, 04-17-2024, 01:45 PM
                              4 responses
                              34 views
                              0 likes
                              Last Post love2code2trade  
                              Started by cls71, Today, 04:45 AM
                              2 responses
                              10 views
                              0 likes
                              Last Post eDanny
                              by eDanny
                               
                              Started by kulwinder73, Today, 10:31 AM
                              1 response
                              10 views
                              0 likes
                              Last Post NinjaTrader_Erick  
                              Working...
                              X