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 Mindset, 04-21-2026, 06:46 AM
      0 responses
      52 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by M4ndoo, 04-20-2026, 05:21 PM
      0 responses
      71 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Started by M4ndoo, 04-19-2026, 05:54 PM
      0 responses
      38 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Started by cmoran13, 04-16-2026, 01:02 PM
      0 responses
      99 views
      0 likes
      Last Post cmoran13  
      Started by PaulMohn, 04-10-2026, 11:11 AM
      0 responses
      60 views
      0 likes
      Last Post PaulMohn  
      Working...
      X