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

Re: [amibroker] Price Chart



PureBytes Links

Trading Reference Links

This code plots x-day bars.Param sets x between 1 and 5.

x=Param("Days",2,1,5);
y=Cum(1)%x==0;
Ox=IIf(y,Ref(O,-(x-1)),Null);
Hx=IIf(y,HHV(H,x),Null);
Lx=IIf(y,LLV(L,x),Null);
Cx=IIf(y,C,Null);
Vx=IIf(y,Sum(V,x),Null);
Change=100*(Cx-Ref(C,-x))/Ref(C,-x);
PlotOHLC(Ox,Hx,Lx,Cx,"",colorBlack,styleCandle);

GraphXSpace=3;
Title=WriteIf(!IsNull(Cx),Name()+"   "+WriteVal(x,1.0)+"-day bars  "
+" Open "+WriteVal(Ox,1.2)+", Hi "+WriteVal(Hx,1.2)+
", Lo"+WriteVal(Lx,1.2)+", Close "+WriteVal(Cx,1.2)+
" ("+WriteVal(Change,1.1)+"%) "+" Volume "+WriteVal(Vx,1.0),Name()+
"   "+WriteVal(x,1.0)+"-day bars  "+" {EMPTY}");


JS

--- In amibroker@xxxxxxxxxxxxxxx, "mleonsprint" <mleonsprint@xxxx> 
wrote:
> I realize that weekly is a built in function however is there a 
way 
> to plot a 3 day chart? (3 daily bars in one bar?) I am trying with 
> the link....
> 
> 
> Thanks for your help
> Mark
> 
> 
> 
> 
> --- In amibroker@xxxxxxxxxxxxxxx, "Tomasz Janeczko" 
<amibroker@xxxx> 
> wrote:
> > Mark,
> > 
> > Weekly charts are built-in.
> > 
> > If you mean using time frame functions, there is a sample here:
> > http://www.amibroker.com/guide/h_timeframe.html
> > 
> > EXAMPLE 2: weekly candlestick chart overlaid on line daily price 
> chart
> > 
> > wo = TimeFrameGetPrice( "O", inWeekly, 0, expandPoint ); 
> > wh = TimeFrameGetPrice( "H", inWeekly, 0, expandPoint ); 
> > wl = TimeFrameGetPrice( "L", inWeekly, 0, expandPoint ); 
> > wc = TimeFrameGetPrice( "C", inWeekly, 0, expandPoint ); 
> > 
> > PlotOHLC( wo, wh, wl, wc, "Weekly Close", colorWhite, 
> styleCandle ); 
> > Plot( Close, "Daily Close", colorBlue ); 
> > 
> > Best regards,
> > Tomasz Janeczko
> > amibroker.com
> > ----- Original Message ----- 
> > From: "mleonsprint" <mleonsprint@xxxx>
> > To: <amibroker@xxxxxxxxxxxxxxx>
> > Sent: Friday, February 13, 2004 1:22 AM
> > Subject: [amibroker] 2 day bars? 5 day bars???
> > 
> > 
> > > I tried to use the plotohlc() afl to plot 5 day bars but it 
came 
> out 
> > > looking instead like a donchian channel with candles.... Is 
> there 
> > > anyway to plot a 5 day bar?  TC2000 uses a weekly bar as the 
> last 5 
> > > bars and most other packages use weekly's as MON thru FRI... I 
> am 
> > > just not sure how to code this up or if it is something that 
> will 
> > > need to be requested from Tomasz.....
> > > 
> > > Thanks for your help
> > > Mark
> > > 
> > > 
> > > 
> > > Send BUG REPORTS to bugs@xxxx
> > > Send SUGGESTIONS to suggest@xxxx
> > > -----------------------------------------
> > > Post AmiQuote-related messages ONLY to: 
amiquote@xxxxxxxxxxxxxxx 
> > > (Web page: http://groups.yahoo.com/group/amiquote/messages/)
> > > --------------------------------------------
> > > Check group FAQ at: 
> http://groups.yahoo.com/group/amibroker/files/groupfaq.html 
> > > Yahoo! Groups Links
> > > 
> > > 
> > > 
> > >  
> > > 
> > >



Send BUG REPORTS to bugs@xxxxxxxxxxxxx
Send SUGGESTIONS to suggest@xxxxxxxxxxxxx
-----------------------------------------
Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx 
(Web page: http://groups.yahoo.com/group/amiquote/messages/)
--------------------------------------------
Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
     http://groups.yahoo.com/group/amibroker/

<*> To unsubscribe from this group, send an email to:
     amibroker-unsubscribe@xxxxxxxxxxxxxxx

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