|
GTrade.Init()
This function is used to prepare the data of GTrade.
The call must take place before the first call of a data-reading function.
void GTrade.Init( |
Parameter
symbol
[in] The symbol whose data the class should process.
RiskMode
[in] The desired risk mode. RISK_PERCENT indicates that the risk should be calculated in percent of the current account size. RISK_FIXED sets the risk to a value in money.
RiskPercent
[in] The desired risk in percent of the current account size.
RiskFixed
[in] The desired value in percent if the RiskMode is set to RISK_PERCENT.
RoundOutOfRange
[in] If the calculated order volume is greater or smaller than the broker's specification, this function rounds to the minimum or maximum values.
ForceOpen
[in] If the margin for the calculated order volume is not sufficient, this function can execute a position with the maximum possible order volume. However, Leverage (the leverage) must be set to the correct value.
Leverage
[in] The leverage of the broker. If -1, then the standard leverage transmitted by the broker is automatically determined. Attention: the leverage transmitted by the broker is often not maintained correctly or differs in different trading instruments. Please check the leverage values on the website of your broker and enter them manually here if necessary. E.g.: 500 for a leverage of 1:500.
Note
The .Init() function call can be made at any point in the code. It can also be used several times to change data during runtime. However, it is recommended to call it at least once in the OnInit().
Example:
//--- Include the Glib classes |
See also