MetaStock™ Zone Forum & FAQ Artykuły Linki Elliott Waves EasyLanguage™ Zone

A B C D E F G H I J K L M N O P R S T U V W Y Z #

True Range & High-Low Range on Real Time Hourly Charts
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);

 

e-w-True_Range_High-Low_Range_on_RTHourly.gif
Regards,
iamken

[23439]
Source / From: TOP
http://purebytes.com/archives/metastock/

Equis and MetaStock® and MetaStock Professional® are registered trademarks of Equis International. Achelis Binary Wave®, The DownLoader®,
Expert Advisor®, OptionScope®, Quotecenter® and Smart Charts® are trademarks of Equis International, a Thomson Reuters company.

TradeStation® Pro, TradeStation® 2000i, OptionStation®, SuperCharts®, PowerEditor® and EasyLanguage®
are registered trademarks of TradeStation Technologies, Inc. Other names and marks referred to are the property of their respective owners.

All information provided on this website is for educational purposes only. Trading involves risk, including possible loss of principal and other losses.

Ten i inne materiały na tej stronie zostały zamieszczone zostały jedynie w celach edukacyjnych, nie ponoszę żadnej odpowiedzialno¶ci za ich stosowanie.

Gra na giełdzie i rynkach walutowych (FOREX) niesie ze sob± ryzyko poważnych strat finansowych!