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

Re: [Metastockusers] Daily ATR values on 60min chart



PureBytes Links

Trading Reference Links

Sam

Something like this perhaps? I haven't tested this for accuracy but it's
based on my Daily OHLC (for intraday charts) sso I'm confident that part is
OK. You'll need to check that I've followed the rest of the code accurately.
Set your own last bar of the day definition in place for 'F' but it will
function OK as-is giving the signal one bar later than optimum.

Roy

  {Your Indicator}
  {use on intra-day charts}
D:=Input("ATR Smoothing Periods",1,100,5);
Q:=Input("1=Dynamic Current Day",0,1,1);
  {M defines first bar of the day}
M:=DayOfWeek()<>ValueWhen(2,1,DayOfWeek());
  {F defines last bar of the day}
F:=0; {Hour()=hh AND Minute()=mm}
B:=LastValue(Cum(1))=Cum(1);
J:=If(F,1,If(Alert(F,2)=0 AND M,2,0));
J:=If(B+(J=0)+Q=3,1,J);
Hw:=HighestSince(1,M,H);
Hw:=ValueWhen(1,J,If(J=1,Hw,ValueWhen(2,1,Hw)));
Lw:=LowestSince(1,M,L);
Lw:=ValueWhen(1,J,If(J=1,Lw,ValueWhen(2,1,Lw)));
C0:=ValueWhen(1,J,If(J=1,C,ValueWhen(2,1,C)));
C1:=ValueWhen(2,J,C0);
TH:=If(C1>Hw,C1,H);
TL:=If(C1<Lw,C1,L);
TR:=TH-TL;
TW:=Cum((J>0)*TR);
MA:=(TW-ValueWhen(D+1,J,TW))/D;
R#1:=C0+MA;
S#1:=C0-MA;
R1:=ValueWhen(2,J,R#1);
S1:=ValueWhen(2,J,S#1);
ValueWhen(1,R1>0,R1);
ValueWhen(1,S1>0,S1);

> I currently plot the indicator below [using 5 periods] on my daily
> charts.
>
> I would like to show the daily chart values on the 60 minute chart.
>
>
>
> Someone please offer any guidance.
>
> Thank you.
>
>
>
>
>
> periods:=Input("ATR Periods?",1,100,10);
>
> TH:=If(Ref(C,-1) > H,Ref(C,-1),H);
>
> TL:=If(Ref(C,-1) < L,Ref(C,-1),L);
>
> TR:=TH-TL;
>
> R#1:=C+Mov(TR,periods,S);
>
> S#1:=C-Mov(TR,periods,S);
>
> Ref(R#1,-1);Ref(S#1,-1);
>
>



------------------------ Yahoo! Groups Sponsor ---------------------~-->
Buy Ink Cartridges or Refill Kits for your HP, Epson, Canon or Lexmark
Printer at MyInks.com. Free s/h on orders $50 or more to the US & Canada.
http://www.c1tracking.com/l.asp?cid=5511
http://us.click.yahoo.com/mOAaAA/3exGAA/qnsNAA/zMEolB/TM
---------------------------------------------------------------------~->

To unsubscribe from this group, send an email to:
Metastockusers-unsubscribe@xxxxxxxxxxx

 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/