Allan,
Graph0 is old code.
I am using the following to plot the ATC's with success.
PlotForeign("~MyDJI", "~MyDJI", colorBlack, style=styleLine);
Plot(Foreign("~MyDJI","C"),"~MyDJI",1,8);
The later is courtesy of a Dimitri Tsokakis post, although it is
common code.
BrianB2.
--- In [email protected], [EMAIL PROTECTED] wrote:
>
> Hi Ken,
> I understand the count divisor,as it was in the AFL reference
guide..the example they used was
>
> /* AddToComposite statements are for Automatic Analysis -> Scan */
> /* add Close price to our index OHLC fields */
> AddToComposite(Close, "~MyIndex", "X" );
> /* add one to open intest field (we use this field as a counter) */
> AddToComposite( 1, "~MyIndex", "I" );
> Buy = 0; // required by scan mode
> /* this part is for Indicator */
> Graph0 = Foreign( "~MyIndex", "C" )/Foreign( "~MyIndex", "I" );
> -------------------------------------------------------------------
---------------------------------------------------------------------
--------------
> The formula above does not give me the OHLC format i want,but it
does use the count as the divisor..What I fail to understand is what
exactly ATC does.I read that it sums the prices.If that is true,and
I do NOT implement a divisor,who can the ATC return a composite
value of 167 for the Energy Sector when there are probably 400
energy stocks..I am pretty sure the average price of an energy stock
is not $2,so how could the sum be 167??
>
>
> ----- Original Message -----
> From: Ken Close
> Date: Tuesday, September 12, 2006 8:26 am
> Subject: RE: [amibroker] ATC,Sectors and Industries II
> To: [email protected]
>
> > You have to save a "count" of the symbols summed by the ATC.
> >
> > AddToComposite(1,sym,OI); <<<< save in the Open Interest field.
> >
> > Then
> >
> > Price = Foreign(Sym,C)/Foreign(Sym,OI);
> > Or
> > Price = C/OI;
> >
> > To use the same formula for "regular" symbols (not ATCs), I
write:
> >
> > Price = C/Iif(OI==0,1,OI);
> >
> > -----Original Message-----
> > From: [email protected]
> > [mailto:[EMAIL PROTECTED] On Behalf
> > Of matrix10014
> > Sent: Tuesday, September 12, 2006 7:57 AM
> > To: [email protected]
> > Subject: [amibroker] ATC,Sectors and Industries II
> >
> > Sorry,one last question....
> >
> > From reading the manual it appears as if the ATC sums up prices
> > to create an
> > index.My assumption is it is price weighted..What i dont
> > understand is,if in
> > the code below we are summing up every stock in its given
> > sector,how could i
> > have a price of 167 for the Energy sector?? There must be over
> > 400 stocks in
> > that sector,so how could the sum be 167???
> >
> > I dont see a divisor in the code??? Am i missing the
obvious..again!!
> >
> > sym="~"+SectorID(1);
> > AddToComposite(L,sym,"L");
> > AddToComposite(O,sym,"O");
> > AddToComposite(H,sym,"H");
> > AddToComposite(C,sym,"C");
> > AddToComposite(V,sym,"V");
> > Buy=Sell=Short=Cover=0;
> > Filter=1;
> >
> >
> >
> >
> >
> > Please note that this group is for discussion between users only.
> >
> > To get support from AmiBroker please send an e-mail directly to
> > SUPPORT {at}
> > amibroker.com
> >
> > For other support material please check also:
> > http://www.amibroker.com/support.html
> >
> >
> > Yahoo! Groups Links
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
>
Please note that this group is for discussion between users only.
To get support from AmiBroker please send an e-mail directly to
SUPPORT {at} amibroker.com
For other support material please check also:
http://www.amibroker.com/support.html
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/amibroker/
<*> Your email settings:
Individual Email | Traditional
<*> To change settings online go to:
http://groups.yahoo.com/group/amibroker/join
(Yahoo! ID required)
<*> To change settings via email:
mailto:[EMAIL PROTECTED]
mailto:[EMAIL PROTECTED]
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/