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

[amibroker] Using AFL to process many stocks: creating your own index



PureBytes Links

Trading Reference Links

Hi there,

I am trying to use AFL to process several stocks from a watch list 
and rank them, then perform a sum on the list.

The idea is to create my own index where each stock is weighted 
according to price*volume over a year.

This is the code I have so far:

  TimeFrameSet(inWeekly);
  MedianPrice = (Open + Close) / 2;
  AnnualMoneyFlow = Sum(MedianPrice * Volume, 52);

AnnualMoneyFlow represents the total dollars changing hands on a 
stock over the past 52 weeks. The higher this amount, the smaller 
the weight this stock is multiplied by, so that all stocks 
contribute fairly to the index. The final index is just the sum of 
all stocks multiplied by their respective weights.

A few questions:

1) How can I do this in AFL? Backtesting or scanning doesn't seem to 
be the mode to perform comparative tasks across all stocks in a 
watch list?

2) Any suggestions or problems with this crude index approach? I 
just want a simple sector index and my data provider doesn't supply 
this from S&P. The indexes aren't available on Yahoo either.

3) Is it possible to write AFL that creates the index above then 
moves to the next watch list to run again, say 10 times for 
different industries?

many thanks - Fog (Andy)




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/