I've already read the guide regarding this two states, but I don't have it clear enough...
Lets suppose I want to add two EMA that will be used in my script in OnBarUpdate section, so I write the following code in State.DataLoaded. In that way, the script works as expected, but, is it also necessary or recommended to set them in State.Historical? Will it suppose any difference?
.......
else if (State == State.DataLoaded)
{
EMA1 = EMA(Close, 5);
EMA2 = EMA(Close, 10);
}
else if (State == State.Historical)
{
EMA1 = EMA(Close, 5);
EMA2 = EMA(Close, 10);
}
......
Thanks in advance for your support.

Comment