SmartQuant Discussion

Automated Quantitative Strategy Development, SmartQuant Product Discussion and Technical Support Forums
It is currently Fri Dec 13, 2019 4:26 am

All times are UTC + 3 hours




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

Joined: Mon Aug 05, 2019 7:11 pm
Posts: 15
I have a csv file that contain historical data like:
Code:
Time,Open,High,Low,Close,Volume,Order
20180102084500,10629,10636,10621,10636,1956,768
20180102084600,10635,10643,10634,10642,1305,578
20180102084700,10642,10643,10638,10639,409,224
.
.
.


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

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

         strategy.AddInstrument(instrument1);
         strategy.AddInstrument(instrument2);

         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);


Thanks!


Top
 Profile  
 
PostPosted: Fri Sep 27, 2019 3:51 pm 
Offline

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 )


Top
 Profile  
 
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 2 guests


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:  
cron
Powered by phpBB® Forum Software © phpBB Group