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!!!!
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.
makssub 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
Connect the indicator to the Expert Advisor and get its data through CopyBuffer(). The colour buffer has index 1, where 0 is green and 1 is red.
Artyom Trishkin #: 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.
MQL5: language of trade strategies built-in the MetaTrader 5 Trading Platform, allows writing your own trading robots, technical indicators, scripts and libraries of functions
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.
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<<1full 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