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

[amibroker] addtocomposite -> ProductToComposite



PureBytes Links

Trading Reference Links

Dear All's,

as the name itself says addtocomposite is a very useful tool to build
indicator which can be obtained by summing over all the elements of a
given set a given function of its values.

For example using a quite obvious mathematical notations :
average=1/N Sum(x_i,i=1,i=N) or in general
with addtocomposite would be obatined by 

addtocomposite(x)/N 
run in scan mode of the set.

(forget about the afl sysntax here..)
i index here stands for element i.e. stock for example, not for bar
index, which is implicitly the same for all elements in this notatios

What twhen I want to create a different indicator which has a more
general form like product(x_1,i=1,i=N) or sum(x_i^2+x_(i-1)^3,i..)
That is required for example to calculate the geometric mean, which
has some importance in maximizing expectancy in ( kelly criterion ..)

The only way I see would be to loop through the elements and build the
indicator (also looping through the bars if necessary), but how would
I then the assign the result to the value of a symbol ?

I could scan the formula over 1 dummy symbol calculating my indicator
and then use addtocomposite(which since I scan only over one symbol
will simply assign the result) but I wonder if there is a better way.
For Example creating ProductToComposite to afl ..

Also an out of scope question, when the option to use addtocomposite
in backtesting mode is activated, is the ~symbol  constructed first
and then the backtester is using it(juest after) ?In this case two
full loops over all symbols would be required but I noticed that there
seems to be just one loop no matter what setting is used.


Thank
Ly




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/