- Katılım
- 23 Eki 2020
- Mesajlar
- 1,828
Re: Yesterday's high & low on intraday data · To: metastock@xxxxxxxxxxxxx · Subject: Re: Yesterday's high & low on intraday data · From: iamken <iamken@xxxxxxxxxxxxxxx> · Date: Sat, 18 Nov 2000 20:08:44 -0500 · References: <002b01c023b9$672b8080$cc8a6395@xxxxxxx> · Reply-To: metastock@xxxxxxxxxxxxx · Sender: owner-metastock@xxxxxxxxxxxxx Resurrected part of your original post from the trash folder. (Sorry, thought you had it solved.......) Owen Davies wrote: [snip] > I especially want to figure out yesterday's range. This should give you the |
|
High-Low Range on RTH Charts MktStart:=Hour()<Ref(Hour(),-1); yestHiVal:=ValueWhen(1,MktStart, Ref(HighestSince(1,MktStart,H),-1)); yestLoVal:=ValueWhen(1,MktStart, Ref(LowestSince(1,MktStart,L),-1)); yestHiVal-yestLoVal |
|
True Range on RTH Charts MktStart:=Hour()<Ref(Hour(),-1); opn:=ValueWhen(1,MktStart,O); yestLoVal:=ValueWhen(1,MktStart, Ref(LowestSince(1,MktStart,L),-1)); yestHiVal:=ValueWhen(1,MktStart, Ref(HighestSince(1,MktStart,H),-1)); If(opn>yestHiVal,opn-yestLoVal, If(opn<=yestHiVal AND opn>yestLoVal,yestHiVal-yestLoVal, If(opn<yestLoVal,yestHiVal-opn, If(opn>=yestLoVal AND opn<yestHiVal,yestHiVal-yestLoVal,0)))) |
|
And, FWIW, the following plots the prior day's H, L, and C on today's intraday data. I use it on the RTH session occasionally, but not on 24 hour composite charts, which would require defining each session's start/end times withthe hour() and minute() functions for accurate results. |
|
PriHiLoClo MktStart:=Hour()<Ref(Hour(),-1); yestClo:= Ref(C,-1); yestHi:= Ref(HighestSince(1,MktStart,H),-1); yestLo:= Ref(LowestSince(1,MktStart,L),-1); ValueWhen(1,MktStart,yestClo); ValueWhen(1,MktStart,yestLo); ValueWhen(1,MktStart,yestHi); |
Regards, iamken [23439] | |
| |
Source / From: |