/* 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 <[EMAIL PROTECTED]>
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
| Software support | Small business finance | Business finance online |
| Business finance training | Business finance course |
Change settings via the Web (Yahoo! ID required)
Change settings via email: Switch delivery to Daily Digest | Switch to Fully Featured
Visit Your Group | Yahoo! Groups Terms of Use | Unsubscribe
__,_._,___
