Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 1165
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
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.