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

[amibroker] create custom weighted index



PureBytes Links

Trading Reference Links

Hi, hope you could help me in creating my own custom index.

I have 8 stocks that I would like to include in the index, and each 
of the stocks have their own weighting in the index;

O= (Open of A * 42) + (Open of B * 60) + (Open of C * 231  ETC...)
H= (High of A * 42) + (High of B * 60) + (High of C * 231 ETC...)
L= (Low of A * 42) + (Low of B * 60) + (Low of C * 231 ETC...)
C= (Close of A * 42) + (Close of B * 60) + (Close of C * 231 ETC...)
V= Volume added together

Is there any smooth way to create this with the weightings?


I have found the following info:
A sample formula could look like this: 
Code: 

AddToComposite(C,"~myindex", "C"); 
AddToComposite(H,"~myindex", "H"); 
AddToComposite(L,"~myindex", "L"); 
AddToComposite(O,"~myindex", "O"); 
AddToComposite(V,"~myindex", "V"); 

You would need to copy this formula into Automatic Analysis window. 
Click on Filter - choose appropriate category you want to calculate 
index from, then click OK. Now click SCAN. Then choose View->Refresh 
All menu. In the ticker tree you will see ~myindex ticker. 



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 NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/

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:amibroker-digest@xxxxxxxxxxxxxxx 
    mailto:amibroker-fullfeatured@xxxxxxxxxxxxxxx

<*> 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/