Thank you for your attention. This problem is solved, but since this is a discussion thread, I would like the authors to look at the type conversion. ENUM - integer (integer 4-byte data type).
Checked, the given expressions are calculated correctly.
What version of compiler and terminal do you have and how did you measure the results of the expressions?
... double tmp = 0.531 * Var; // 1.062 double tmp = Var * 0.531; // 0!!! The constant 0.531 is taken arbitrarily. It can be replaced by double variable. Thank you for your attention.
... double tmp = 0.531 * Var; // 1.062 double tmp = Var * 0.531; // 0!!! The constant 0.531 is taken arbitrarily. It can be replaced by double variable. Thank you for your attention.
Thank you for your message. The error has been corrected, please wait for an update.
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
Gentlemen, please comment:
...
enum varOfInt
{
Duple= 2,
Triple = 3,
};
input varOfInt Var = Duple;
...
int OnInit()
{
...
double tmp;
tmp = 0.531 * Var // tmp == 0!!!
tmp = 1.531 * Var // tmp == 2!!!
...
numbers (0.531; 1.531) are arbitrarily specified.
Thank you.
Try it like this
Try it like this
ENUM - integer (integer 4-byte data type).
Checked, the given expressions are calculated correctly.
What version of compiler and terminal do you have and how did you measure the results of the expressions?
Checked, the given expressions are calculated correctly.
What version of compiler and terminal do you have and how did you measure the results of the expressions?
...
double tmp = 0.531 * Var; // 1.062
double tmp = Var * 0.531; // 0!!!
The constant 0.531 is taken arbitrarily. It can be replaced by double variable.
Thank you for your attention.
...
double tmp = 0.531 * Var; // 1.062
double tmp = Var * 0.531; // 0!!!
The constant 0.531 is taken arbitrarily. It can be replaced by double variable.
Thank you for your attention.
Is it possible to set a trailing stop programmatically?
Or is it necessary to tighten SL with every tick through order modification?
Can you advise a beginner how to catch an event in the EA whentp or sl is triggered.
Thank you in advance.
OnTrade function
Thanks....But...I'm a very beginner:)))