Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Adding Bollinger Bands to a custom indicator

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

    Adding Bollinger Bands to a custom indicator

    Hello,
    Happy New Year!
    I am working on trying to get Bollinger bands (Upper and Lower) to plot inside a custom indicator.

    I created the AddPlot
    AddPlot(Brushes.Transparent, "Upper VB");
    AddPlot(Brushes.Transparent, "Lower VB");

    and then I am trying to call on the Bollinger indicator in the OnBarUpdate

    protected override void OnBarUpdate()
    {

    if (ShowVB == true)
    {

    Values[1][0] = Bollinger(NumStdDev,HiWay).Upper[0];
    Plots[0].Brush = (UpperColor);
    Values[2][0] = Bollinger(NumStdDev,HiWay).Lower[0];
    Plots[0].Brush = (LowerColor);
    }
    }

    The Bands plot but are way off the top and bottom of the chart.
    Is there something I'm missing here? I was thinking it would be pretty simple to add.

    Thank you for any help with this.
    Regards,
    James​

    #2
    Good Morning,
    I finally got the Bollinger bands to plot but on the last bar of the RTH session they shoot up/down off the chart. I can't figure out why they would do this. If anyone has some input about this behavior it would be greatly appreciated.
    Thank you very much for your time.
    Regards,
    James
    Attached Files

    Comment


      #3
      Hello again,
      I figured out the issue. Thank you for any time spent.
      Regards,
      James​

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Geovanny Suaza, 02-11-2026, 06:32 PM
      0 responses
      557 views
      0 likes
      Last Post Geovanny Suaza  
      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
      0 responses
      324 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
      545 views
      1 like
      Last Post Geovanny Suaza  
      Started by RFrosty, 01-28-2026, 06:49 PM
      0 responses
      547 views
      1 like
      Last Post RFrosty
      by RFrosty
       
      Working...
      X