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.
For each order: calculate the difference between the opening price and the price you need, multiply by the pip value, and by the order volume.
Add up.
This is a bit tricky.
Go through the open orders and sum up:
Possibly.
But if the reason is that the question is about MT5 and not MT4, then I was guided by this list:
It's just luring us to a fiver with its advertising... :-) For more - See Treugi coming up.
Uh-huh, and where do we come to ? read the question carefully. it's about calculating the profit, at a certain point, not the current one.
It seems so... unfortunately, it's problematic to check it on the tester (or I'm so sleepy I can't figure out how), check?
Good afternoon.
How do I check if a number is a whole number?
e.g. as a result of dividing from one number by another
Good afternoon.
How do I check if a number is a whole number?
For example, the result of dividing from one number by another?
You can go like this
Delta - Set error
I want to commit 2 trades in the history and perform an action on the third one, can you do this :
int Orders=HistoryTotal(); // history orders total
int Kol_Orders=0; // number of trades
for(int s=Orders-1;s>=0;s--)
{
if(OrderSelect(s,SELECT_BY_POS,MODE_HISTORY)==false)
{
Print("History error!");
break;
}
if(OrderSymbol()!=Symbol() || OrderType()>OP_SELL || OrderMagicNumber()!=MAGIC)
continue;
Kol_Orders++;
}
bool CheckInt(double Value, double Delta){
Value=Kol_Orders/2;
delta =0.001;
if (MathAbs(Value-MathRound(Value))<Delta)
return(true);
return(false);
}
int Orders=HistoryTotal(); // history orders total
int Kol_Orders=0; // number of orders
for(int s=Orders-1;s>=0;s--)
{
if(OrderSelect(s,SELECT_BY_POS,MODE_HISTORY)==false)
{
Print("History error!");
break;
}
if(OrderSymbol()!=Symbol() || OrderType()>OP_SELL || OrderMagicNumber()!=MAGIC)
continue;
Kol_Orders++;
}
if(MathMod(Kol_Orders/2,1.0)==0){
// input integer
}