Look carefully at this part of code
if(MathAbs(rstmp)>200||i==1) { rs[counts] = rstmp; double max = MathMax(MathMax(High[i],High[i+1]),High[i+2]); double min = MathMin(MathMin(Low[i],Low[i+1]),Low[i+2]); samples[counts][0]=s(Close[i],min,max); samples[counts][1]=s(Open[i],min,max); samples[counts][2]=s(High[i],min,max); samples[counts][3]=s( Low[i],min,max); samples[counts][4]=s(Close[i+1],min,max); samples[counts][5]=s(Open[i+1],min,max); samples[counts][6]=s( High[i+1],min,max); samples[counts][7]=s( Low[i+1],min,max); samples[counts][8]=s(Close[i+2],min,max); samples[counts][9]=s( Open[i+2],min,max); samples[counts][10]=s( High[i+2],min,max); samples[counts][11]=s(Low[i+2],min,max); Print(counts); Print(samples[counts][0]);//here we can see that samples array has the values. counts = counts +1; if(counts ==1000) break; }You fulfil it only one time when i==1.
thank you.
i have found out the reason.
becasue i 'd like to get 1000 sample, but it can't . i change 1000 to 500, now it works.
roger do you know how to make sure we have a number of history data ?
Sorry, I didn't get you want to ask me.

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
i have write the problem in code comment. please take a look. thankyou.