Custom indicators access
Instantiate a custom indicator with input parameters.
General
public class CustomIndicator : Indicator
{
[InputParameter("Level", 10, 0.1, 9999, 0.1, 1)]
public double LevelValue = 10;
[InputParameter("Slow period", 20, 1, 9999, 1, 0)]
public int SlowPeriod = 30;
[InputParameter("Price type", variants: new object[]
{
"Close", PriceType.Close,
"Open", PriceType.Open,
"High", PriceType.High,
"Low", PriceType.Low,
})]
public PriceType PriceType = PriceType.Close;
[InputParameter("Period")]
public Period Period = Period.MIN1;
//
// Parameterless constructor
//
public CustomIndicator()
{
this.Name = "Custom indicator";
this.AddLineSeries("Line", Color.DodgerBlue, 2, LineStyle.Solid);
this.SeparateWindow = true;
}
protected override void OnUpdate(UpdateArgs args)
{
// something usefull
}
}Use class constructor (Beginner)
Use indicator settings collection (Advance)
Last updated