[ARCHIVE!] Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Can't go anywhere without you - 4. - page 7

 
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.
 

How to calculate the maximum differencebetween AccountEquity()and AccountBalance() in the history ?

Thank you.

 
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.
 
rustein:

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.

 
especially the second one ...
 
FAQ:
I honestly wish you good luck on this thorny path.
Thank you.
 
TarasBY:

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.

 
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))
 

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.

Reason: