PureBytes Links
Trading Reference Links
|
Azmani
> how can I reference Yesterday bar, even when analyzing intra-day
> bars.
This indicator should have every thing you need. Don't throw it away because it "looks too
complicated" but try it out to see what it does and doesn't do. Set defaults at your preferred
values. If you want a single daily candle from yesterday to sit in the middle of today's bars then
it isn't going to happen, sorry. However if you can make the best of what is available I think
you'll get what you need from this. There is simpler code around but simpler is more likely to omit
any special features you want.
Roy
{Daily OHLC}
{©2004 Roy Larsen, rlarsen@xxxxxxxxxxxxxx}
{for use on intraday charts}
{set 'Fh' and 'Fm' to signal last bar of day}
Fh:=Input("Last Daily Bar - Hour" ,0,23,16);
Fm:=Input("Last Daily Bar - Minute",0,59,00);
Q:=Input("Display Mode, 0=Static 1=Dynamic 2=Test",0,2,2);
{0=Display, update at last bar of day}
{1=Display, update on each new bar}
{2=Backtest, update on first bar of new day}
M:=DayOfMonth()<>ValueWhen(2,1,DayOfMonth());
F:=Hour()=Fh AND Minute()=Fm;
G:=LastValue(Highest(Sum(DayOfWeek()<>
ValueWhen(2,1,DayOfWeek()),5))=5);
A:=LastValue(Cum(1)-1)=Cum(1);
B:=LastValue(Cum(1))=Cum(1);
J:=If(F,1,If(Alert(F,2)=0 AND M,2,0));
J:=If(A+LastValue(J)>2 OR B+Q=2,1,(B=0)*J);
J:=If(G,1,If(Q=2 OR Cum(J)<=1,M*2,J));
M:=M OR G;
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)));
Cw:=ValueWhen(1,J,If(J=1,C,ValueWhen(2-G,1,C)));
Ow:=ValueWhen(1,J,If(J=1,ValueWhen(1,M,O),
ValueWhen(2-G,1,ValueWhen(1,M,O))));
Ow:=ValueWhen(1,Ow>0,Ow);
Hw:=ValueWhen(1,Hw>0,Hw);
Lw:=ValueWhen(1,Lw>0,Lw);
Cw:=ValueWhen(1,Cw>0,Cw);
Ow; Hw; Lw; Cw;
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/equismetastock/
<*> To unsubscribe from this group, send an email to:
equismetastock-unsubscribe@xxxxxxxxxxxxxxx
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
|