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

bands beyond bollinger bands

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

    bands beyond bollinger bands

    hi,
    i am interested in creating a band above & one below the bollinger bands, based on the difference between the bollinger bands at any moment, where this difference is added to the upper band, & subtracted from the lower band.
    i've had no luck finding something similar in the posted indicators, & any help would be appreciated. thanks.

    #2
    Hello upsndowns,

    Below are two data series that will do this. You can create these as data series according to the principles in the document below:


    Code:
     
    myDataSeries.Set(Bollinger(2,14).Upper[0] - Bollinger(2,14).Lower[0] + Bollinger(2,14).Upper[0]);
     
     
    myDataSeries2.Set(Bollinger(2,14).Upper[0] - Bollinger(2,14).Lower[0] - Bollinger(2,14).Lower[0]);
    Ryan M.NinjaTrader Customer Service

    Comment


      #3
      thanks ryanm
      i created a new indicator that would just plot this upper & lower band only. it "compiled" ok, but when placing it on my chart, everything in the price panel 1 "scrunched up" to the top edge ?? here's my progress...


      protectedoverridevoid Initialize()
      {
      Add(
      new Plot(Color.Orange, PlotStyle.Line, "Above band"));
      Add(
      new Plot(Color.Orange, PlotStyle.Line, "Below band"));
      CalculateOnBarClose =
      true;
      Overlay =
      true;
      PriceTypeSupported =
      true;


      protectedoverridevoid OnBarUpdate()
      {
      Above.Set(Bollinger(
      2,14).Upper[0] - Bollinger(2,14).Lower[0] + Bollinger(2,14).Upper[0]);
      Below.Set(Bollinger(
      2,14).Upper[0] - Bollinger(2,14).Lower[0] - Bollinger(2,14).Lower[0]);
      }

      Comment


        #4
        Originally posted by upsndowns View Post
        hi,
        i am interested in creating a band above & one below the bollinger bands, based on the difference between the bollinger bands at any moment, where this difference is added to the upper band, & subtracted from the lower band.
        I dont think you need a new indicator. All you need to do is add another instance of the existing Bollinger indicator to your chart, keep the same Period, but set the "# of std. dev." to three times whatever you have used for the first instance.

        Comment


          #5
          hi davee, the result i am after is not the same as simply "upping" the standard deviation number.
          i also attempted to create it as a new indicator as i did not want to play with the existing BB indicator & stuff it up (very likely!!), as i have it looking just how i want on the chart with color fill, etc.

          Comment


            #6
            That should do it for you, if I understand what you want: (this is untested)

            Above.Set(Bollinger(2,14).Upper[0] + (Bollinger(2,14).Upper[0] - Bollinger(2,14).Lower[0]));
            Below.Set(Bollinger(
            2,14).Lower[0] - (Bollinger(2,14).Upper[0] - Bollinger(2,14).Lower[0]));

            You may the bollinger triplestat v4 useful:
            http://www.ninjatrader-support2.com/...catid=1&sort=d


            ...I wrote it.

            Last edited by mountainclimber; 05-07-2010, 10:40 AM.

            Comment


              #7
              Hello UpsnDowns,

              This might work better for you, with parentheses in the right places.

              Above.Set(Bollinger(2,14).Upper[0] + (Bollinger(2,14).Upper[0] - Bollinger(2,14).Lower[0]));
              Below.Set(Bollinger(
              2,14).Lower[0] - (Bollinger(2,14).Upper[0] - Bollinger(2,14).Lower[0]));


              Edit: Great, Thanks for sharing mountainclimber!
              Last edited by NinjaTrader_RyanM1; 04-30-2010, 09:20 AM. Reason: Replies crossed
              Ryan M.NinjaTrader Customer Service

              Comment


                #8
                You will find that
                Bollinger(2,14).Upper[0] + (Bollinger(2,14).Upper[0] - Bollinger(2,14).Lower[0])

                is a longer way of saying

                Bollinger(6,14).Upper[0]

                and
                Bollinger(2,14).Lower[0] - (Bollinger(2,14).Upper[0] - Bollinger(2,14).Lower[0])

                is a longer way of saying

                Bollinger(6,14).Lower[0]


                That is simply multiply the Std Dev parameter by 3.

                The reason is simple: Whatever value you specify for "# of Std Dev" parameter the "difference" between Upper and Lower bands will be 2 times the Standard Deviation times your parameter value.
                A band whose upper is the same distance above the original upper as the original's "difference", and whose lower is the same distance below the lower as the original's "difference", must be three times as deep as the original band.

                Comment


                  #9
                  thanks everyone for your help...i've sorted it out & learn't some more!
                  mountainclimber...thanks again. you helped me with the "macd avgupdwn" indicator, & your top of the list when i need someones help devising my super indicator.

                  Comment


                    #10
                    Glad to help and thanks for the props!

                    Last edited by mountainclimber; 05-07-2010, 10:40 AM.

                    Comment

                    Latest Posts

                    Collapse

                    Topics Statistics Last Post
                    Started by swestendorf, Today, 11:14 AM
                    1 response
                    1 view
                    0 likes
                    Last Post swestendorf  
                    Started by Sparkyboy, Today, 10:57 AM
                    0 responses
                    4 views
                    0 likes
                    Last Post Sparkyboy  
                    Started by TheMarlin801, 10-13-2020, 01:40 AM
                    21 responses
                    3,917 views
                    0 likes
                    Last Post Bidder
                    by Bidder
                     
                    Started by timmbbo, 07-05-2023, 10:21 PM
                    3 responses
                    155 views
                    0 likes
                    Last Post grayfrog  
                    Started by Lumbeezl, 01-11-2022, 06:50 PM
                    30 responses
                    812 views
                    1 like
                    Last Post grayfrog  
                    Working...
                    X