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

RE: [amibroker] Re: Multiple time frames



PureBytes Links

Trading Reference Links



Here is 
another one for previous weekly H and L and C on daily bars.
I think 
this is correct?
<FONT face=Arial color=#000000 
size=2>Regards,
<FONT face=Arial color=#000000 
size=2>Larry<FONT face="Courier New" 
color=#008000 size=1>
/*Weekly OHLC on Daily Chart 
by Larry Lovrencic*/
graphxspace=<FONT face="Courier New" color=#ff00ff 
size=1>1;
MaxGraph=<FONT face="Courier New" color=#ff00ff 
size=1>4;
Graph0 =Close;
Hw=ValueWhen<FONT 
face="Courier New" size=1>( <FONT face="Courier New" color=#0000ff 
size=1>DayOfWeek() == <FONT 
face="Courier New" color=#ff00ff size=1>5<FONT face="CourierNew" 
size=1>, HHV<FONT 
face="Courier New" size=1>(H, <FONT face="Courier New" 
color=#ff00ff size=1>5) );
Graph1 =<FONT face="Courier New" color=#0000ff 
size=1>Ref(Hw,-<FONT 
face="Courier New" color=#ff00ff size=1>1<FONT face="CourierNew" 
size=1>);
Lw= <FONT face="Courier New" color=#0000ff 
size=1>ValueWhen( <FONT 
face="Courier New" color=#0000ff size=1>DayOfWeek<FONT face="Courier New" 
size=1>() == 5<FONT 
face="Courier New" size=1>, <FONT face="Courier New" color=#0000ff 
size=1>LLV(L, <FONT 
face="Courier New" color=#ff00ff size=1>5<FONT face="CourierNew" 
size=1>) );
Graph2=<FONT face="Courier New" color=#0000ff 
size=1>Ref(Lw,-<FONT 
face="Courier New" color=#ff00ff size=1>1<FONT face="CourierNew" 
size=1>);
Cw=ValueWhen<FONT 
face="Courier New" size=1>( <FONT face="Courier New" color=#0000ff 
size=1>DayOfWeek() == <FONT 
face="Courier New" color=#ff00ff size=1>5<FONT face="CourierNew" 
size=1>, Close );
Graph3 =<FONT face="Courier New" color=#0000ff 
size=1>Ref(Cw,-<FONT 
face="Courier New" color=#ff00ff size=1>1<FONT face="CourierNew" 
size=1>); 
Graph0Style=<FONT face="Courier New" color=#ff00ff 
size=1>4+<FONT face="Courier New" 
color=#ff00ff size=1>128;
Graph0Color=<FONT face="Courier New" color=#ff00ff 
size=1>29;
Graph1Color=<FONT face="Courier New" color=#ff00ff 
size=1>4;
Graph1Style=<FONT face="Courier New" color=#ff00ff 
size=1>4+<FONT face="Courier New" 
color=#ff00ff size=1>8+<FONT 
face="Courier New" color=#ff00ff size=1>16<FONT face="Courier New" 
size=1>;
Graph2Color=<FONT face="Courier New" color=#ff00ff 
size=1>5;
Graph2Style=<FONT face="Courier New" color=#ff00ff 
size=1>4+<FONT face="Courier New" 
color=#ff00ff size=1>8+<FONT 
face="Courier New" color=#ff00ff size=1>16<FONT face="Courier New" 
size=1>;
Graph3Color=<FONT face="Courier New" color=#ff00ff 
size=1>1;
Graph3Style=<FONT face="Courier New" color=#ff00ff 
size=1>4+<FONT face="Courier New" 
color=#ff00ff size=1>128;
Title = <FONT face="Courier New" color=#0000ff 
size=1>Date()+<FONT 
face="Courier New" color=#ff00ff size=1>" "<FONT face="Courier New" 
size=1>+Name<FONT 
face="Courier New" size=1>()+<FONT face="Courier New" color=#ff00ff 
size=1>" Wkly HLC on Dly" +<FONT 
face="Courier New" color=#ff00ff size=1>" O"<FONT face="Courier New" 
size=1>+<FONT face="Courier New" color=#0000ff 
size=1>WriteVal<FONT face="Courier New" 
size=1>(O,format=<FONT face="Courier New" color=#ff00ff 
size=1>1.2)+<FONT 
face="Courier New" color=#ff00ff size=1>" H"<FONT face="Courier New" 
size=1>+<FONT face="Courier New" color=#0000ff 
size=1>WriteVal<FONT face="Courier New" 
size=1>(H,format=<FONT face="Courier New" color=#ff00ff 
size=1>1.2)+<FONT 
face="Courier New" color=#ff00ff size=1>" L"<FONT face="Courier New" 
size=1>+<FONT face="Courier New" color=#0000ff 
size=1>WriteVal<FONT face="Courier New" 
size=1>(L,format=<FONT face="Courier New" color=#ff00ff 
size=1>1.2)+<FONT 
face="Courier New" color=#ff00ff size=1>" C"<FONT face="Courier New" 
size=1>+<FONT face="Courier New" color=#0000ff 
size=1>WriteVal<FONT face="Courier New" 
size=1>(C,format=<FONT face="Courier New" color=#ff00ff 
size=1>1.2)+ <FONT 
face="Courier New" color=#ff00ff size=1>" Wkly H="<FONT 
face="Courier New" size=1> + <FONT face="Courier New" color=#0000ff 
size=1>WriteVal<FONT face="Courier New" 
size=1>(Graph1,format=<FONT face="Courier New" color=#ff00ff 
size=1>1.2)+<FONT 
face="Courier New" color=#ff00ff size=1>" Wkly L="<FONT 
face="Courier New" size=1>+<FONT face="Courier New" color=#0000ff 
size=1>WriteVal<FONT face="Courier New" 
size=1>(Graph2,format=<FONT face="Courier New" color=#ff00ff 
size=1>1.2)+<FONT 
face="Courier New" color=#ff00ff size=1>" Wkly C="<FONT 
face="Courier New" size=1>+<FONT face="Courier New" color=#0000ff 
size=1>WriteVal<FONT face="Courier New" 
size=1>(Graph3,format=<FONT face="Courier New" color=#ff00ff 
size=1>1.2<FONT face="Courier New" 
size=1>);<FONT face="Courier New" 
size=1>
 <A 
 
 
href="" target=_blank> 
<A 
href="" 
target=_top> 
<BLOCKQUOTE 
>
<FONT face=Tahoma 
size=2>-----Original Message-----From: nenapacwanfr 
[mailto:nenapacwanfr@xxxx]Sent: Monday, 10 December 2001 
05:55To: amibroker@xxxxxxxxxxxxxxxSubject: [amibroker] 
Re: Multiple time 
framesDim,Dim,I have tried to 
plot and compares the two 
codes.B=DayOfWeek();G=BarsSince(B<Ref(B,-1));Hw=ValueWhen(B<Ref(B,-1),HHV(Ref(H,-1) 
,Ref(G,-1)+1));this code gives the highest H of the previous weekon 
Monday( if monday is the first day )of the actual weekNow if I 
plotB=DayOfWeek();G=B<Ref(B,-1);HW=highest(H,G);gives you 
the high of the actual week, but you don't have the weekly bars of Hon 
daily chart.steph> 
Cw=ValueWhen(B<Ref(B,-1),Ref(Close,-1));> gives every Monday (or 
every first working day of the week) the > close value for last Friday 
(or the last working day of previous week)> and keeps this value 
till the end of the week.> As for Hw and Lw is quite different from the 
question.> Try to plot them and you will see.> Dimitris 
Tsokakis> --- In amibroker@xxxx, "nenapacwanfr" 
<nenapacwanfr@xxxx> wrote:> > HI,> > Do you think 
this could do the job> > > > steph> > > 
> /***Weekly Bars***/> > B=DayOfWeek();> > 
G=BarsSince(B<Ref(B,-1));> > > > 
Hw=ValueWhen(B<Ref(B,-1),HHV(Ref(H,-1) ,Ref(G,-1)+1));> > 
Lw=ValueWhen(B<Ref(B,-1),LLV(Ref(L,-1) ,Ref(G,-1)+1));> > 
Cw=ValueWhen(B<Ref(B,-1),Ref(Close,-1));> > > > 
Graph0=Close;> > Graph0Color=1 ;> > 
Graph0Style=64;> > > > Graph1=CW;> > 
Graph1Color= 5 ;> > Graph1Style=1;> > > >