
11-20-2008, 07:40 AM
|
 |
Senior Member
|
|
Join Date: Jan 2006
Location: Johannesburg, South Africa
Posts: 1,357
|
|
Quote:
Originally Posted by mladen
All one need to do (in the case of ADX_CrossesNonrepainting) is to add two lines of code :
PHP Code:
for(int i = 0; i < limit; i++)
{
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[i] = EMPTY_VALUE; // this line added
ExtMapBuffer2[i] = EMPTY_VALUE; // this line added too
//----
if(b4plusdi < b4minusdi && nowplusdi > nowminusdi)
ExtMapBuffer1[i] = Low[i] - nShift*Point;
//----
if(b4plusdi > b4minusdi && nowplusdi < nowminusdi)
ExtMapBuffer2[i] = High[i] + 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)
|
First of all Mladen my friend, you are just too brilliant for words!! Thank you for showing us the right way; much appreciate your experise.
Secondly, there are "so many versions" of Wilders DMI that I would respectfully ask you to point me to the correct one.
I have this one from iGorad to be found at: http://www.forex-tsd.com/227710-post147.html
Thanking you in advance.
__________________
"Risk comes from not knowing what you are doing" The Tao of Warren Buffett.
"Avoiding mistakes, makes people STUPID and having to be RIGHT, makes you OBSOLETE." Robert Kiyosaki.
Last edited by ValeoFX; 11-20-2008 at 07:51 AM.
|