Try this:
double val1= iAO(NULL,0, i); double val2= iAO(NULL,0, i+1); if (val1>val2) { // green } else { // red }
Cheers
Markus
Try this:
double val1= iAO(NULL,0, i); double val2= iAO(NULL,0, i+1); if (val1>val2) { // green } else { // red }
Cheers
Markus
Thanks Markus ... I am half way there now, thanks to you. Here is the trick part of the question:
1 - If there was a bar formation of red-red-red each one would be less than the one before it
2 - If the formation was green-red-red they would all be less than each other also (same as #1)
How could I determine when that a color change has occoured?
... thank you so much for the fast answer last time.
Peter in Minnesota
Try this:
double val1= iAO(NULL,0, i); double val2= iAO(NULL,0, i+1); if (val1>val2) { // green } else { // red } // The only way you can see tick formation is by printing to Expert tab on Terminal screen. // The Volume is your tick number. if (val1>val2) { Print(Volume[i]," green"); } else {Print(Volume[i]," red"); }
double val1= iAO(NULL,0, i); double val2= iAO(NULL,0, i+1); double val3= iAO(NULL,0, i+2); if (val2<val3 && val1>val2 ) { // color switch red -> green } else if (val2>val3 && val1<val2 ) { // green -> red }
:-D
Markus
double val1= iAO(NULL,0, i); double val2= iAO(NULL,0, i+1); double val3= iAO(NULL,0, i+2); if (val2<val3 && val1>val2 ) { // color switch red -> green } else if (val2>val3 && val1<val2 ) { // green -> red }
:-D
Markus
Briliant is so often simple ... thanks Markus!
Peter in Minnesota
Glad to have been of help.
Markus
Markus
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
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
Hope this is not a real stupid question:
I saw a post for this same question ... but no answer.
Does anyone have a method for returning the current color of the Awesome Oscillator within Meta-Trader?
MT4 has a function for returning the numeric value using iAO , but not the color.
Hopefully such a function would allow a test of (i) time frames backwards also.