Before, I start to try to write the code, I would like any suggestions that may help me programming the following:
I use 30min bars. I calculate, for instance, a 3-bars SMA.
Let´s say right now it is 10.00, so I have 3 bars, 9.00am, 9.30am and 10.00am.
Now I have to wait for 30 minutes in order to get a new bar (10.30am).
Up to here, nothing new. Here is where it gets complicated for me.
Instead of waiting 30 minutes, I would like to wait 5 minutes and calculate a "temporary" SMA using the closing price of this 5 minute bar (10.05 am) and the 9.30 bar and the 9.00 bar. Then, another 5 min later, calculate the SMA of 10.10, 9.30 and 9.00. Therefore, I would get 5 temporary SMA before I get the definitive one 30min later.
I know I have to use two timeframes, that is allright, but how do I calculate this temporary SMA?
Anyone who has done something similar wants to lighten me in this issue?
Thanks!!
Juan Rivera
Comment