Hi,
I having some precision problems when requesting for CBOT Bond daily data. Only the first bar is the correct precision, and all the other bars are wrongly truncated to 4 decimal places.
Does anybody know how to fix this? Thanks.
esignal.get_RequestHistory("TY H6", "D", IESignal.barType.btBARS, 5, -1, -1);
This is my program output for TY H6 close
***********************************
0: 12/6/2005: 108.046875
-1: 12/5/2005: 108.0469
-2: 12/2/2005: 108.3438
-3: 12/1/2005: 108.3438
-4: 11/30/2005: 108.5313
-5: 11/29/2005: 108.6875
Full C# source code
[Sorry about indentation. Code also attached.]
****************************
using System;
using System.Threading;
namespace BondTest
{
class Class1
{
static IESignal.HooksClass esignal;
static AutoResetEvent myResetEvent = new AutoResetEvent(false);
[STAThread]
static void Main(string[] args)
{
esignal = new IESignal.HooksClass();
esignal.OnBarsReceived += new IESignal._IHooksEvents_OnBarsReceivedEventHandler( esignal_OnBarsReceived);
esignal.SetApplication("API_WS");
if (esignal.IsEntitled == 0)
{
Console.WriteLine("Not entitled. Check if eSignal is logged-in.");
return;
}
esignal.ReleaseAllHistory();
esignal.ReleaseAllTimeSales();
esignal.get_RequestHistory("TY H6", "D", IESignal.barType.btBARS, 5, -1, -1);
myResetEvent.WaitOne();
return;
}
static void esignal_OnBarsReceived(int lHandle)
{
int numbars = esignal.get_GetNumBars(lHandle);
IESignal.BarData bd;
for( int i = 0 ; i>=-(numbars -1); i--)
{
bd = esignal.get_GetBar(lHandle, i);
Console.WriteLine( i.ToString() + ": " + bd.dtTime.ToShortDateString() + ": " + bd.dClose.ToString());
}
myResetEvent.Set();
}
}
}
I having some precision problems when requesting for CBOT Bond daily data. Only the first bar is the correct precision, and all the other bars are wrongly truncated to 4 decimal places.
Does anybody know how to fix this? Thanks.
esignal.get_RequestHistory("TY H6", "D", IESignal.barType.btBARS, 5, -1, -1);
This is my program output for TY H6 close
***********************************
0: 12/6/2005: 108.046875
-1: 12/5/2005: 108.0469
-2: 12/2/2005: 108.3438
-3: 12/1/2005: 108.3438
-4: 11/30/2005: 108.5313
-5: 11/29/2005: 108.6875
Full C# source code
[Sorry about indentation. Code also attached.]
****************************
using System;
using System.Threading;
namespace BondTest
{
class Class1
{
static IESignal.HooksClass esignal;
static AutoResetEvent myResetEvent = new AutoResetEvent(false);
[STAThread]
static void Main(string[] args)
{
esignal = new IESignal.HooksClass();
esignal.OnBarsReceived += new IESignal._IHooksEvents_OnBarsReceivedEventHandler( esignal_OnBarsReceived);
esignal.SetApplication("API_WS");
if (esignal.IsEntitled == 0)
{
Console.WriteLine("Not entitled. Check if eSignal is logged-in.");
return;
}
esignal.ReleaseAllHistory();
esignal.ReleaseAllTimeSales();
esignal.get_RequestHistory("TY H6", "D", IESignal.barType.btBARS, 5, -1, -1);
myResetEvent.WaitOne();
return;
}
static void esignal_OnBarsReceived(int lHandle)
{
int numbars = esignal.get_GetNumBars(lHandle);
IESignal.BarData bd;
for( int i = 0 ; i>=-(numbars -1); i--)
{
bd = esignal.get_GetBar(lHandle, i);
Console.WriteLine( i.ToString() + ": " + bd.dtTime.ToShortDateString() + ": " + bd.dClose.ToString());
}
myResetEvent.Set();
}
}
}
Comment