[B][SIZE=5][COLOR=Blue]Plots[/COLOR][/SIZE][/B]
[B][SIZE=3][COLOR=Sienna]Definition[/COLOR][/SIZE][/B]
A collection holding all of the Plot objects that define the visualization characteristics of the indicator.
[B][COLOR=Sienna]Property Value[/COLOR][/B]
A collection of [COLOR=Blue]Plot [/COLOR]objects.
[B][COLOR=Sienna]Syntax[/COLOR][/B]
Plots[[COLOR=Blue]int [/COLOR]index]
[B][COLOR=Sienna]Examples[/COLOR][/B]
[COLOR=SeaGreen]// Initialize method of a custom indicator[/COLOR]
[COLOR=Blue]protected override void[/COLOR] Initialize()
{
[COLOR=SeaGreen] // Plots are added to the Plots collection in order[/COLOR]
Add([COLOR=Blue]new[/COLOR] Plot(Color.Orange, "Plot1")); // Stored in Plots[0]
Add([COLOR=Blue]new [/COLOR]Plot(Color.Blue, "Plot2")); // Stored in Plots[1]
}
[COLOR=SeaGreen]// Dynamically change the primary plot's color based on the indicator value[/COLOR]
[COLOR=Blue]protected override void[/COLOR] OnBarUpdate()
{
[COLOR=Blue]if [/COLOR](Values[0] > 100)
Plots[0].Pen = [COLOR=Blue]new [/COLOR]Pen(Color.Blue);
[COLOR=Blue]else[/COLOR]
Plots[0].Pen = [COLOR=Blue]new [/COLOR]Pen(Color.Red);
}
Similar errors occur in the help guide example for "Value"...
[SIZE=5][B][COLOR=Blue]Value[/COLOR][/B][/SIZE]
[B][COLOR=Sienna]Definition[/COLOR][/B]
Value references the 1st DataSeries object Values[0] in the indicator. This is the primary indicator value.
[B][COLOR=Sienna]
Property Value[/COLOR][/B]
A DataSeries object.
[B][COLOR=Sienna]Syntax[/COLOR][/B]
Value
[B][COLOR=Sienna]Examples[/COLOR][/B]
// OnBarUpdate method of a custom indicator
protected override void OnBarUpdate()
{
[COLOR=SeaGreen] // Checks the indicator primary value 1 bar aga and sets the value of the indicator
// for the current bar being evaluated[/COLOR]
[COLOR=Blue]if [/COLOR](Values[1] < High - Low)
Value.Set(High - Low);
[COLOR=Blue]else[/COLOR]
Value.Set(High - Close);
}

Comment