Multiple Output Plots
Using the Plot function it is possible to have one script formula with multiple individual results, with different plot styles, lines, or colours for each.
As an example, the Price Percentage Oscillator (PPO) is a custom tool that has 3 separate outputs: one to plot the percentage difference between two exponential moving averages, a second for an exponential moving average of that difference, and the last to create a histogram of the difference between the first two calculations.
Here's the formula to calculate the PPO in a Show View tool:
MA1 = MA(BARS=12, STYLE=Exponential, CALC=Close); MA2 = MA(BARS=26, STYLE=Exponential, CALC=Close); Plot1 = ((MA1 - MA2) / MA2)*100; Plot2 = MA(Plot1, BARS=9, STYLE=Exponential); Plot3 = Plot1 - Plot2; Plot1.Linestyle = Solid; Plot1.Color = Green; Plot2.Linestyle = Solid; Plot2.Color = Red; Plot3.Plotstyle = Histogram; Plot3.Color = Blue;
As you type Plot1. in the Script Editor, the following window will pop up allowing you to select the appropriate property, such as Line Style, Color, or Transparency:
Click on the property required, and next option will appear. For example, Linestyle will allow you to choose the following:
From there you can type Plot1. again on the next line and select Colour:
In this example, Plot1 was a green solid line, Plot2 was red, and finally Plot3, a blue histogram.
Once the complete formula has been saved as an indicator to be applied to a New View, it can then be selected from the right-click menu and applied like any other tool:
Available in Optuma 2.0 and later, multi plot scripts now support the Barrier colour scheme. For example:
O1 = OSC();
Plot1 = O1;
Plot1.Plotstyle = Histogram;
plot1.HistColScheme = Positive/Negative;
plot1.UpColour = Blue;
plot1.DownColour = Red;
plot1.Barrier = 0;
plot1.LineWidth = 2;
Using the above example any value lower than the set barrier (zero) shows as red and any above show as blue.