SmartQuant Discussion

Automated Quantitative Strategy Development, SmartQuant Product Discussion and Technical Support Forums
It is currently Wed Sep 23, 2020 12:46 pm

All times are UTC + 3 hours




Post new topic Reply to topic  [ 4 posts ] 
Author Message
PostPosted: Wed Nov 20, 2013 10:47 am 
Offline

Joined: Mon Nov 12, 2012 2:38 am
Posts: 59
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);
}
}
}


Top
 Profile  
 
PostPosted: Wed Nov 20, 2013 3:02 pm 
Offline
Site Admin

Joined: Thu Jul 17, 2003 10:39 am
Posts: 1478
Hi,

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

_________________
SmartQuant Development Team


Top
 Profile  
 
PostPosted: Fri Nov 22, 2013 9:26 am 
Offline

Joined: Mon Nov 12, 2012 2:38 am
Posts: 59
You are right, Thanks!
Here is another question, Is it possible to start data-capture by Script? How?


Top
 Profile  
 
PostPosted: Fri Nov 22, 2013 10:36 am 
Offline
Site Admin

Joined: Thu Jul 17, 2003 10:39 am
Posts: 1478
Unfortunately, no.

_________________
SmartQuant Development Team


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC + 3 hours


Who is online

Users browsing this forum: No registered users and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group