|
GTrade
The class GTrade gives you the possibility to carry out the most common trading actions extremely easily.
Create and destroy the class
To create the class and destroy it when the program ends, there are 5 simple steps. You can see these steps in the example.
Example:
//--- Connect the Glib classes |
From this point on you can use the class functions.
Class Functions
Return value |
Function call |
Function |
void |
Initialization of the class default data. Set the preferences for the class to work with. |
|
int |
Opens a trade. Only a stoploss value is necessary. Other values are optional. |
|
int |
Closes all open positions on a symbol. |
|
int |
Closes all positions with a specific comment on a symbol. |
|
int |
Moves all StopLoss of the positions on a symbol. |
|
int |
Moves all StopLoss of the positions with a certain comment on a symbol. |
|
double |
Returns the stop loss of the last open and open position on a symbol. |
|
double |
Returns the stop loss of the last open and open position with a comment on a symbol. |
|
double |
Returns the current profit or loss of the last opened and open position on a symbol. |
|
double |
Returns the current profit or loss of the last opened and open position with annotation on a symbol. |
|
double |
Returns the opening price of the last opened and open position on a symbol. |
|
GDirections |
Returns the trade direction of the last opened and open position on a symbol. |
|
int |
Returns how many open positions are on a symbol. |
|
int |
Returns how many open positions in a given direction are on a symbol. |
|
double |
Returns the profit of the last closed position. |
|
datetime |
Returns the opening date of the last closed position. |
|
void |
Draws the Chance-Risk-Value on the chart in conjunction with quick trade lines. |
|
double |
Returns the Chance-Risk-Value. |
|
void |
Automatically generates a Quick Trade button with the specified values. |
|
void |
Sets the chart events to break down the class and to increase clarity in the chart. |
Enumerations of the class
GTradeRisks
Identifier |
Description |
RISK_PERCENT |
Indication of the risk in percent. |
RISK_FIXED |
Expressing the risk as a fixed value of a currency. |