Click here to Login





                                                   Symbols stored in memory for backtesting/optimization

  0

0
Dave Walton
2015-04-24 09:42:16


Hi QS,

a while back I asked for a feature to programatically allow turning off the option to cache price data in memory so that data can be modified on the fly. It appears you made some change because now I'm able to modify data and affect the backtest. However, the option in "Application Settings"->"Memory Management"->"Load Quotes in Memory when Performing Simulations/Backtests" seems to not do anything anymore. It appears that no matter what I do, quotes are not cached in memory. What am I missing?
I notice that when I use and external Metastock database, my simulations run 2x faster for the same system/symbols than if I use the built-in database. It appears to me that the external database quotes are cached but the internal database quotes or not. My hypothesis is not just based on performance as the memory usage profile is much different also. Can you shed some light?



QuantShare
2015-04-25 03:47:06

  0

Hi Dave,

There were some changes to the cache logic but it is working as expected. When "Load Quotes in Memory" is checked, data are cached and when it is not, data are no longer cached. Memory usage is managed by .Net, so you don't know really when it is released and when it is not.

Regarding performance, built-in databases should be much faster. I have done some tests here and I can confirm that.

Note that caching applies when performing optimizations. Cache data is always released after the simulation ends.



Dave Walton
2015-04-25 14:47:31

  0

Hi QS, based on you response I did a little more digging. Here is the data. All of this data is from a 25 ETF trading system simulated from 1999 to present on EOD data. I subscribe to a data vendor and use the external Metastock database option as well as the built-in database with data downloaded from yahoo for dividend adjusted data. My downloaded data is stored into different symbol names ("_DIVADJ" is appended to the symbol name). Here is the data:

When "Download"->"External Database"->"Metastock database" is checked, along with "Application Settings"->"Memory Management"->"Load Quotes in Memory when Performing Simulations/Backtests" is checked these are the results:
* Metastock database symbols used: simulation time = 7 seconds
* Built-in database symbols used (dividend adjusted): simulation time = 6 seconds

When "Download"->"External Database"->"Metastock database" is UNchecked, along with "Application Settings"->"Memory Management"->"Load Quotes in Memory when Performing Simulations/Backtests" is checked these are the results:
* Built-in database symbols (also in Metastock database) used: simulation time = 10 seconds
* Built-in database symbols used (dividend adjusted): simulation time = 8 seconds

When "Download"->"External Database"->"Metastock database" is checked, along with "Application Settings"->"Memory Management"->"Load Quotes in Memory when Performing Simulations/Backtests" is UNchecked these are the results:
* Metastock database symbols used: simulation time = 12 seconds
* Built-in database symbols used (dividend adjusted): simulation time = 8 seconds

When "Download"->"External Database"->"Metastock database" is UNchecked, along with "Application Settings"->"Memory Management"->"Load Quotes in Memory when Performing Simulations/Backtests" is UNchecked these are the results:
* Built-in database symbols (also in Metastock database) used: simulation time = 13 seconds
* Built-in database symbols used (dividend adjusted): simulation time = 10 seconds

So why does the metastock database setting affect the performance when using the built-in database?



QuantShare
2015-04-27 03:51:29

  0

First of all, as said previously, "Load Quotes in Memory when Performing Simulations" has almost zero effect when doing a single simulation. This should apply only when performing optimizations.

You should do tests with much more symbols and several optimizations. The difference here is really small and could be explained by too many factors.




No more messages
0




Reply:

No html code. URLs turn into links automatically.

Type in the trading objects you want to include: - Add Objects
To add a trading object in your message, type in the object name, select it and then click on "Add Objects"










QuantShare

Trading Items
Financial fundamental data for US companies
Tweet Sentiment Index for the Forex and Stock Market
Extensive Fundamental Data for U.S. Stocks
US Stock symbols - CUSIP
Nasdaq OMX Baltic Market Symbols

How-to Lessons
How to quickly download the most recent EOD data for your stocks
How to get stocks for a particular index using the global script
How to screen for stocks having a high correlation with the Dow J...
How to download earnings calendar data for various stocks
How to get fundamental data for U.S. Stocks

Related Forum Threads
How to download data for selected symbols ?
Intraday Data for NSE Symbols
Obtain symbols for a particular index
Clear Symbol data stored in memory in global script
How to export historical data for a list of symbols

Blog Posts
Different Ticker Symbols for Each Data Source
Creating and managing notes for your stocks
How to download the history of dividend payments for stocks in th...
How to Download Trading Data for Certain Securities Only
How to Backtest Your Trading System for Each Industry









QuantShare
Product
QuantShare
Features
Create an account
Affiliate Program
Support
Contact Us
Trading Forum
How-to Lessons
Manual
Company
About Us
Privacy
Terms of Use

Copyright © 2024 QuantShare.com
Social Media
Follow us on Facebook
Twitter Follow us on Twitter
Google+
Follow us on Google+
RSS Trading Items



Trading financial instruments, including foreign exchange on margin, carries a high level of risk and is not suitable for all investors. The high degree of leverage can work against you as well as for you. Before deciding to invest in financial instruments or foreign exchange you should carefully consider your investment objectives, level of experience, and risk appetite. The possibility exists that you could sustain a loss of some or all of your initial investment and therefore you should not invest money that you cannot afford to lose. You should be aware of all the risks associated with trading and seek advice from an independent financial advisor if you have any doubts.