Tick timeframes not part of TimeFrame Class

Created at 04 Jul 2020, 20:14
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!
PR

prosteel1

Joined 04.07.2018

Tick timeframes not part of TimeFrame Class
04 Jul 2020, 20:14


Hi,

   I am trying to specify tick timeframes in a cbot, however it looks like the TimeFrame Class has not been updated to include Ticks.

In order to change tick timeframes in code I need to set parameters manually and use a reference to those parameters.

Am I missing something?

When I try to set the chart timeframe to Tick10 it defaults to Hour as well but can set it manually in the parameters.

    [Robot(TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)]
    public class NewcBot11 : Robot
    {
        [Parameter("Timeframe0", DefaultValue = "Tick10")]
        public TimeFrame tf0 { get; set; }
        [Parameter("Timeframe1", DefaultValue = "Minute")]
        public TimeFrame tf1 { get; set; }

        TimeFrame[] Frames = new TimeFrame[2];

        protected override void OnStart()
        {
            Frames[0] = tf0;
            Frames[1] = tf1;
            Print(Frames[0] + ", " + Frames[1]);
        }

// Result: Hour, Minute
// Result after manually changing Timeframe0 to Tick10 through the dropdown in Parameter window: Tick10, Minute

 


@prosteel1
Replies

PanagiotisCharalampous
06 Jul 2020, 09:16

Hi prosteel1,

You are not missing anything, this is the case at the moment. The missing members of the Timeframe class will be added in a future update of the API.

Best Regards,

Panagiotis 

Join us on Telegram

 


@PanagiotisCharalampous