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

Connect to Provider using Script in QuantBase
http://www.smartquant.com/forums/viewtopic.php?f=60&t=10641
Page 1 of 1

Author:  gzadigo [ Wed Nov 20, 2013 10:47 am ]
Post subject:  Connect to Provider using Script in QuantBase

The following script can connect to the provider automatically in QuantRouter.
But is does not work in QuantBase, while manually connecting can be successful.
Can anyone tell why? Thanks!

using System;

using OpenQuant.API;

public class HelloWorld : Script
{
int dt;
public override void Run()
{
MarketDataProvider provider = (MarketDataProvider)ProviderManager.Providers["XXXXX"];
while(true)
{
dt = Clock.Now.Hour * 100 + Clock.Now.Minute;
if(provider.IsConnected)
{
if((dt < 830)||(dt > 1529))
{
provider.Disconnect();
Console.WriteLine("{0}--disconnected!", Clock.Now);
}
}
else
{
if((dt > 829)&&(dt < 1520))
{
provider.Connect();
Console.WriteLine("{0}--connected!", Clock.Now);
}
}
System.Threading.Thread.Sleep(10000);
}
}
}

Author:  Alexei Kurov [ Wed Nov 20, 2013 3:02 pm ]
Post subject:  Re: Connect to Provider using Script in QuantBase

Hi,

It seems that you are using old version of QuantBase.
Your script works fine in the latest version.

Author:  gzadigo [ Fri Nov 22, 2013 9:26 am ]
Post subject:  Re: Connect to Provider using Script in QuantBase

You are right, Thanks!
Here is another question, Is it possible to start data-capture by Script? How?

Author:  Alexei Kurov [ Fri Nov 22, 2013 10:36 am ]
Post subject:  Re: Connect to Provider using Script in QuantBase

Unfortunately, no.

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