SmartQuant Discussion

Automated Quantitative Strategy Development, SmartQuant Product Discussion and Technical Support Forums
It is currently Sun Aug 18, 2019 6:45 pm

All times are UTC + 3 hours




Post new topic Reply to topic  [ 5 posts ] 
Author Message
PostPosted: Tue Oct 01, 2013 3:08 pm 
Offline

Joined: Sat Feb 02, 2013 7:44 am
Posts: 18
Location: Islamabad
Hello Support,

We are looking to achieve the following functionality:

Our QuantBase installation is collecting 1 minute data. What we need to do is Compress the bars to another (odd) time-frame at the end of each day so that we can use the compressed bars for testing etc. We need to automate this process and it should run at lets suppose 06:30 PM each day.

What we have tried:

We have a small script (also available on the forum) that converts/compresses the bars into our required time-frame. Now we need to schedule it to run at a specific time each day. What we have not been able to do is find a way to automate it inside OpenQuant. We also tried developing an external C# application that can then be used as a scheduled application in windows to run at our specified time. But, when we replicated the script in the external application with all the necessary references to OpenQuant assemblies provided, we get the popup at the start of the application:

Image

We have tried other ways to make this work as well (putting the executables in the OpenQuant base directory etc) but they all lead us no where.

We need to understand how to run a script at a specific time each day (if possible)? Or if that is not possible, how can we replicate it in an external application so that we can put it in the windows scheduling to run at a specific time of the day each day.

Hoping to hear from you soon.

Thanks
Umer


Top
 Profile  
 
PostPosted: Tue Oct 01, 2013 4:14 pm 
Offline
Site Admin

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

You can run the script and leave it running.
It will check specified time and execute the task.
for example
Code:
   DateTime nextRun = DateTime.Today.AddHours(18).AddMinutes(30);

   while (true)
   {
      if (DateTime.Now >= nextRun)
      {
           nextRun = nextRun.AddDays(1);

           //  do some tasks
      }
      else
         System.Threading.Thread.Sleep(1000);
    }

_________________
SmartQuant Development Team


Top
 Profile  
 
PostPosted: Wed Oct 02, 2013 2:57 pm 
Offline

Joined: Sat Feb 02, 2013 7:44 am
Posts: 18
Location: Islamabad
Hello Alexei,

Thank you for your response. We had tried this but wanted to know if there was another more elegant solution for this.

We will go with this for now and let you know if we need anything else.

Regards
Umer


Top
 Profile  
 
PostPosted: Wed Oct 02, 2013 3:10 pm 
Offline
Site Admin

Joined: Thu Jul 17, 2003 10:39 am
Posts: 1478
umer.master wrote:
We had tried this but wanted to know if there was another more elegant solution for this.

No.
OpenQuant has no built-in scheduler.

_________________
SmartQuant Development Team


Top
 Profile  
 
PostPosted: Fri Oct 04, 2013 9:48 am 
Offline

Joined: Sat Feb 02, 2013 7:44 am
Posts: 18
Location: Islamabad
Thank you Alexei. Much appreciated.

We are going with the forever loop way for now with a bigger sleep time and it isnt taking much resources. So its fine.

Regards
Umer


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

All times are UTC + 3 hours


Who is online

Users browsing this forum: No registered users and 2 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