Allowing access to the number of total bars expected to be processed would be another advanced technique that could be found useful to many programmers. This would allow us to add heavier weighting as we approach the current bar via a simple array.
ie:
private int totalbars = 0; private double weight = 0.0; Initialize() { totalbars = NumBarsToProcess(); } OnBarUpdate() { weight = (totalbars - currentbar ) / .25 ; }
Comment