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

Re: [amibroker] Unweighted Composites (again!)



PureBytes Links

Trading Reference Links

Hi Tim - Are you still looking for some help with this?   I have some
work done by one of my friends that might meet your requirements.
I understand how it works but have not done the justification as to
why his routine is better than an average of the prices.  I just take him at 
his
word.

It produces a composite that is  "rebalanced daily". As you might
guess there is no support from the author, as his emissary I can
answer low level questions.

Best regards
JOE



----- Original Message ----- 
From: "timgadd" <timgadd@xxxxxxxxx>
To: <amibroker@xxxxxxxxxxxxxxx>
Sent: Monday, August 14, 2006 4:02 PM
Subject: [amibroker] Unweighted Composites (again!)


> After spending MUCH time searching, I have found this topic started
> many times in the group archive, but i've never seen a final solution
> given in AFL. I would greatly appreciate assistance with the AFL code
> or reference to a prior solution.
>
> The standard AddToComposite function produces a "price weighted"
> composite. For analyzing the breadth of a sector, for
> instance, "unweighted" composites are more appropriate and revealing.
> I have seen the term "equal weighted" used for what i am calling
> an "unweighted" composite, so i will explain in boring detail what i
> am looking for just to be clear.
>
> By unweighted composite, i refer to one that is produced by
> calculating an arithmetic or geometric average of the day to day %
> change for each component, so that each component has equal weight
> (no weighting is introduced by the calculation). I am interested in
> the arithmetic average - the simplest form, but i don't know how to
> initialize the starting value and then cumulate(?) the successive %
> change averages for the open, high, low, close (volumes are simply
> added). I have seen references regarding problems with averaging
> values for high and low for this type of composite, so if necessary,
> a composite calculated on the close only will suffice. I am only
> interested in the average changes between end-of-day values, but
> would like to produce candlesticks of the composites if possible.
>
> Assuming closing values only, each composite will start with an
> initial value (like 100) and then, for each day, the average of all
> the %changes (from the previous day) will be added to the preceding
> value. Using a simple 3 component composite as an example, assume for
> the second value of the composite (remember the first value will be
> 100), we have the following %changes.
>
> Component1 = +1.2%
> Component2 = +2.4%
> Component3 = -1.7%
>
> So the first day's average %change = ( 0.012 + 0.024 - 0.017 ) / 3
>
> 100 + ((0.012 + 0.024 - 0.017) / 3) + (the next day's average %
> change) + ...
>
> The component values for volume are just added (or averaged) to get
> the daily values.
>
> TIA for any help.
>
>
>
>
>
>
> 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
>
>
>
>
>
>
>
>