Skip to content

Multi-Plot Shading

By Optuma Team · Updated 2020-04-03

It is possible to add a shaded zone between two plot lines using the Shade() function.

The supported properties for this function are:

  • Down Colour: Set the colour of the shaded zone when Plot 1 is lower than Plot 2.
  • Up Colour: Set the colour of the shaded zone when Plot 1 is higher than Plot 2.
  • Offset: Move the shaded zone forward or backwards (measured in bars).
  • Transparency: Allows you to adjust the Transparency of the shaded zone.
Plot1 = MA(BARS=25, STYLE=Exponential, CALC=Close);
Plot2 = MA(BARS=100, STYLE=Exponential, CALC=Close);
Plot3 = Shade(Plot1, Plot2, DOWNCOLOUR=Red, UPCOLOUR=Green);

The above script can be used with a Show Plot indicator to produce the following result:

Choose which categories of cookies you allow. Strictly-necessary cookies are always on. You can change this any time via the "Cookie Settings" link in the footer.

  • Functional

    Remember preferences like dismissed banners and your dark-mode choice.

  • Analytics

    Help us understand how the site is used so we can improve it.

  • Marketing

    Measure our advertising and help us reach people who may be interested in Optuma.