Class to handle profit protection mechanisms such as trailing stops and break-even adjustments.
More...
Class to handle profit protection mechanisms such as trailing stops and break-even adjustments.
◆ ENUM_PROFIT_PROTECTION_TYPE
Enumeration of different profit protection types.
Enumerator |
---|
BREAK_EVEN | Trailing Stop.
Break Even
|
◆ ProfitProtection()
ProfitProtection::ProfitProtection |
( |
void | | ) |
|
|
inline |
◆ GetActivationPrice()
double ProfitProtection::GetActivationPrice |
( |
ulong | positionTicket | ) |
|
Calculates the activation price for a given position based on the activation percentage.
- Parameters
-
positionTicket | Position ticket number |
- Returns
- The activation price for the position, or 0 if the position cannot be selected
◆ ModifyStopLossFromPositionBuy()
bool ProfitProtection::ModifyStopLossFromPositionBuy |
( |
ulong | ticket, |
|
|
double | newStopLoss ) |
Modifies the stop loss for a buy position.
- Parameters
-
ticket | Position ticket number |
newStopLoss | New stop loss value |
- Returns
- True if stop loss was successfully modified, otherwise false
◆ ModifyStopLossFromPositionSell()
bool ProfitProtection::ModifyStopLossFromPositionSell |
( |
ulong | ticket, |
|
|
double | newStopLoss ) |
Modifies the stop loss for a sell position.
- Parameters
-
ticket | Position ticket number |
newStopLoss | New stop loss value |
- Returns
- True if stop loss was successfully modified, otherwise false
◆ UpdateAtr()
void ProfitProtection::UpdateAtr |
( |
ulong | magic_arg, |
|
|
string | symbol_arg, |
|
|
double | activation_percent_arg, |
|
|
double | deviation_percent_arg ) |
Updates the attributes of the ProfitProtection class.
- Parameters
-
magic_arg | Magic number for trade operations |
symbol_arg | Trading symbol |
activation_percent_arg | Activation percentage for profit protection |
deviation_percent_arg | Deviation percentage for profit protection |
- Parameters
-
magic_arg | Magic number argument |
symbol_arg | Symbol argument |
activation_percent_arg | Activation percentage argument |
deviation_percent_arg | Deviation percentage argument |
◆ activationPercent
double ProfitProtection::activationPercent |
Activation percentage for profit protection.
◆ detectPositions
Object for detecting positions.
◆ deviationPercent
double ProfitProtection::deviationPercent |
Deviation percentage for profit protection.
◆ magic
ulong ProfitProtection::magic |
Magic number for trade operations.
◆ symbol
string ProfitProtection::symbol |
◆ trade
CTrade ProfitProtection::trade |
Trade object for performing trade operations.
The documentation for this class was generated from the following file:
- C:/Users/solut/AppData/Roaming/MetaQuotes/Terminal/010E047102812FC0C18890992854220E/MQL5/Include/AtingMQL5/src/profitProtection/ProfitProtection.mqh