Server Bar Time is skipping?

Created at 25 Nov 2012, 22:04
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!
lec0456's avatar

lec0456

Joined 14.11.2012

Server Bar Time is skipping?
25 Nov 2012, 22:04


Hi, I wrote a small robot to check descrepancies I noticed with the timing of the onBar event.  it seems to be skipping bars.  It also shows up on the chart.  Here is the program I used and some screen shots to explain what I mean,  do you have any explainations?

 

using System;
using cAlgo.API;
using cAlgo.API.Indicators;
using cAlgo.Indicators;

namespace cAlgo.Robots
{
    [Robot]
    public class TestTime : Robot
    {     
        
        private int Count=0;
  
        protected override void OnStart()
        {
            Print(Server.Time.ToString("MM/dd/yyyy HH:mm")+" *******************************************************************Start************************************************************************");    
        }
        
        protected override void OnBar()
        {        
            if (Count!=250)
            {                    
                Print(Server.Time.ToString("MM/dd/yyyy HH:mm")+" **********************************************************************Bar************************************************************************");
                Count++;
            }
            if (Count==250)
            {
                Stop();
            }
        }    
        
    }//** End of class **********
}//** End of namespace **********


@lec0456
Replies

herp
26 Nov 2012, 10:15

Hi there,

What seems to be the symbol/currency you're using for this?


@herp

admin
26 Nov 2012, 12:11

The reason is that there is no price movement during that time and therefore no trendbars are generated. If there is no trendbar the OnBar event will not be triggered.

 


@admin

lec0456
27 Nov 2012, 00:10

RE:
admin said:

The reason is that there is no price movement during that time and therefore no trendbars are generated. If there is no trendbar the OnBar event will not be triggered.

 

I was using EUR/USD.  but ok I get it.

@lec0456