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

Re: [amibroker] Re: How to use AddCustomMetric() to add external values



PureBytes Links

Trading Reference Links

Title: Re: [amibroker] Re: How to use AddCustomMetric() to add external values
actionPortfolio works on SECOND pass of the backtester (actual backtest)
actionBacktest works on FIRST pass of the backtester (collecting signals)

Best regards,
Tomasz Janeczko
amibroker.com
----- Original Message -----
From: Herman
To: Mike
Sent: Thursday, November 06, 2008 1:45 PM
Subject: Re: [amibroker] Re: How to use AddCustomMetric() to add external values

Thank you for your comments Mike. 


Yes, actionPortfolio works for me too. actionBacktest Does not - I don't know what that one is for.


The part of my OLE I want to improve is: 


1) Run Individual Backtests on a Watchlist and save the report.

2) calculate custom metrics and merge them with the above report

3) Explore/Sort/Display this file with an Exploration.


This involves a lot of file handling and extra code. This is the part I am trying to streamline. 


Since BT Metrics are only available AFTER a Backtests and we have no metric functions in afl I cannot use the BT metrics in the formula being Backtested. I spend a lot of time but failed to make in-line calculated metrics match those produced by the Backtester. It looks like I have to run two sequential Backtests. Do my calculations using the metrics after the first BT, then pass them to the second BT, to use my custom metrics in my system and get them included in my report.


Nothing is ever easy ;-) 


herman



Tuesday, November 4, 2008, 9:44:18 PM, you wrote:


> Herman,


> Adding a simple metric at the portfolio level is, as you would 

> expect, very straight forward. See the user guide:


> http://www.amibroker.com/guide/a_custommetrics.html


> I do not know whether idividual backtests are treated any differently 

> than portfolio level backtest. I have not experimented with that.


> My guess would be that, as an implementation detail, the exact same 

> code is run from an internal watchlist of length 1 rather than the 

> entire contents of your actual multi symbol watchlist. That being the 

> case, then Name() will still not work for you due to the same reasons 

> that Open, Close, etc. do not work (i.e. there is no current symbol 

> even with a portfolio that happens to be of size 1).


> What is unique about your scenario is that you appear to want to do 

> something with individual symbols before completing the post 

> processing.


> The typical scenario would be to simply let the backtester run to 

> completion, then query the system wide performance stats from which 

> to derive your own metric. Also common would be to reference 

> composites constructed along the way via Foreign

> ("~MyComposite", "X"). If you can push your logic into the 

> calculation of a composite, that might help.


> P.S. I've always used actionPortfolio without any problem, as per the 

> user guide link above. I haven't tried from OLE, but doubt that it 

> would make a difference.


> I don't see any explicit description for actionPortfolio anywhere 

> (only it's actual usage in examples), and the only description I see 

> for actionBacktest is when using Status("actionEx") as opposed to 

> Status("action"). Yet, there are developer notes mentioning 

> actionBacktest that predate "actionEx". Still, I would stick with 

> actionPorfolio unless you find a reason not to.


> Mike



> ------------------------------------


> **** IMPORTANT ****

> This group is for the discussion between users only.

> This is *NOT* technical support channel.


> *********************

> TO GET TECHNICAL 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/



__._,_.___

**** IMPORTANT ****
This group is for the discussion between users only.
This is *NOT* technical support channel.

*********************
TO GET TECHNICAL 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

*********************************




Your email settings: Individual Email|Traditional
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

__,_._,___