Hi AF, Not sure what you are trying to do here? But one thing I know- a couple of things are not correct and it's out of sync.
Even if the example was OK, it would show that it can be done. But not any advantage of having higher TF data in a high res mode. For that the demo should show something more complext, not a normal MA. Please let me know what you want to show with this example? Jorgen --- In [email protected], "af_1000000" <af_1000...@...> wrote: > > To visualize the difference between the "Traditional" method and the "Jorgen" > method when calculating MA run the following script on let's say 1min chart > (higher timeframe set to 15min by default): > > TF = Param(" Higher Timeframe",15,2,60,1); > Period = Param("MA Period",10,2,50,1); > > Jorgen_MA = Null; > > TimeFrameSet(in1Minute * TF); > BI_TF = BarIndex(); > Close_TF = Close; > MA_TF = MA(Close_TF,Period); > Sum_TF = Sum(Close_TF,Period - 1); > > TimeFrameRestore(); > CLOSE_TF_Base = TimeFrameExpand(Close_TF,in1Minute * TF); > BI_TF_Base = TimeFrameExpand(BI_TF,in1Minute * TF); > TF_Bar = IIf(BI_TF_Base != Ref(BI_TF_Base,-1),1,0); > > MA_TF_Base = TimeFrameExpand(MA_TF,in1Minute * TF); > Sum_TF_Base = TimeFrameExpand(Sum_TF,in1Minute * TF); > > Jorgen_MA = (Sum_TF_Base + Close) / Period; > > Plot(CLOSE_TF_Base,"TF", colorRed); > Plot(MA_TF_Base,"MA_TF", colorYellow); > Plot(Jorgen_MA,"JMA", colorBrightGreen); > > Height = Param("TF Bar Height as % of Y axis",10, 2, 100, 1) ; > Plot(TF_Bar,"",colorBlue,styleOwnScale|styleHistogram,Height); > > AF >
