Hello, how are you, I need to place the Main Dataseries in OnRender, I need to place it in OnEachTick and it enters me only in Range 30. Can you help me.
Example.
namespace NinjaTrader.NinjaScript.Indicators
{
public class Range30 : Indicator
{
protected override void OnStateChange()
{
if (State == State.SetDefaults)
{
Description = @"Disp";
Name = "testOnrender";
Calculate = Calculate.OnEachTick;
IsOverlay = true;
}
else if (State == State.Configure)
{
setChartProperties = true;
AddDataSeries(Data.BarsPeriodType.Range, 30);
}
}
protected override void OnBarUpdate()
{
}
protected override void OnRender(ChartControl chartControl, ChartScale chartScale)
{
if (BarsInProgress == 0) // Principal
{
Print("Processing BIP 1 for bar "+CurrentBars[0] + " OnRender.");
}
if (BarsInProgress == 1) // Just enter here!!!!
{
Print("Processing Secondary Range for bar "+CurrentBars[1] + " OnRender.");
}
// here Here in OnRender only enter the Secondary Dataseries not the Main,
//I need to place in OnEachTick
}
}
Thanks.
Comment