I am pring indicatior values as below and it is printing as expected :
double lstop = Instrument.MasterInstrument.RoundToTickSize(this.L ong_Stop[0]);
double sstop = Instrument.MasterInstrument.RoundToTickSize(this.S hort_Stop[0]);
// Print(string.Format("{0};{1};{2};{3}{4};", "STVV1NEWIND=>"+Time[0],lstop,sstop));
Print(string.Format("{0};{1};{2};{3}", Time[0],lstop,sstop,"STVV1NEWIND11"));
But if i read the same values in strategy via below code it prints very diferent values ? How can access actual values of indicator in strategy:
if(ChartControl != null)
{
foreach (NinjaTrader.Gui.NinjaScript.IndicatorRenderBase indicator in ChartControl.Indicators)
{
if(indicator.GetType() == typeof(STV1NEWIND11))
{
STV1NEWIND11 stv1 = indicator as STV1NEWIND11;
if(stv1 != null)
{
Print("STV1Strategy=Time[0]: " + Time[0]+"Lstop=="+stv1.Long_Stop[0]+"Sstop="+stv1.Short_Stop[0]);
}
}
}
}
it allways prints same number indicator Can u please help me read right values?
STV1Strategy=Time[0]: 02/03/2021 17:39:00Lstop==3872.875Sstop=0
02/03/2021 17:40:00;3891;0;STVV1NEWIND11
STV1Strategy=Time[0]: 02/03/2021 17:40:00Lstop==3872.875Sstop=0
02/03/2021 17:41:00;3891;0;STVV1NEWIND11
STV1Strategy=Time[0]: 02/03/2021 17:41:00Lstop==3872.875Sstop=0
02/03/2021 17:42:00;3891;0;STVV1NEWIND11
STV1Strategy=Time[0]: 02/03/2021 17:42:00Lstop==3872.875Sstop=0
02/03/2021 17:43:00;3891;0;STVV1NEWIND11
STV1Strategy=Time[0]: 02/03/2021 17:43:00Lstop==3872.875Sstop=0
02/03/2021 17:44:00;3891;0;STVV1NEWIND11
STV1Strategy=Time[0]: 02/03/2021 17:44:00Lstop==3872.875Sstop=0
Comment