長崎良美

How to backtest with my own non-market datasets?

Programming


I looked at this article about backtesting with custom datasets, which shows how to import external market data files into the platform. However, I have a file that's not market candle data. How can I get that imported into the system?
 
Shum
As suggested in the previous post, you can just map col_close to the value column. Then you can get the data as if a normal market data stream. 
For example if we set the time series name to XXX, then we can filter this time series as follows

    def on_marketdatafeed(self, md, ab):
        if md.instrument=="XXX
            val = md.lastPrice