If all you need are daily values than as qq said just set the time frame in the scan/explore settings to daily. If your scan requires comparing intraday bar values with yesterday's daily values learn the timeframecompress/expand functions:
// Get daily values TimeFrameSet( inDaily ); YO = Ref(O, -1); YC = Ref(C, -1); YR = Ref(H-L, -1); TimeFrameRestore(); // Fill the arrays in the current intraday timeframe (1m, 10m, whatever you choose) YesterdaysOpen = TimeFrameExpand(YO, inDaily, expandFirst); YesterdaysClose = TimeFrameExpand(YC, inDaily, expandFirst); YesterdaysRange = TimeFrameExpand(YR, inDaily, expandFirst); AddColumn(YesterdaysClose , "Close" ); AddColumn(YesterdaysRange , "Range"); // Whatever the open of the current bar is on the current timeframe // i.e. on 10 minute bars this value will different exploring at // 9:30 and then again at 9:40 AddColumn( O, "Open"); --- In [email protected], q q <war_maniac2...@...> wrote: > > However, C (-1) and H-L (-1) keeps on changing rather than refering to > yesterday's Close and yesterday H-L. It seems Amibroker pick up latest bar C > and H-L rather than yesterday's C and H-L. > > Any thoughts what went wrong? Appreciate any helps based on your experiences. > Thanks in advance ... > > plz understand the function Ref(array,period) properly- > Â > Ref(C,-1) shall show close of previous day only when timeframe is daily,if it > is 1 min,then it shall give the close of previous bar. > > > --- On Tue, 4/6/10, Teguh P <teguh_pran...@...> wrote: > > > From: Teguh P <teguh_pran...@...> > Subject: [amibroker] Refering to Yesterday Close (with ESignal) > To: [email protected] > Date: Tuesday, April 6, 2010, 11:24 PM > > > Â > > > > I have quick question on refering to yesterday's C (and H-L) for Explore > function. For background, I am using ESignal data feed. I run below my AFL at > 9.30 EST right at the market open to get opening price and gap vs yesterday > close. > > AddColumn(Ref( C,-1), "Close" ); > AddColumn(Ref( H-L,-1), "Range"); > AddColumn( O, "Open"); > > Anytime I run the exploration (i.e. 9.30am, 9.40am), Open always refers to > today's Open which is what I expect. However, C (-1) and H-L (-1) keeps on > changing rather than refering to yesterday's Close and yesterday H-L. It > seems Amibroker pick up latest bar C and H-L rather than yesterday's C and > H-L. > > Any thoughts what went wrong? Appreciate any helps based on your experiences. > Thanks in advance ... >
