"Draw.Line (this, @" Sup ", true, BarrAtras, Superior, BarrDel, Superior, Brushes.Red, DashStyleHelper.Dash, 2);" no problem but if I put the conditioner then it does nothing and throws me the error. I am sure it is something simple but due to my lack of programming knowledge I cannot make the indicator work correctly.
Please if you can help me, thank you very much in advance.
public class LinesMines : Indicator
{
private double Inferior;
private double Superior;
private double Cierre;
protected override void OnStateChange()
{
if (State == State.SetDefaults)
{
Description = @"Enter the description for your new custom Indicator here.";
Name = "LinesMines";
Calculate = Calculate.OnEachTick;
IsOverlay = true;
DisplayInDataBox = true;
DrawOnPricePanel = true;
DrawHorizontalGridLines = true;
DrawVerticalGridLines = true;
PaintPriceMarkers = true;
ScaleJustification = NinjaTrader.Gui.Chart.ScaleJustification.Right;
//Disable this property if your indicator requires custom values that cumulate with each new market data event.
//See Help Guide for additional information.
IsSuspendedWhileInactive = true;
DisTick_A = 5;
DisTick_B = 10;
BarrAtras = -5;
BarrDel = -30;
Inferior = 1;
Superior = 1;
Cierre = 1;
Compra = true;
}
else if (State == State.Configure)
{
}
}
protected override void OnBarUpdate()
{
if (Compra)
{
RemoveDrawObjects();
Superior = Close[0] + DisTick_A*TickSize;
Inferior = Close[0] - DisTick_B*TickSize;
Cierre = Close[0];
Compra = true;
Draw.Line(this, @"Inf", true, BarrAtras, Inferior, BarrDel, Inferior, Brushes.Red, DashStyleHelper.Dash, 2);
else
{
RemoveDrawObjects();
Superior = Close[0] + DisTick_B*TickSize;
Inferior = Close[0] - DisTick_A*TickSize;
Cierre = Close[0];
Compra = false;
Draw.Line(this, @"Sup", true, BarrAtras, Superior, BarrDel, Superior, Brushes.Red, DashStyleHelper.Dash, 2);
}
}
#region Properties
[NinjaScriptProperty]
[Range(1, double.MaxValue)]
[Display(Name="Compra", Description="Compra o Venta", Order=1, GroupName="Parameters")]
public bool Compra
{ get; set; }

Comment