State == State.SetDefaults, how does it process ?
08.06.2020 07.23

Algorithmic Trading with NinjaTrader

Frank


Question on my way to understand the code more in detail:

Line 232, State.SetDefaults, what is the process flow of it ?

? 1, what is State in State == State.SetDefaults) ?

** does it check if SetDefaults is executed already ?

** if yes, how does it indicate that ?

** if yes, does the program jump to SetDefaults and SetParameters, which is at another location in the script ? Or are SetDefault and SetParameters globally saved in memory and are accessed now ?


? 2, in line 234 SetDefault();

** does it mean it calls SetDefaults in line 295 ?


  • Yuri Zolotarev
    08.06.2020 10:12

    State value is passed to you by NinjaTrader API so anytime you can find out what state your strategy or indicator is in. So When you go like if( State == State.SetDefaults) you are essentially asking whether current State is State == SetDefaults.

    As for line 234 yes it is calling the method that is below in the script.