Class to calculate stop loss and take profit prices.
More...
|
| CalcStop () |
| Default constructor for CalcStop.
|
|
void | SetSymbol (string &symbol_arg) |
| Sets the symbol for stop calculation.
|
|
double | Run (double price, long stop, ENUM_POSITION_TYPE type, ENUM_STOP_TYPE stop_type) |
| Calculates the stop price based on provided parameters.
|
|
|
static bool | VerifyNoNegative (double price) |
| Verifies that a single price is not negative.
|
|
static bool | VerifyNoNegative (double &prices[]) |
| Verifies that all prices in an array are not negative.
|
|
static bool | VerifyNoNegative (CArrayDouble &prices) |
| Verifies that all prices in a CArrayDouble are not negative.
|
|
|
string | symbol |
| Symbol of the asset for which stops are calculated.
|
|
|
double | internal (double price, ulong stop, ENUM_POSITION_TYPE type, ENUM_STOP_TYPE stop_type) |
| Internal function to calculate stop loss or take profit prices.
|
|
Class to calculate stop loss and take profit prices.
◆ ENUM_STOP_TYPE
Enumeration to specify the type of stop (Take Profit or Stop Loss).
Enumerator |
---|
TAKE_PROFIT | Take profit type.
|
STOP_LOSS | Stop loss type.
|
◆ CalcStop()
◆ internal()
double CalcStop::internal |
( |
double | price, |
|
|
ulong | stop, |
|
|
ENUM_POSITION_TYPE | type, |
|
|
ENUM_STOP_TYPE | stop_type ) |
|
protected |
Internal function to calculate stop loss or take profit prices.
- Parameters
-
price | Base price. |
stop | Distance of the stop in points. |
type | Position type (buy/sell). |
stop_type | Type of stop (Take Profit or Stop Loss). |
- Returns
- Calculated stop price.
◆ Run()
double CalcStop::Run |
( |
double | price, |
|
|
long | stop, |
|
|
ENUM_POSITION_TYPE | type, |
|
|
ENUM_STOP_TYPE | stop_type ) |
Calculates the stop price based on provided parameters.
- Parameters
-
price | Base price. |
stop | Distance of the stop in points. |
type | Position type (buy/sell). |
stop_type | Type of stop (Take Profit or Stop Loss). |
- Returns
- Calculated stop price.
◆ SetSymbol()
void CalcStop::SetSymbol |
( |
string & | symbol_arg | ) |
|
|
inline |
Sets the symbol for stop calculation.
- Parameters
-
symbol_arg | The symbol to set. |
◆ VerifyNoNegative() [1/3]
bool CalcStop::VerifyNoNegative |
( |
CArrayDouble & | prices | ) |
|
|
static |
Verifies that all prices in a CArrayDouble are not negative.
- Parameters
-
prices | Array of prices to check. |
- Returns
- True if all prices are non-negative, false otherwise.
◆ VerifyNoNegative() [2/3]
bool CalcStop::VerifyNoNegative |
( |
double & | prices[] | ) |
|
|
static |
Verifies that all prices in an array are not negative.
- Parameters
-
prices | Array of prices to check. |
- Returns
- True if all prices are non-negative, false otherwise.
◆ VerifyNoNegative() [3/3]
bool CalcStop::VerifyNoNegative |
( |
double | price | ) |
|
|
static |
Verifies that a single price is not negative.
- Parameters
-
- Returns
- True if the price is non-negative, false otherwise.
◆ symbol
Symbol of the asset for which stops are calculated.
The documentation for this class was generated from the following file:
- C:/Users/solut/AppData/Roaming/MetaQuotes/Terminal/010E047102812FC0C18890992854220E/MQL5/Include/AtingMQL5/src/transaction/CalcStop.mqh