Questions from Beginners MQL5 MT5 MetaTrader 5 - page 1483
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
Regards, Vladimir.
You're in the right direction. But not attentive enough
Hi Alexei, it's great that you support beginners learning a programming language and don't get tired of people like us. Thank you very much!
What is the main problem of beginners. I will only speak for myself. Yes, indeed, I don't always understand how to apply the variety of possibilities offered by the MQL5 programming language. Without basic education or practice of programming in top-level languages, it is very hard to get into this topic. Only forum members like you help me. I realise that many people are tired (and sometimes do not have enough time or patience) of constantly prompting a newcomer who has suddenly appeared on the forum.
I would like to express my gratitude once again to all those who respond to our dilettantish questions and wish - God grant you all health, long life, good luck and prosperity!!!!
Regards, Vladimir.
Good day to all.
Please, tell me how to add the Accelerator Oscillator indicator to give a signal for SELL on the red colour and a signal for BUY on the green colour, on the closing of the last bar.
Thanks
Thanks
Connect the indicator to the Expert Advisor and get its data through CopyBuffer(). The colour buffer has index 1, where value 0 is green, 1 is red.
If you don't mind. Can you give me an example?
MQL5 is hard for me after MQL4.
If it's not too much trouble. Can you give me an example?
MQL5 is hard for me after MQL4.
Hello.
There is an ADX indicator in the codebase. It contains this piece of code
If
ExtADXPeriod=14
it turns out that ExtADXPeriod<<1 is equal to value 9.
Why do we need such an entry then? Can't it be written without bit shifts?
ExtADXPeriod<<1
full indicator code below
If
ExtADXPeriod=14
thenExtADXPeriod<<1 is equal to value 9
is equal to 28 (14<<1 is like 14*2, as long as there are enough digits)
Don't pay attention, anyway the compiler will calculate const expressions at compilation and they won't get into the code. Only their result
it could be premature optimisation or the author wanted to show that he is cool.
is equal to 28 (14<<1 is like 14*2, as long as there are enough digits)
don't pay attention, anyway the compiler will count known const expressions at compilation and they won't get into the code. Only their result
it could be premature optimisation or the author wanted to show that he is cool.
1-Why 28?
14 is binary. It's 1110.
Shift one bit to the left, it's 0111, convert back to decimal, it's 9. 1*1+1+1*2+1*4=7 (wrong not 9).
2-I still would like a concrete example in this case, what is more correct to insert in such a construction instead ofExtADXPeriod<<1?
14 is binary. It's 1110.
Shift one bit to the left to 0111,
we have different "lefts" :-)
1110<<1 := 11100