Morning all,
As @cja said above, I understand the few coders out there must be inundated with request, so I always tried my best through research and try-and-error, to achieve my goals, but sometimes we hit a brick wall, and this is been a big, BIG wall for me in the last few days, in my head the logic is so simple (perhaps Im spoiled by pinescript simplicity as well) and I cant get this piece of code to work so if you out there, enjoying your Xmas morning cuppa, please, if thats easy easy code/logic, gift me with a solution, make a small fella happy this Xmas
Ok, down to the trouble:
As in the picture attached I have a T3 CCI Histogram and Im trying to "highlight" the first bar of the histo that changes direction (up/down) below the 18/-18 level, I have managed to achieve that with the following
, as seen on the picture TOP part, it works ok, BUT when the bar is crosses below 0 but didnt reach -18 level it doesnt do its thing, so I used:
and thats the BOTTOM part of the picture.
But, my goal is to highlight only the bar that is below -18 ignoring the ones between 0 and -17, with the code I used it highlight both (the else if still apply the first condition of if statement) giving me 2 highlighted bars which is not what I need.
I tried a few methods from other indicators but I didnt understand the logic used with mql4 to achieve what I want, if you know, how to do it please, give me a hand with it? or code that for me and I will learn from the code itself.
Many many thanks and Happy and Safe Christmas To All!!!!
As @cja said above, I understand the few coders out there must be inundated with request, so I always tried my best through research and try-and-error, to achieve my goals, but sometimes we hit a brick wall, and this is been a big, BIG wall for me in the last few days, in my head the logic is so simple (perhaps Im spoiled by pinescript simplicity as well) and I cant get this piece of code to work so if you out there, enjoying your Xmas morning cuppa, please, if thats easy easy code/logic, gift me with a solution, make a small fella happy this Xmas
Ok, down to the trouble:
As in the picture attached I have a T3 CCI Histogram and Im trying to "highlight" the first bar of the histo that changes direction (up/down) below the 18/-18 level, I have managed to achieve that with the following
Inserted Code
if(cci[i] < -18 && cci[i+1] > 0) ...
Inserted Code
else if(cci[i] < -18 && cci[i+2] > 0) ...
But, my goal is to highlight only the bar that is below -18 ignoring the ones between 0 and -17, with the code I used it highlight both (the else if still apply the first condition of if statement) giving me 2 highlighted bars which is not what I need.
I tried a few methods from other indicators but I didnt understand the logic used with mql4 to achieve what I want, if you know, how to do it please, give me a hand with it? or code that for me and I will learn from the code itself.
Many many thanks and Happy and Safe Christmas To All!!!!
Attached File(s)
T3_CCI.mq4
5 KB
|
264 downloads