Prepare(nameOnly)
Brief
The strategy initialization
Details
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.
Important:
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.