If you want to anchor "Close" and "Range" to an earlier bar (i.e. yesterday's last bar), then you can use ValueWhen passing a condition that would identify the last bar of the previous day.
e.g. (untested) days = DayOfWeek(); yesterday = Ref(days, -1) != days; AddColumn(ValueWhen(yesterday, Close), "Close" ); AddColumn(ValueWhen(yesterday, H-L), "Range"); I don't trade intraday, so can't swear that DayOfWeek will do the job. But, the concept is there. You might instead need to check for a bar with a later time than the current time, etc. etc. Mike --- In [email protected], "Teguh P" <teguh_pran...@...> wrote: > > 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 ... >
