VPS - check if my robot is running

Created at 17 Sep 2013, 09:11
How’s your experience with the cTrader Platform?
Your feedback is crucial to cTrader's development. Please take a few seconds to share your opinion and help us improve your trading experience. Thanks!
Cerunnos's avatar

Cerunnos

Joined 27.06.2013

VPS - check if my robot is running
17 Sep 2013, 09:11


Hi, I'm using a VPS and would like to send an e-mail with Notifications.SendEmail () every half hour to check if my robot running properly. How can I do that? Unfortunately, one cannot launch cAlgo automatically with a specific robot ...

Thanks in advance! Rainer


@Cerunnos
Replies

atrader
17 Sep 2013, 11:20

RE:

Cerunnos said:

Hi, I'm using a VPS and would like to send an e-mail with Notifications.SendEmail () every half hour to check if my robot running properly. How can I do that? Unfortunately, one cannot launch cAlgo automatically with a specific robot ...

Thanks in advance! Rainer

use the Timer Class  /forum/cbot-support/357#4 

Send email: /api/internals/inotifications/sendemail-6532
start cAlgo from a robot: System.Diagnostics.Process.Start("[System.Diagnostics.Process.Start("C:\\...\\cAlgo.exe]");  

/forum/suggestions/1221?page=1#6

 

You can just use search. most questions have been answered :) 


@atrader

Cerunnos
17 Sep 2013, 12:11

Sorry atrader, the article "orders every hour" I've overlooked. Thanks for the support


@Cerunnos

Cerunnos
21 Sep 2013, 11:40

Based on the article /forum/cbot-support/357#4, a simple solution that checks every hour if your robot on the VPS is running properly. Do you get no e-mail, then the robot should be stopped...

 

        private readonly Timer _timer = new Timer(); 
        
        protected override void OnStart()
        {              
             _timer.Elapsed += OnTimedEvent; 
             _timer.Interval = 1  * 3600 * 1000; // Timer will tick every Interval (milliseconds) -> every hour send email
             _timer.Enabled = true
             _timer.Start(); 
        }
        
         private void OnTimedEvent(object sender, ElapsedEventArgs e)        
        { 
        string time_ = "Timer - Robot XY is running - UTC: " + Server.Time;
        Notifications.SendEmail(your_email@domain.com,"your_email@domain.com","Timer - Robot XY is running!",time_);
        }

 


@Cerunnos