Hi  Peter Carl, Dirk Eddelbuettel, Brian G. Peterson, Jeffrey Ryan, and Joshua Ulrich,

Great work so far on quantstrat.

Saying that I would highly appreciate your input on the issue that I came across using quantstrat.

Namely, it is related to how to handle powerful combination between quantstrat and  genetic algorithm packages in R (eg GALGO etc), to achieve optimal adaptive trading strategy.

The problem here is that quantstrat already has some performance issues with multiple assets (as per demo example for RSI and 9 stocks) where it can take up to several minutes for applyStrategy function to execute.

> end_t<-Sys.time()
> print("Strategy Loop:")
[1] "Strategy Loop:"
> print(end_t-start_t)
Time difference of 6.861233 mins

Logically adding genetic algorithim wrapper function to test the result with multiple variation of parameters for each indicator and for each asset further impacts performance. ( In my case with passing initial population of 50 and max iteration of 100 it was still running after 1.5 hour when stopped R).

It's worth of saying that GALGO works efficiently fast on its own (eg 20-30 sec per asset) outside quantstrat if applied on Sharp Ratio or simplistic return calcs, but there are some great benefits of trying to incorporate it quantstrat.

Coming back to demo example for RSI it appears that it takes up to 45 seconds per stock to do calculations from 2007 to 2011. With applyStrategy and applyRule being the largest drag on performance. I noticed that setting path.dep to FALSE can improve performance but its fair to say that most of strategies I test are path-dependant.

The question here is do you for your own perusal re-write applyStrategy and applyRule function to get rid parts that slow down its execution and may be unnecessary?
Or
Any optimization of indicator parameters you do outside of quantstrat (blotter) and apply quantstrat only on optimized parameters?

To end without thank you for hard work on quantstrat, would be totally unfair as it has so many benefits for so many of us.

At the same token it would be pointless to embark on endeavour to re-invent the wheel, but rather to look on ways to look for ways to improve performance of applyStrategy function.

#' The solution we've employed makes use of what we know about the strategy and
#' the orders the strategy places (or may place) to reduce the dimensionality of the problem.

Looking forward to you feedback.

Thank you,

__________________________________________________
Commonwealth Bank
Darko Roupell
Associate Quantitative Analyst
Institutional Banking & Markets
Equities Research
Darling Park Tower 1
Level 23, 201 Sussex Street
Sydney, NSW 200
P:  +61 2 9117 1254
F:  +61 2 9118 1000
M: +61 400 170 515
E: Darko.Roupell@cba.com.au
Our vision is to be Australia's finest financial services organisation through excelling in customer service.

Email Security
This email is sent solely for informational purposes. Hoax emails, commonly referred to as phishing, can appear to be from the Commonwealth Bank and ask you to update or confirm details such as client numbers, passwords, personal identification questions, contact details or account numbers. The Commonwealth Bank will never send you an email asking you to confirm, update or reveal your confidential banking information.
Important Information
Produced by Global Markets Research, a business unit of Commonwealth Bank of Australia ABN 48 123 123 124 - AFSL 234945 (Commonwealth Bank). This publication is based on information available at the time of publishing.  We believe that the information in this communication is correct and any opinions, conclusions or recommendations are reasonably held or made as at the time of its compilation, but no warranty is made as to accuracy, reliability or completeness.  To the extent permitted by law, neither Commonwealth Bank nor any of its subsidiaries accept liability to any person for loss or damage arising from the use of this communication. This communication does not purport to be a complete statement or summary.
The information provided has been prepared without considering your objectives, financial situation or needs, and before acting on the information, you should consider its appropriateness to your circumstances. No person should act on the basis of this report without considering and if necessary taking appropriate professional advice upon their own particular circumstances.
Commonwealth Bank of Australia, as a provider of investment, borrowing and other financial services undertakes financial transactions with many corporate entities in Australia. This may include any corporate issuer referred to in this communication. Commonwealth Bank and its subsidiaries have effected or may effect transactions for their own account in any investments or related investments referred to herein. In the case of certain securities Commonwealth Bank is or may be the only market maker.


************** IMPORTANT MESSAGE *****************************       
This e-mail message is intended only for the addressee(s) and contains information which may be
confidential. 
If you are not the intended recipient please advise the sender by return email, do not use or
disclose the contents, and delete the message and any attachments from your system. Unless
specifically indicated, this email does not constitute formal advice or commitment by the sender
or the Commonwealth Bank of Australia (ABN 48 123 123 124) or its subsidiaries. 
We can be contacted through our web site: commbank.com.au. 
If you no longer wish to receive commercial electronic messages from us, please reply to this
e-mail by typing Unsubscribe in the subject line. 
**************************************************************



	[[alternative HTML version deleted]]

