There are some bugs in my code.
So that I made some test code as follow.
for (int i=Bars;i>=0;i--)
{
ExtMapBuffer1[i]=i+100;
Print("i=",i," E0=",ExtMapBuffer1[0]," E1=",ExtMapBuffer1[1],"E2=",ExtMapBuffer1[2]," E3=",ExtMapBuffer1[3]);
}
=> it returns
iTest_01 EURUSD,Weekly: i=0 E0=100 E1=101 E2=102 E3=103
iTest_01 EURUSD,Weekly: i=1 E0=2147483647 E1=101 E2=102 E3=103
iTest_01 EURUSD,Weekly: i=2 E0=2147483647 E1=2147483647 E2=102 E3=103
There is a very strange value"214....".
Why the empty array will start with "214...." rather then 0??
/-------- there's another test code -------/
for(bar=Bars;bar>=1;bar--)
{
//ExtMapBuffer2[bar]=bar+100;
ExtMapBuffer2[bar]=1;
}
for (int i=0;i<5;i++)
{ Print("i=",i," E[i]=",ExtMapBuffer2[i]);}
=>it returns
iTest_01 EURUSD,H1: i=3 E[i]=1
iTest_01 EURUSD,H1: i=2 E[i]=1
iTest_01 EURUSD,H1: i=1 E[i]=1
iTest_01 EURUSD,H1: i=0 E[i]=100
Well, you will find that if you execute first code,E[0]=100.
And when you excute the second code E[0] start with 100.
That means there is something be memorized in the array, and may cause some mistake.
May I ask if there is any function can clear the memory or what should I write in line to clear memory???