Algorithmic Trading with NinjaTrader
Going through our code step by step I'm still not sure about OnStateChange() part, what it actually is needed for:
protected override void OnStateChange()
{
if (State == State.SetDefaults) // ? what does it do ?
{
SetDefaults();
SetParameters();
}
else if (State == State.Configure) // ? If user presses OK button of strategy property window ?
{
_diPlus = DiPlus(DiPeriod);
_diMinus = DiMinus(DiPeriod);
AddChartIndicator(_diPlus);
AddChartIndicator(_diMinus);
AddLevels();
}
else if (State == State.Terminated) // what does it do ?
{
}
}
Going through our code step by step I'm still not sure about OnStateChange() part, what it actually is needed for:
protected override void OnStateChange()
{
if (State == State.SetDefaults) // ? what does it do ?
{
SetDefaults();
SetParameters();
}
else if (State == State.Configure) // ? If user presses OK button of strategy property window ?
{
_diPlus = DiPlus(DiPeriod);
_diMinus = DiMinus(DiPeriod);
AddChartIndicator(_diPlus);
AddChartIndicator(_diMinus);
AddLevels();
}
else if (State == State.Terminated) // what does it do ?
{
}
}