However, the plot was using future data. For example, on last Wednesday, the weekly RSI value was based on last Friday's close.
Is there a parameter to force the weekly RSI calculation to use Wednesday's close on Wednesday etc.?
Or any tricks to accomplish this? (Probably need to construct some artificial arrays based partially on the timeframe compression I would think).
Read the manual CAREFULLY and SLOWLY, it explains various expand modes and how to use them Multiple Time Frame support
Just read it -everything is there. And no, your assumptions are incorrect. By default (expandLast) weekly data from given week are available at the END of Friday. This is how it works - and it is described in manual.
That’s exactly what I meant. Only on Fridays, the weekly plot (based on close) were correct! On Mondays to Thursdays, the weekly plot value is the same as on Fridays, because it uses Fridays’ data.
What I want is on Mondays to Thursdays, their daily close values are used as the weekly close for THAT day, instead of Fridays close values. For example, calculating a 10 weekly moving average, the first 9 values are from the 9 weekly closes, but the last value should be the daily close as the week is not yet completed.
This can likely be done through some low level array manipulation. I was checking if there was an easy way, but obviously not.
Thanks Tomasz, you are right, that's a misunderstanding on my part.
But that's not what I want. From Monday Til Thursday, I not only want to use previous weeks data, I also want to use the data from current week. i.e. on Monday, I want to use Monday's close as the current weekly close; on Tuesday I want to use Tuesday's close as the current weekly close. etc.
This is similar to calculating the daily moving average during trading hours, you use the last price as today's close even though today has not finished yet. You don't ignore today's data and just use yesterday's close as the last close.
As it is explained in the manual, WEEKLY time frame means ONE BAR per WEEK.
You want multiple data bars per week (different for each day of the week). That is NOT WEEKLY mode.
What you want is something completely different. You can do that but not using TimeFrame functions.
What you really want is not weekly data. That is DAILY data that gets summed processed so Close remains the daily close, while High and Low are highest/lowest daily points since Monday and Volume is sum since monday. But it is still daily interval (one bar per day, not week).
It can be done completely without TimeFrame functions as there is NO time compression of data.