The biggest drawback to this method is that it's highly susceptible to array out of range errors.
Anyone? Is this how everyone does it?
double Value[]; for ( int i = 0; i < rates_total; i++ ) { if (i<2){ Value[i] = 0; continue; } Value[i] = high[i-2]; }Sometimes my indicator comes up blank. I'm not sure if there is another method of doing this.
antiseptic: ? Is this how everyone does it?Sometimes my indicator comes up blank.
- The array has no size, therefor any assignment to it will fail.
- Do your lookbacks correctly. and don't process every every tick.
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 do it like this, but it seems a little hackish. Is there a better way? Thanks.
Also, is there a function that adds up the previous X amount of ohlc values? MathSum is the only one I could find, but it only adds up one entire array, when I want only X number of bars to be calculated.