|
august mezzetta
2011-07-20 20:30:23
|
|
I'm an expeienced trader but illiterate programmer. I asked support how to get a current quote on the E-mini S&P 500 Sep 2011 contract symbol /ESU!.
I cint seconds = 10;
while(true)
{
Chart[] charts = Charts.GetAllCharts();
for(int i=0;i < charts.Length;i++)
{
if(!charts[i].IsHistorical)
{
GetNewData(charts[i]);
}
}
App.Main.Sleep(1000 * seconds); // Do not change this - It may crash your PC if you change it
}
#functions#
void GetNewData(Chart chart)
{
if(chart == null)
{
return;
}
string[] symbols = new string[1];
symbols[0] = chart.SymbolName;
Downloader.DownloadData("", "Intraday Data for Futures Contracts", true, symbols, null, DownloadComplete, chart);
}
void DownloadComplete(Object obj)
{
Chart chart = (Chart)obj;
if(chart != null)
{
//MessageBox.Show("Chart to be updated: " + chart.SymbolName);
chart.Update();
}
}
I was told there are erors on line 12 and line 36. Can someone help me? Thank you. August
|
|