Looking for an indicator/script that shows in the pair window the profit for that particular pair. I.e., when 3-5 pairs are traded, it is quite difficult to quickly calculate a profit on one of them if there is a build-up or lots.
If anyone has any suggestions, I would be very grateful.
Looking for an indicator/script that shows in the pair window the profit for that particular pair. I.e., when 3-5 pairs are traded, it is quite difficult to quickly calculate a profit on one of them if there is a build-up or lots.
If anyone has any suggestions, I would be very grateful.
double CurrentProfit() { // Функция считает текущий профит/лосс для одной валютной парыdouble Profit=0;
for(int i=OrdersTotal()-1; i>=0; i--){
if(!OrderSelect(i, SELECT_BY_POS, MODE_TRADES))continue;
if(OrderSymbol()!=Symbol())continue;
if(OrderMagicNumber()!=Magic) continue;
if(OrderType()>1)continue;
Profit+=OrderProfit();
}
return(Profit);}
double Profit(){ // функция считает суммарный профит/лосс закрытых позиций для одной валютной парыdouble Profit=0;
for(int i=0; i<OrdersHistoryTotal(); i++){
if(!OrderSelect(i,SELECT_BY_POS,MODE_HISTORY))continue;
if(OrderSymbol()!=Symbol())continue;
if(OrderMagicNumber()!=Magic)continue;
if(OrderType()>1)continue;
Profit+=OrderProfit()+OrderSwap()+OrderCommission();
}
return(Profit);}
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.
Hello,
Looking for an indicator/script that shows in the pair window the profit for that particular pair. I.e., when 3-5 pairs are traded, it is quite difficult to quickly calculate a profit on one of them if there is a build-up or lots.
If anyone has any suggestions, I would be very grateful.
Equity and balance indicator
Probably tweak the signal_MACD() function.
Well, that it would still return something.
I want it to return true instead of false, but I don't know how to do it =( tell me how... I'll remember it once and won't ask again )
here's the script... how do I make it return true?
here's the script... how do I make it return true?
Hello,
Looking for an indicator/script that shows in the pair window the profit for that particular pair. I.e., when 3-5 pairs are traded, it is quite difficult to quickly calculate a profit on one of them if there is a build-up or lots.
If anyone has any suggestions, I would be very grateful.
double CurrentProfit() { // Функция считает текущий профит/лосс для одной валютной пары double Profit=0; for(int i=OrdersTotal()-1; i>=0; i--){ if(!OrderSelect(i, SELECT_BY_POS, MODE_TRADES))continue; if(OrderSymbol()!=Symbol())continue; if(OrderMagicNumber()!=Magic) continue; if(OrderType()>1)continue; Profit+=OrderProfit(); } return(Profit);}Insert in the Start function:
here's the script... how do I make it return true?
I want it to return true instead of false, but I don't know how to do it =( tell me... I'll remember it once and won't ask again )
A variable inside a function is just that - a variable.
It doesn't matter what it is called.
So, if function should return a value, this value must be returned explicitly:
return( ... );