int iStoch,iShift double dStoch[8]; for (iStoch=0,iShift=0;iStoch<8; iStoch++,iShift++) { dStoch[iStoch] = iStochastic(NULL, PERIOD_H1, 11, 5, 8, MODE_SMA,0, MODE_MAIN, iShift); if(dStoch[iStoch] < 50 && SLOW.TREND > 0)
for (q = 1; q < 7; q++) double STOCH = iStochastic(NULL, PERIOD_H1, 11, 5, 8, MODE_SMA,0, MODE_MAIN, q);
This reads stoch[1]. then overwrites it with stoch[2]. ... all the way to stoch[6]. Never does seven.
Don't know why you are reading previous values. You aren't doing anything with them.
Either use an array to save all values and then process the array. Or just process each value INSIDE the loop.
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
but it does not work, as it only reads shift 7 bars and not 0, 1, 2... 7. Is there another way of expressing this without multiple OR statements? Does a While or Do While work for this?
Thanks in advance!