I created a simple indicator it is a simple line that starts 10 bars ago and is at the height of this one
but I would like to use plot to create this indicator
1. Is there a way to stretch the line to the future without using time?
in this example
2. how to draw this line with plot?
3. what is the value of this plot because i want to use it in the strategies builder?
Many thanks.
if (State == State.SetDefaults)
{
Description = @"Enter the description for your new custom Indicator here.";
Name = "MyCustomIndicator";
BarsAgo = 10;
AddPlot(new Stroke(Brushes.Orange, 2), PlotStyle.Dot, "MyLine");
}
else if (State == State.Configure)
{
}
}
protected override void OnBarUpdate()
{
if (CurrentBar < 60)
return;
Draw.Line(this, "MyLine" , true, BarsAgo, High[BarsAgo] , 0, High[BarsAgo] , Brushes.Red, DashStyleHelper.Dot, 4);
}
#region Properties
[NinjaScriptProperty]
[Display(Name="BarsAgo", Order=1, GroupName="Parameters")]
public int BarsAgo
{ get; set; }
[Browsable(false)]
[XmlIgnore]
public Series<double> MyLine
{
get { return Values[0]; }
}
#endregion

Comment