Files
mt5-quant-lib/Orders/StopLogic.mqh
T

22 lines
624 B
Plaintext
Raw Normal View History

2025-07-04 16:56:12 +02:00
class StopLogic {
public:
2025-07-07 15:43:17 +02:00
double sl_specified_value_switch(string sl_mode, double inp_sl_var, double value);
double tp_specified_value_switch(string tp_mode, double inp_tp_var, double value);
2025-07-04 16:56:12 +02:00
};
double StopLogic::sl_specified_value_switch(string sl_mode, double inp_sl_var, double value) {
2025-07-07 15:43:17 +02:00
if (sl_mode == "SL_SPECIFIED_VALUE") {
return value;
} else {
return inp_sl_var;
}
2025-07-04 16:56:12 +02:00
}
double StopLogic::tp_specified_value_switch(string tp_mode, double inp_tp_var, double value) {
2025-07-07 15:43:17 +02:00
if (tp_mode == "SL_SPECIFIED_VALUE") {
return value;
} else {
return inp_tp_var;
}
2025-07-04 16:56:12 +02:00
}