Roll Over Error

Created at 21 Oct 2019, 17:57
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!
KE

Ketu

Joined 09.10.2018

Roll Over Error
21 Oct 2019, 17:57


On every weekend rollover my cbot stops working correctly, I get the same hour print message on every bar after the weekend and sometimes the daily rollover.

This is the code:

Print("onbar " + MarketSeries.OpenTime.LastValue.ToShortTimeString());

The first line is the incorrect time, and it prints that same time for every bar and the rest of the code doesn't execute.

20/10/2019 22:00:03.349 |  XTIUSD, h1 | onbar 8:00 PM
18/10/2019 20:00:00.698 |  XBRUSD, h1 | onbar 8:00 PM
18/10/2019 20:00:00.355 |  XTIUSD, h1 | onbar 8:00 PM
18/10/2019 19:00:20.979 |  XBRUSD, h1 | onbar 7:00 PM
18/10/2019 19:00:00.713 |  XTIUSD, h1 | onbar 7:00 PM
18/10/2019 18:00:00.785 |  XTIUSD, h1 | onbar 6:00 PM
18/10/2019 18:00:00.567 |  XBRUSD, h1 | onbar 6:00 PM
18/10/2019 17:00:00.689 |  XBRUSD, h1 | onbar 5:00 PM
18/10/2019 17:00:00.501 |  XTIUSD, h1 | onbar 5:00 PM

I am using cTrader demo currently


@Ketu
Replies

PanagiotisCharalampous
22 Oct 2019, 08:43

Hi Rob,

Can you please post the complete cBot code so that we can run it and reproduce the problem?

Best Regards,

Panagiotis


@PanagiotisCharalampous

Ketu
22 Oct 2019, 10:51

RE:

Panagiotis Charalampous said:

Hi Rob,

Can you please post the complete cBot code so that we can run it and reproduce the problem?

Best Regards,

Panagiotis

It should recreate the problem with just that line, I can't share the rest of the code. I will run that line just before the weekend and see if it gives the same result.


@Ketu

PanagiotisCharalampous
22 Oct 2019, 10:57

Hi Rob,

If you cannot share your cBot maybe you can share a dummy cBot that reproduces the problem. 

Best Regards,

Panagiotis


@PanagiotisCharalampous

Ketu
28 Oct 2019, 10:29

RE:

Panagiotis Charalampous said:

Hi Rob,

If you cannot share your cBot maybe you can share a dummy cBot that reproduces the problem. 

Best Regards,

Panagiotis

28/10/2019 08:00:03.366 | New cBot, XBRUSD, h1 | onbar New cBot 8:00 AM
28/10/2019 07:00:02.562 | New cBot, XBRUSD, h1 | onbar New cBot 7:00 AM
28/10/2019 06:00:05.235 | New cBot, XBRUSD, h1 | onbar New cBot 6:00 AM
28/10/2019 05:00:00.355 | New cBot, XBRUSD, h1 | onbar New cBot 8:00 PM
28/10/2019 04:00:24.530 | New cBot, XBRUSD, h1 | onbar New cBot 8:00 PM
28/10/2019 03:00:02.802 | New cBot, XBRUSD, h1 | onbar New cBot 8:00 PM
28/10/2019 02:00:00.209 | New cBot, XBRUSD, h1 | onbar New cBot 8:00 PM
28/10/2019 01:00:04.786 | New cBot, XBRUSD, h1 | onbar New cBot 8:00 PM
25/10/2019 20:00:01.066 | New cBot, XBRUSD, h1 | onbar New cBot 8:00 PM
25/10/2019 19:00:01.069 | New cBot, XBRUSD, h1 | onbar New cBot 7:00 PM
25/10/2019 18:00:01.165 | New cBot, XBRUSD, h1 | onbar New cBot 6:00 PM

{
    [Robot(TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)]
    public class NewcBot : Robot
    {
        [Parameter(DefaultValue = 0.0)]
        public double Parameter { get; set; }

        protected override void OnStart()
        {
            // Put your initialization logic here
            Print("start " + MarketSeries.OpenTime.LastValue.ToShortTimeString());
        }

        protected override void OnBar()
        {
            // Put your core logic here
            Print("onbar New cBot " + MarketSeries.OpenTime.LastValue.ToShortTimeString());
        }

        protected override void OnStop()
        {
            // Put your deinitialization logic here
        }
    }
}


@Ketu