int per[] has only four entries, so k should range from 0 to 3, inclusive?
int sma[] has only three entries, so i should range from 0 to 2, inclusive?
int sma[] has only three entries, so i should range from 0 to 2, inclusive?
I agree with richplank
for(int k=0; k<4; k++) { for(int i=0;i<3;i++) { if ((iMA(NULL,per[k],sma[i],0,MODE_SMA,PRICE_CLOSE, 1) - (iMA(NULL,per[k],sma[i],0,MODE_SMA,PRICE_CLOSE, 10))) > 0) checkA[i+p]=3; else checkA[i+p]=2; } p=p+4; }

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
3 SMA's: 30, 50, 100
4 TimeFrames: 30, 60, 240, 1440
What I try to find is the direction of the SMA's for these Time Frames. The first and second TimeFrame is right but the third and fourth is wrong!
I can't find the bug. Anyone?