The strategy initialization


The function is called every time when the user applies the strategy. At this moment, a copy of the strategy code is created. This copy is called strategy instance. At one moment, there can be as many strategy instances as many times the strategy is applied.

In this function you must:

When the function is being executed, there is a global variable called instance. You must use this to access to the instrument and parameters data.

Parameter nameOnly indicates whether this function was called just for creating instance's name.


strategy instance is always created in a new context. The Init() function is not called for an instance, so there is no way to pass data from the Init() function to the Prepare() function.