Alexey Viktorov: I'll give you that. But it takes a lot of effort to figure out that this is the "Trading" window and not the "Account History" window. Inattentiveness and laziness, without straining my head muscles, led me to believe it was the Account History window.
Disabled the standard bid line on the chart because of the inconvenience of reading five digits, made the output 4 digits in the upper corner, but sometimes the price goes down, which again causes inconvenience :-)
I want to make the Label object move with the price, right price tagOBJ_ARROW_RIGHT_PRICE I don't like because of the frame.
But for some reason the positioning by price bid doesn't work, the label is displayed in the upper left corner
Disabled the standard bid line on the chart because of the inconvenience of reading five digits, made the output 4 digits in the upper corner, but sometimes the price goes down, which again causes inconvenience :-)
I want to make the Label object move with the price, right price tagOBJ_ARROW_RIGHT_PRICE I don't like because of the frame.
But for some reason the positioning by price bid doesn't work, the label is displayed in the upper left corner
ForOBJ_LABEL the position report is specified in pixels.
ChartTimePriceToXY(0, 0, TimeCurrent(), Bid, x, y); // x, y добавьте в переменные, тип intObjectSetInteger(0, objname, OBJPROP_YDISTANCE, ulong(y)); //если на эту строчку будет предупреждение в компиляторе то, значит ulong ненужен//ObjectSetDouble(0, objname, OBJPROP_PRICE, SymbolInfoDouble(Symbol(), SYMBOL_BID));ObjectSetString(0, objname, OBJPROP_TEXT, DoubleToString(Bid, _Digits-1));
//+------------------------------------------------------------------+//| |//+------------------------------------------------------------------+double Znomer()
{
zn=0; // z-число
psd=0; // кол. положительных сделок
usd=0; // количество отрицательных сделок
ww=0; // боол переменная
nn=0; // боол переменная
C=0; // C = количество чередований между отрицательными и положительными сделками
index=OrdersHistoryTotal();
if(OrdersHistoryTotal()>302) index=301; // берём не более 301 сделкиif(index<30) return(1); // берём не менее 30
count=OrdersHistoryTotal(); // считаем от скольки
prom=count-index; // выделяем только последние сделкиif (prom<0) prom=0; // исключаем ошибкиfor( i=count;i>prom;i--)
{
if(OrderSelect(i,SELECT_BY_POS,MODE_HISTORY)== true)
{
if(OrderSymbol()==Symbol() && OrderMagicNumber()==Magic)
{// далее магия
pribul=OrderProfit();
if (ww==0&&pribul>1){C++;ww=1;nn=0;}// подсчитываем смену тенденцииif (nn==0&&pribul<1){C++;ww=0;nn=1;}// подсчитываем смену тенденции if (pribul>1){psd++;}//прибыльные сделкиif (pribul<1){usd++;}// убыточные сделки
}
}
}
/*/*
Величина Z = (A * (C — 0.5) — B)/ ((B*(B — C))/(C -1))^(1/2), где:
A = количество анализируемых сделок;
B = 2*количество прибыльных сделок * количество убыточных сделок;
C = количество чередований в выборке (чередованием считается каждая пара сделок,
когда прибыльная сделка сменяет убыточную либо наоборот).
*/
zn = (index*(C-0.5)-(2*psd*usd))/
((((2*psd*usd)*((2*psd*usd)-C))/
(C-1))*((((2*psd*usd)*((2*psd*usd)-C))/
(C-1))*0.5));
return(zn);
}
I decided to write a simple code to calculate the tendency of losing an account. For this purpose I took a simple Z-account formula and tried to transfer it to mq4 code. Everything seems to be correct, but when I run simple output using Print the EA does not work at once. I don't get any errors when compiling. I've already racked my brains on simple code.
I decided to write a simple code for calculating the tendency of losing an account. For this purpose I took a simple formula of Z-account and tried to use it in mq4 code. Everything seems to be correct, but when I run simple output using Print the EA does not work at once. I don't get any errors when compiling. I've already racked my brains on simple code.
Thanks if you can help !
Check the work permit for the EA. And where in the print output? This piece of code must return something, if there are no errors, then the problem is outside of this piece of code. Except that division by 0 may occur in this block.
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.
I'll give you that. But it takes a lot of effort to figure out that this is the "Trading" window and not the "Account History" window. Inattentiveness and laziness, without straining my head muscles, led me to believe it was the Account History window.
It happens. Forgivable.
Disabled the standard bid line on the chart because of the inconvenience of reading five digits, made the output 4 digits in the upper corner, but sometimes the price goes down, which again causes inconvenience :-)
I want to make the Label object move with the price, right price tagOBJ_ARROW_RIGHT_PRICE I don't like because of the frame.
But for some reason the positioning by price bid doesn't work, the label is displayed in the upper left corner
Disabled the standard bid line on the chart because of the inconvenience of reading five digits, made the output 4 digits in the upper corner, but sometimes the price goes down, which again causes inconvenience :-)
I want to make the Label object move with the price, right price tagOBJ_ARROW_RIGHT_PRICE I don't like because of the frame.
But for some reason the positioning by price bid doesn't work, the label is displayed in the upper left corner
ForOBJ_LABEL the position report is specified in pixels.
I decided to write a simple code to calculate the tendency of losing an account. For this purpose I took a simple Z-account formula and tried to transfer it to mq4 code.
Everything seems to be correct, but when I run simple output using Print the EA does not work at once. I don't get any errors when compiling.
I've already racked my brains on simple code.
Thank you if you can help !
I decided to write a simple code for calculating the tendency of losing an account. For this purpose I took a simple formula of Z-account and tried to use it in mq4 code.
Everything seems to be correct, but when I run simple output using Print the EA does not work at once. I don't get any errors when compiling.
I've already racked my brains on simple code.
Thanks if you can help !
Check the work permit for the EA. And where in the print output? This piece of code must return something, if there are no errors, then the problem is outside of this piece of code. Except that division by 0 may occur in this block.
ForOBJ_LABEL the position report is specified in pixels.
Ilya, thank you, it worked.
Only when going to the next stage - accounting for window resizing - the compiler gives a warning about data type conversion:
possible loss of data due to type conversion 4digit+.mq5 36 14
Although the function returns int type.
Ilya, thank you, it worked.
Only when going to the next stage - accounting for window resizing - the compiler gives a warning about data type conversion:
possible loss of data due to type conversion 4digit+.mq5 36 14
Although the function returns the int type.
Really?! And where does it show that the order has closed?
A green TP in the "trade" window means that the current price is within -100 pips of the TP, or, to be more correct, within 100 pips of the TP.
The function returns long type
What should I do in such cases, change the type of the variable or leave it as it is?
What is recommended to do in such cases, change the type of variable or leave it as it is?