SmartQuant Discussion
http://www.smartquant.com/forums/

Adding bar data to instrument
http://www.smartquant.com/forums/viewtopic.php?f=59&t=14584
Page 1 of 1

Author:  haroldmaj [ Mon Jun 27, 2016 10:58 pm ]
Post subject:  Adding bar data to instrument

Hello, I have created an instrument containing daily bar data. I wish to add intraday (1-min) data into the instrument.

I have found another answer, and would like to know how to apply this code. Specifically in the second line, are these the values you are inputting or the argument names?

Code:
Instrument instrument = InstrumentManager.Instruments["MSFT"];

Bar bar = new Bar(openDateTime. closeDateTime, instrument.Id, BarType.Time, 300, o, h, l, c, v);

DataManager.Save(bar);

Author:  Dr. Anton Fokin [ Tue Jun 28, 2016 11:22 am ]
Post subject:  Re: Adding bar data to instrument

Hi,

indeed these are values and these are names of variable in your example I guess.

double o = 10;
double h = 20;
...

Bar bar = new Bar(openDateTime. closeDateTime, instrument.Id, BarType.Time, 300, o, h, l, c, v);

BarType.Time is bar type enumerator

openDateTime closeDateTime are variables of .NET/c# DateTime type.

300 is the size of your bar.

Regards,
Anton

Page 1 of 1 All times are UTC + 3 hours
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/