Search/ Go To Date Function

Created at 10 Apr 2021, 15:51
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!
BS

bsicm0001

Joined 19.03.2020

Search/ Go To Date Function
10 Apr 2021, 15:51


Dear Sirs:

Would you consider creating a function to search/ go to
a prior date for a financial asset.

The search function should include all/ most of the time frames.

With thanks,

Ben


cTrader
@bsicm0001
Replies

PanagiotisCharalampous
12 Apr 2021, 08:38

Hi Ben,

Have a look at the cBot below. It should be helpful

using System;
using System.Linq;
using cAlgo.API;
using cAlgo.API.Indicators;
using cAlgo.API.Internals;
using cAlgo.Indicators;

namespace cAlgo.Robots
{
    [Robot(TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)]
    public class ScrollTo : Robot
    {
        [Parameter(DefaultValue = 2014)]
        public int Year { get; set; }

        [Parameter(DefaultValue = 1)]
        public int Month { get; set; }

        [Parameter(DefaultValue = 1)]
        public int Day { get; set; }

        protected override void OnStart()
        {
            var date = new DateTime(Year, Month, Day);

            while (Bars.OpenTimes[0] > date)
                Bars.LoadMoreHistory();
            Chart.ScrollXTo(date);
        }

        protected override void OnTick()
        {
            // Put your core logic here
        }

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

Best Regards,

Panagiotis 

Join us on Telegram


@PanagiotisCharalampous

bsicm0001
14 Apr 2021, 23:25 ( Updated at: 21 Dec 2023, 09:22 )

Search/ Go To Date Function

Dear Sirs:

Thank you for the response, however
I think my message was understood --

tradingview.com has a 'Go To' date search area.

It is far easier than to PgUp several times to get 
a a desired day.

With thanks,

Ben

 


@bsicm0001

guspiccinini
24 May 2021, 14:12

RE:

If you would like a 'go to date' function, vote the following newer suggestion:

 


@guspiccinini