if(lot_m <= minlot) lot_m = minlot; // from this line, my self
else if(lot_m >= maxlot) lot_m = maxlot;
else if(lot_m > minlot && lot_m < maxlot)
{
int k = int((lot - minlot)/steplot);
lot_m = NormalizeDouble(minlot+k*steplot,2);
}
return(lot_m);
if(OrderProfit()>0) lot--;
if(OrderProfit()<0) lot_m++;
}
if(_m_risk == Max_Risk) lot_m = lot; // you can not understand anything here
return(0);
}
I have been struggling with this for two days. I cannot write the function that recalculates the risk.
If a trade is closed by TP, the risk will remain the same.
If the risk is closed by SL, the risk is increased by 2 times and so on, up to the value prescribed in the input variables of the Expert Advisor, say Max_Risk = 8;
and then reset to the initial risk Risk = 1;
Well, if after doubling the trade is closed at TR, we again return to the initial Risk = 1;
Задавайте вопросы по техническому анализу, обсуждайте торговые системы и улучшайте свои навыки программирования торговых стратегий на языке MQL5. Общайтесь и обменивайтесь опытом на форуме с трейдерами всего мира и помогайте ответами новичкам — наше сообщество развивается вместе с вами. и снова dll и маркет День добрый! Правило №1 dll на...
The idea is the following: the Expert Advisor counts the difference between the current ATR value and the previous one. But only with increasing ATR.
This difference is displayed in the variable "razn". I need the value of the variable "razn" to be added/cumulated to the variable "summ" with each arrival of a new bar.
In the current version accumulation of "summ" does not work correctly.
Все предопределенные периоды графиков имеют уникальные идентификаторы. Идентификатор PERIOD_CURRENT означает текущий период графика, на котором запущена mql5-программа.
Good afternoon to forum members. I can't find any information. Is there any tool that automatically draws lines (not horizontal) from lows and highs to a certain point level? In other words, do you define the low or high and draw the line to the candlestick that fixes the distance in pips from the high or low? I found that the Fractal indicator does low and high determination. But I have not been able to find such an add-on allowing me to draw a line to the point of price change by a certain number of points.
I doubt I can explain, if that's what you're asking
object is ... let's say a variable of class type
in your code section is class CProgram
somewhere in your code it must say
and will need to be called
Can you tell me what it means?
return value of'OrderSend' should be checked TestLibrary.mq4 64 6
Can you tell me what it means?
return value of 'OrderSend' should be checked TestLibrary.mq4 64 6
The result of OrderSend should be checked. :-)
OrderSend result must be verified. :-)
I know English)))
how to check it?
I know English)))
How do you check it?
result=SomeOperation(....)
if (result!=ok) {
Print("Error");
}
result=SomeOperation(....)
if (result!=ok) {
Print("Error");
}
}
I have been struggling with this for two days. I cannot write the function that recalculates the risk.
If a trade is closed by TP, the risk will remain the same.
If the risk is closed by SL, the risk is increased by 2 times and so on, up to the value prescribed in the input variables of the Expert Advisor, say Max_Risk = 8;
and then reset to the initial risk Risk = 1;
Well, if after doubling the trade is closed at TR, we again return to the initial Risk = 1;
Can you help?
Thank you in advance.
Good afternoon!
Professionals please help. I can't solve one problem. Here is the code:
datetime some_time=TimeCurrent();
int start()
{
double summ;
double razn;
int k=iBarShift(",PERIOD_M5,some_time);
double VAL0=MathAbs(iATR(NULL,0,1,1))/Point;
double VAL1=MathAbs(iATR(NULL,0,1,0))/Point;
if (VAL1>VAL0)
{
razn =MathAbs((iATR(NULL,0,1,0))-(iATR(NULL,0,1,1))/Point;
for(int i = k; i >= 1; i--)
{
summ=summ+razn;
}
Comment("Used periods: ",k,"\n,
"ATR previous: "+VAL0+"\n",
"ATR current: ",VAL1,"\n",
"ATR difference: ",razn,"\n",
"ATR difference: ",summ,"\n");
}
return(0);
}
The idea is the following: the Expert Advisor counts the difference between the current ATR value and the previous one. But only with increasing ATR.
This difference is displayed in the variable "razn". I need the value of the variable "razn" to be added/cumulated to the variable "summ" with each arrival of a new bar.
In the current version accumulation of "summ" does not work correctly.
I suspect it's about loops.