You consider this (there are mistype in your code)
if (Close[pos ] > Close[pos + 1 ] ) { temp = 1;} else{ temp = 0 ;} ExtMapBuffer1[pos] = temp;
Thanks for the answer Roah .
This works but I still dont know how and why . So could you explain my in details becouse my understending is :
"if pos = today then pos + 1 = tomorrow and pos - 1 = yesterday " . According to this my code after yours correction means :
Thanks forward.
This works but I still dont know how and why . So could you explain my in details becouse my understending is :
"if pos = today then pos + 1 = tomorrow and pos - 1 = yesterday " . According to this my code after yours correction means :
if (Close[today ] > Close[tomorrow] ) { temp = 1;} else{ temp = 0 ;}Am I right ?
Thanks forward.
"if pos = today then pos + 1 = tomorrow and pos - 1 = yesterday "
Correct your thinking please
pos + 1 = day before
pos - 1 = day after (when pos != 0)
if pos == 0 tomorrow has to be calculated by other means
Chart bars:
| | | | | |
5 4 3 2 1 0
CHEERS phy !!!
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 thought MQL4 would be easy form my but not . First indicator and an incomprehensible issue for my.
I want to create an indicator which will show "1" if today close price is greate then yesterday close and and vice versa "-1" if today close price is smaller then yesterday close.
My code:
... and output :
In a yellow box I marked data and result which do not fit to my theory.
Could you help my with this problem and explain me why does it happen ?