|
Dave Walton
2014-08-31 18:31:49
|
|
Hi QS,
I'm working on automation using the global script and the new interface to the simulator. One of the things I'm doing is creating new symbols that are copies with modification of existing symbols. and then run a backtest on the modified version.
Here is my procedure:
for (int i = 0; i < numtrials; i++)
{
HistoricalQuotes OriginalData = Quotes.GetHistoricalQuotes(SymbolName);
Symbols.AddSymbol(ModifiedSymbolName);
HistoricalQuotes ModifiedData = Quotes.GetHistoricalQuotes(ModifiedSymbolName);
<Code to modify OriginalData and store in ModifiedData >
Quotes.SaveHistoricalQuotes(ModifiedData);
Simulator.Backtest(<Trading System>);
}
The problem is that even though I apply different modifications to the data and it gets stored in the database properly, the backtest always gets run on stale data in memory.
How can I flush the data and force a reload from the database? I have verified that the expected data is in the quote database after this script.
Even if I run a manual backtest later, the stale quote data is still used.
Please help me understand what is going on so i can remedy this situation.
|
|
|
|
Dave Walton
2014-09-01 12:05:12
0
|
|
A little more information on this:
I worked around the issue above by setting: Account -> Application Settings -> Memory Management -> Load quotes in memory when performing simulations/backtesting -> Unchecked.
I don't really want to do this globally. I would prefer to be able to programmatically flush memory and force a quotes reload. is this possible? If not, could you consider adding that to a future release?
|
|
|
|
QuantShare
2014-09-01 14:38:49
0
|
|
Best Answer
We will add this as a new option in each trading system where you can instruct not to load data from memory at all.
Or find a way to remove data from memory each time a symbol's data is updated.
|
|
|
|
Dave Walton
2014-09-02 00:39:29
0
|
|
Thanks QS! Perhaps provide a function in the global script along the lines of Quotes.PurgeHistoricalQuotes(SymbolName)? Global script seems to be the only usage model for this functionality as far as I can see.
|
|
|
|
SystemTrade
2014-09-02 05:23:25
0
|
|
@QS:
just for your information, the same happens when changing accounts.
I use 2 accounts, one with historical yahoo data "frozen" at the the end of 2012 for backtesting purposes and another account with "current" historical data adjusted for splits & dividends for the same symbols.
When I change between these accounts, quotes data is retrieved from memory and not from the newly selected account database.
As a workaround I use to close and re-start QS after I changed accounts.
|
|
|
|
QuantShare
2014-09-03 06:28:34
0
|
|
This will be fixed. Thanks.
|
|
|
|