[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[amibroker] formula for daily in intraday frame



PureBytes Links

Trading Reference Links

Hi,

try to plot this formula to get daily values in my chart with intraday
hourly frame.

Period = Param("Periode", 9, 2, 50, 1);
TimeFrameSet(inDaily);
CH = -1*LinearReg(C-H, period);
CL = LinearReg(C-L, period);
TimeFrameRestore();
Plot(TimeFrameExpand(CH, inDaily), "CH", colorRed, styleStaircase);
Plot(TimeFrameExpand(CL, inDaily), "CL", colorGreen, styleStaircase);

But this formula gives other values than "normal" formula without
Timeframe-commands in my daily timeframe chart. 
What is wrong with my solution above?

"Normal" formula is this:

Period = Param("Periode", 9, 2, 50, 1);
CH = -1*LinearReg(C-H, period);
CL = LinearReg(C-L, period);
Plot(CH, "CH", colorRed, styleStaircase);
Plot(CL, "CL", colorGreen, styleStaircase);


Regards
Robert