SmartQuant Discussion

Automated Quantitative Strategy Development, SmartQuant Product Discussion and Technical Support Forums
It is currently Fri Sep 30, 2022 10:58 pm

All times are UTC + 3 hours

Post new topic Reply to topic  [ 2 posts ] 
Author Message
PostPosted: Wed Sep 25, 2019 8:40 am 

Joined: Mon Aug 05, 2019 7:11 pm
Posts: 15
I have a csv file that contain historical data like:

How can I import this file into OpenQuant like the sample code:
         Instrument instrument1 = InstrumentManager.Instruments["AAPL"];
         Instrument instrument2 = InstrumentManager.Instruments["MSFT"];

         strategy = new MyStrategy(framework, "BollingerBands");


         DataSimulator.DateTime1 = new DateTime(2013, 01, 01);
         DataSimulator.DateTime2 = new DateTime(2013, 12, 31);

         BarFactory.Add(instrument1, BarType.Time, barSize);
         BarFactory.Add(instrument2, BarType.Time, barSize);


PostPosted: Fri Sep 27, 2019 3:51 pm 

Joined: Wed Aug 07, 2019 7:49 am
Posts: 20
Check out:
DataSimulator.Series Property
public List<IDataSeries> Series { get; set; }
This is where the DataSimulator stores/gets its data from in backtest.

You can make your own DataSeries like so:

DataSeries barsFromCsv = new DataSeries();
barsFromCsv.Add(new Bar(.....))
barsFromCsv.Add(new Bar(.....))
barsFromCsv.Add(new Bar(.....))

Then add them to the DataSimulator and run:

DataSimulator.Series.Add(barsFromCsv )

Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC + 3 hours

Who is online

Users browsing this forum: No registered users and 1 guest

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group