I need the Stochastic K and D values from the 2 hour TimeFrame for plotting in 5 Minute Chart. I know it sounds retarded. The TimeFrameExpand and compress and expand will give the values at the end of the 2 hour interval but I need them for every tick. I have come with formula but its not perfect I want another pair of eyes to get this right.

`TF=24;//for 5min TF=1 hence for 2Hours TF=24`

periods=15;//15 period lookback

K=MA((C-LLV(L,IIf(BarIndex()>359,(TF*periods-(TF-BarIndex()%TF)+1),360)))

/((HHV(H,IIf(BarIndex()>359,(TF*periods-(TF-BarIndex()%TF)+1),360))-LLV(L,IIf(BarIndex()>359,(TF*periods-(TF-BarIndex()%TF)+1),360))))*100,96);

D=MA(K,72);