yosuf: Explain please what is a cumulative trade? For example, there is a Sell position minus 100 pips, the TS tries to open a Buy position, is there such a possibility? Or what "aggregate" will be left if the CU does open a BAY position?
If your long trade with the same lot, it will overlap your short one. So, if you think in terms of fours, your stoploss is triggered.
Calculate the maximum distance between the opening price and the price extremums during the lifetime for each order in the history multiplied by the lot and the pip price add it all up and add margin.
Kim wrote his functions a long time ago, there were no DCs working with 5 digits then, and therefore these functions will not ALWAYS work correctly, for example these lines:
Second line can be simply removed at all, to avoid "stressing" the code or check for exception of error ZERO_DIVIDE can be written like this:
It would be more elegant to write Point value into global EA variable in init() and take it from there.
Yes... I noticed that a long time ago, but never got around to it.
Just started to learn MQL4. I am trying to write my own EA. I cannot solve one problem:
Suppose I have open orders "buy1", "buy2", "buy3" and pending orders "buy4", "buy5", "buy6". I can not write a script that would close all these orders when one of them is breaking through Take-Profit.
Please help me as a beginner. I am very thankful for the replies.
is it possible to prescribe that if the price closed on a stop it opened a deal in the same direction if it closed on a profit also in the same direction?? just yes or no? )))) thanks))
The thing is I need a simple example of calculating the maximum distance between the opening price and the price extremums during the lifetime of each order. This I can't figure out how to do.
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.
Explain please what is a cumulative trade? For example, there is a Sell position minus 100 pips, the TS tries to open a Buy position, is there such a possibility? Or what "aggregate" will be left if the CU does open a BAY position?
If your long trade with the same lot, it will overlap your short one. So, if you think in terms of fours, your stoploss is triggered.
How to calculate the maximum differencebetween AccountEquity()and AccountBalance() in the history ?
Thank you.
How to calculate the maximum difference between AccountEquity() and AccountBalance() in the history ?
Thank you.
AccountBalance(M1) = BeginBalance + Profit (on closed trades);
AccountEquity(M1) = AccountBalance(M1) + Profit (on open trades);
And run through the BeginBalance.
MaxProsadka[0] = MathMax (MaxProsadka[0], AccountEquity(M1) - AccountBalance(M1);
MaxProsadka[1] = MathMin (MaxProsadka[1], AccountEquity(M1) - AccountBalance(M1));
Something like this.
I honestly wish you good luck on this thorny path.
Kim wrote his functions a long time ago, there were no DCs working with 5 digits then, and therefore these functions will not ALWAYS work correctly, for example these lines:
Second line can be simply removed at all, to avoid "stressing" the code or check for exception of error ZERO_DIVIDE can be written like this:
It would be more elegant to write Point value into global EA variable in init() and take it from there.
Yes... I noticed that a long time ago, but never got around to it.
I'll fix it. THANK YOU.
Suppose I have open orders "buy1", "buy2", "buy3" and pending orders "buy4", "buy5", "buy6". I can not write a script that would close all these orders when one of them is breaking through Take-Profit.
Please help me as a beginner. I am very thankful for the replies.
Thank you all very much,
The thing is I need a simple example of calculating the maximum distance between the opening price and the price extremums during the lifetime of each order. This I can't figure out how to do.