Be careful with it.
if (b4plusdi>b4minusdi && nowplusdi<nowminusdi)
It is looking for future values (the shift-1 parameter) to find out crossings
Secondly, I have an ADX Crossing indicator by Amir which I find extremely accurate almost to the point of disbelief. It outperforms the 2 I have downloaded from your zipped file and I place it here for your perusal and comment.
Valeo, upon closer inspection, its the exact same as the Non-repainting ADX cross. The difference is that the dot in yours looks like it shows up 1 bar before the Non-repainting ADX cross arrows show up. The funny thing is, they appear at the same time. As Mladen pointed out, it's the shift value that makes it look like it shows up 1 bar "earlier".
I think pip assasin alaskan (or whatever you like) REPAINTS ?
Hi my good friend,
I was just being polite.
Did you get my e-mail to your private mail address?
Mladen, would you mind being more explicit regarding the "warning"? It most certainly does not repaint, but if there is anything else to be aware of, I would like to know so that I can address it. It most certainly gives excellent signals.
Looking forward to hearing from you.
Thanks for the confirmation re APA. My pleasure for the ADX Crossing.mq4.
There are two coding errors in that indicator :
Hope this is explicit enough
Very much so as I have come to know you, Mladen and I thank you for this kind explanation.
Would you therefore suggest that the other version (ADX_CrossesNonrepainting), be the correct one to use?
I await your expert advise with baited breath. Thanking you most sincerely.
Sorry. Same buffer cleaning issue with ADX_CrossesNonrepainting (but it does not "look into the future")
Nature of ADX (the DI+ and DI- which are changing values only when price makes new high or new low) makes the repainting situations rare, but, still there they are...
Clean it out?
Is there a way to periodically clean out the memory?
All one need to do (in the case of ADX_CrossesNonrepainting) is to add two lines of code :
b4plusdi = iADX(NULL, 0, ADXcrossesPeriod, PRICE_CLOSE, MODE_PLUSDI, i + 1);
nowplusdi = iADX(NULL, 0, ADXcrossesPeriod, PRICE_CLOSE, MODE_PLUSDI, i);
b4minusdi = iADX(NULL, 0, ADXcrossesPeriod, PRICE_CLOSE, MODE_MINUSDI, i + 1);
nowminusdi = iADX(NULL, 0, ADXcrossesPeriod, PRICE_CLOSE, MODE_MINUSDI, i);
ExtMapBuffer1 = EMPTY_VALUE; // this line added
ExtMapBuffer2 = EMPTY_VALUE; // this line added too
ExtMapBuffer1 = Low - nShift*Point;
if(b4plusdi > b4minusdi && nowplusdi < nowminusdi)
ExtMapBuffer2 = High + nShift*Point;
That is the "clean up". Nothing else does not have to be done
Since the "if block" is not always going to assign value, the corresponding buffer must be cleaned before the "if block" (otherwise there is a risk of repainting)
PS: when using ADX, do not forget that metatrader ADX is not equal to Wilders DMI (the original)