All the calculations described only have this one goal : calculate the values of the "ChannelBSize" dataSeries for each bar.
Imagine I have 10 values in ChannelBSize :
3-5-4-7-2-4-6-8-2-3
each of these values are calculated for each bar, using the values of the preceding 100 bars.
What I would like to have is a "SmoothChannel" DataSeries, where the ten values should be :
3-3-3-3-3-3-3-3-3-3
because 3 is the last value of ChannelBSize
Imagine that the day after (or, the bar after), I get 11 values in ChannelBSize : imagine it is a 4 (the values can only change once a week in the code, but let's suppose I obtain a 4). ChannelBSize contains now :
3-5-4-7-2-4-6-8-2-3-4
And I want SmoothChannel to contain 11 values :
4-4-4-4-4-4-4-4-4-4-4
Once I have this "SmoothChannel", the calculations are simple :
the upper channel is : myEMA(today) + SmoothChannel(today)*myEMA(today)/2
the lower channel is : myEMA(today) - SmoothChannel(today)*myEMA(today)/2
I don't think it is necessary to index myEMA, as it is normal that it changes everyday.
It's really the "SmoothChannel" DataSeries that need to contain, for each historical bar, the value of "ChannelBSize", calculated for the last bar.

Comment