В этой статье проведен краткий обзор языка MQL5, приведен пример написания советника и индикатора. Данная статья ориентирована как на читателей, знакомых с программированием на языке MQL4, так и на тех, кто только начинает знакомство с программированием торговых систем и индикаторов.
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.
What is the exchange rate of the credits?
1 credit = $1
Use dynamic arrays or change the dimensionality of static arrays:
I'm trying to find the price of the last fractal in the EA, but it's not working...
Fractals=iFractals(Symbol(),TimeFrame); if(Fractals==INVALID_HANDLE) Print("HandleError = ",_LastError);double FractalUp() { //----- CopyBuffer(Fractals,0,0,5,UpVal); ArraySetAsSeries(UpVal,true); //----- for(i=0; i < 13; i++) { if(UpVal[i] != 0) return(NormalizeDouble(UpVal[i],_Digits)); } return(0); }double FractalDn() { //----- CopyBuffer(Fractals,1,0,5,DnVal); ArraySetAsSeries(DnVal,true); //----- for(i=0; i < 13; i++) { if(DnVal[i] != 0) return(NormalizeDouble(DnVal[i],_Digits)); } return(0); }I'm trying to find the price of the last fractal in the EA, but something's not working...
You are going outside the array. Try it like this:
You are going outside the array. Try it this way:
Thank you. Unfortunately it doesn't work correctly either.
if there is no fractal, it will return EMPTY_VALUE instead of 0
working option in the script
if there is no fractal, it will return EMPTY_VALUE instead of 0
working option in the script
Good afternoon!
Parsing the following article -https://www.mql5.com/ru/articles/35
When I attach the attached indicator to the chart, it shows some nonsense and not what it is supposed to show.
What is the reason for this?
Good afternoon!
Parsing the following article -https://www.mql5.com/ru/articles/35
When I attach the attached indicator to the chart, it shows some nonsense and not what it is supposed to show.
What is the reason?
Looks like in the output, CopyBuffer does not want to work properly.
Throw ATR on the chart, tf D1, then this indicator, try tf change, should work.
It seems that on weekends, CopyBuffer does not want to work properly.
Throw on ATR chart, diff D1, then this indicator, try to change the diff, it should work.
On weekdays, when there are quotes, same thing.
Sometimes it slips and it shows what I need, but when I change TF or get a new quote it starts giving nonsense again.