I'm building the Trading System.
Sorry for the trivial question, what is the best way to know on quote
the daily and hourly open. And open price of specific hour?
public override void OnQuote()
Instrument inst = Instruments.GetInstrument("EUR/USD");
double dailyOpen = 0;
double hourlyOpen = 0;
BarData dailyBars = GetHistoricalData(new HistoricalDataRequest(inst, Period.Day)) as BarData;
BarData hourlyBars = GetHistoricalData(new HistoricalDataRequest(inst, Period.Hour)) as BarData;
if (dailyBars != null)
dailyOpen = dailyBars.Open();
if (hourlyBars != null)
hourlyOpen = hourlyBars.Open();
There the dailyOpen = dailyBars.Open(); is giving error:
A first chance exception of type 'System.IndexOutOfRangeException' occurred in "TEST2", Line 54:
Cannot get the value from the empty data
Can anyone help with such problem?