Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

bollinger percent up/down arrow plotting

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

    bollinger percent up/down arrow plotting

    Is there someone here that could program this indicator to plot a arrow on the chart when bollingerpercet histogram passes 20% & down arrow when falls below 80%(or even bar changes color when these conditions meet). I have looked all over to code but can't seem to figure this out.I know alot of traders are here to help & I would really appreciate any sort of help, or even how i could do it myself. I have zero programing experience, but i can follow instructions if i had to do it myself.

    Thanks in advance
    Acura
    Attached Files

    #2
    acura,

    The methods you are looking for are below.





    You can simply use if( ) statements to test when a condition is true then use the aforementioned methods.

    Here is a link to our help guide educational resources :



    You can also contact a NinjaScript consultant and see if they can help you.

    Adam P.NinjaTrader Customer Service

    Comment


      #3
      Ninja Crashes after this code. I know im wrong but dunno where?


      /// <summary>
      /// Called on each bar update event (incoming tick)
      /// </summary>
      protected override void OnBarUpdate()
      {
      PctB.Set(((Input[0] - Bollinger(StandardDev, Period).Lower[0]) / (Bollinger(StandardDev, Period).Upper[0] - Bollinger(StandardDev, Period).Lower[0])) * 100);

      if (CrossAbove(BollingerPercentB(20, 2).PctB, BollingerPercentB(20, 2).PctB, 1))
      {
      DrawArrowUp("UpArrow" + CurrentBar, false, 0, 0, Color.Blue);
      }

      Comment


        #4
        Hello,

        You do not want to have an indicator call itself to rerun itself and put itself into and endless loop.


        You would want to access the local variable since the indicator is already running.

        if (CrossAbove(BollingerPercentB(20, 2).PctB, BollingerPercentB(20, 2).PctB, 1))

        Change to

        if (CrossAbove(PctB[0], PctB[0], 1))
        BrettNinjaTrader Product Management

        Comment


          #5
          this is the error msg i get when i try to compile
          Attached Files

          Comment


            #6
            Hello,

            Can you attach the full .cs file on here so I can take a quick look at it. I dont see anything off hand but I suspect PctB and how it is declared earlier in the code.

            -Brett
            BrettNinjaTrader Product Management

            Comment


              #7
              Thanks Brett

              Ive attached the .cs file.
              Attached Files

              Comment


                #8
                Hello,

                Thanks for that.

                The reason why it is doing this is the first data series is the same for the secondand series and I guess it checks for this. It needed another data series for the second one.

                What two values are you trying to have cross over. Right now your code is trying to check againt PctB and PctB which will never occur because they both have the same values and as such you have the compile error.

                -Brett
                BrettNinjaTrader Product Management

                Comment


                  #9
                  to plot a arrow on the chart when bollingerpercet histogram passes 20 & down arrow when falls below 80(or even bar changes color when these conditions meet).


                  Thanks

                  Acura

                  Comment


                    #10
                    In this case

                    if (CrossAbove(20, PctB[0], 1))

                    Will do the trick for the 20 cross, do the same for the 80 cross if statement.

                    -Brett
                    BrettNinjaTrader Product Management

                    Comment


                      #11
                      I really dumb when it comes to all this, I appreciate all your time & effort with this.

                      Thanks

                      Acura
                      Attached Files

                      Comment


                        #12
                        Hello,

                        I did mine with SMA() in my test and did not notice apologize about that.

                        When I used yours I then needed to use it as such:

                        if (CrossAbove(20, PctB, 1))

                        Let me know if I can be of further assistance.
                        BrettNinjaTrader Product Management

                        Comment


                          #13
                          Brett im sorry i keep bugging you with this.
                          ive attached a chart with manually drawn arrows on the chart. This is the way I would like the Bollinger to plot arrows on the Chart.

                          thanks

                          Acura
                          Attached Files

                          Comment


                            #14
                            Hello,

                            You would change your draw arrow line to the following:

                            DrawArrowUp("UpArrow" + CurrentBar, false, 0, Low[0], Color.Blue);

                            Then you will want to add a second indicator to your chart and set it to Panel 0 the primary bars panel and then set the plots colors to be transparent so that it does not plot anything and only draws the arrows in the primary series.


                            -Brett
                            BrettNinjaTrader Product Management

                            Comment


                              #15
                              Make sure the plot panel is same as input series and the scale justification is set to right.

                              -Brett
                              BrettNinjaTrader Product Management

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                              0 responses
                              576 views
                              0 likes
                              Last Post Geovanny Suaza  
                              Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                              0 responses
                              334 views
                              1 like
                              Last Post Geovanny Suaza  
                              Started by Mindset, 02-09-2026, 11:44 AM
                              0 responses
                              101 views
                              0 likes
                              Last Post Mindset
                              by Mindset
                               
                              Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                              0 responses
                              553 views
                              1 like
                              Last Post Geovanny Suaza  
                              Started by RFrosty, 01-28-2026, 06:49 PM
                              0 responses
                              551 views
                              1 like
                              Last Post RFrosty
                              by RFrosty
                               
                              Working...
                              X