MarketData.GetTicks(SymbolName) takes more than 10 minutes to initialize

Created at 02 Jul 2020, 15:59
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!
SH

Shares4us

Joined 01.04.2020

MarketData.GetTicks(SymbolName) takes more than 10 minutes to initialize
02 Jul 2020, 15:59


It's probably not a bug but it certainly feels that way!

in the initialize function of an indicator:

Print("{0} Start Loading data.",this.ToString() );
SymbolTicks = MarketData.GetTicks(SymbolName);
Print("{0} End Loading data. ticks={1} Lowest={2}", this.ToString(), SymbolTicks.Count, SymbolTicks[0].Time);

result:
 


Finally finished 11 Minutes later!!!!!!

it loaded tons of data i don't need! at a speed of 0.1 MBPS on a 65MBPS connection!


Question
Am i doing something wrong?

Or otherwise suggestion:
- can you fix the download speed?
- Please adapt the GetTicks() to include a parameter for MaxTimespan back,or MaxTicks or EarliestDateTime.
- or both.


@Shares4us
Replies

PanagiotisCharalampous
02 Jul 2020, 16:13

Hi ctid956028,

To check this we will need the complete indicator code and the indicator parameters. Can you please provide them to us?

Best Regards,

Panagiotis 

Join us on Telegram

 


@PanagiotisCharalampous

Shares4us
02 Jul 2020, 16:54 ( Updated at: 21 Dec 2023, 09:22 )

RE:

i've restarted cTrader and now it loads just up unto 10:31 AM on the 2nd of juli 2020

at OK speed.

then when i execute it the 4th time I see that it is loading extra data


and if i employ loadmorehistory it's taken ages again

Other test
Add new instance/new Pair:

then Add new instance Same Pair:


Now it becomes clear!
there is a possible Bug.
   GetTicks loads previous loaded data in the same cTrader instance + x ticks back.
   and everytime you alter a parameter (indicator refresh) it loads more data!!
So if you do a lot of Param changes or restarts it's getting bigger and bigger and bigger and .....

That cries for parameterized GetTicks and LoadMoreHistory

used test indicator:

 

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

namespace cAlgo
{
    [Indicator(IsOverlay = true, TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)]
    public class TestIndicator : Indicator
    {
        ///////////////////////////////////////
        // Test
        ///////////////////////////////////////
        // Changed 1.0 : 
        //  02-07-2020 initial setup 
        ///////////////////////////////////////
        //
        #region class Globals
        private readonly string Version = "1.0";
        Ticks SymbolTicks;// Symbol SymbolPrices;

        int IndexSkip = 0;
        int  LastIndexSearched;        
        #endregion class Globals

        [Parameter(DefaultValue = 0.0)]
        public double Parameter { get; set; }

        #region Events
        protected override void Initialize()
        {
            LastIndexSearched = -1;
            Print(this.ToString() + ":" + Version);          
        
            Print("\n{0} Start Loading data.",this.ToString() );
            SymbolTicks = MarketData.GetTicks(SymbolName);
            Print("\n{0} End GetTicks data. ticks={1} Lowest={2}", this.ToString(), SymbolTicks.Count, SymbolTicks[0].Time);
            SymbolTicks = MarketData.GetTicks(SymbolName);
            Print("\n{0} End1 GetTicks data. ticks={1} Lowest={2}", this.ToString(), SymbolTicks.Count, SymbolTicks[0].Time);
            SymbolTicks = MarketData.GetTicks(SymbolName);
            Print("\n{0} End2 GetTicks data. ticks={1} Lowest={2}", this.ToString(), SymbolTicks.Count, SymbolTicks[0].Time);
            SymbolTicks = MarketData.GetTicks(SymbolName);
            Print("\n{0} End3 GetTicks data. ticks={1} Lowest={2}", this.ToString(), SymbolTicks.Count, SymbolTicks[0].Time);
            
        }
        public override void Calculate(int index)
        {
        }
      }
   }
}

 


@Shares4us

Shares4us
02 Jul 2020, 16:54

RE:

obsolete (delete function would be nice ;-) )


@Shares4us

Shares4us
02 Jul 2020, 16:54

RE:

obsolete (delete function would be nice ;-) )


@Shares4us

PanagiotisCharalampous
02 Jul 2020, 16:58

Hi ctid956028,

Did you read my post above?

Best Regards,

Panagiotis 

Join us on Telegram


@PanagiotisCharalampous

Shares4us
02 Jul 2020, 17:04

RE:

Yep but i pressed ok to soon an altered the response to include the code but somehow that didn't work i see. I'll do it again.

 

 


@Shares4us

PanagiotisCharalampous
03 Jul 2020, 08:54 ( Updated at: 21 Dec 2023, 09:22 )

Hi ctid956028,

Unfortunately I could not reproduce this behavior. This is what I get no matter how many instances I add or how many times I refresh my chart.

If you can record a short video demonstrating the steps you take and the issue it might help us reproducing the problem.

Best Regards,

Panagiotis 

Join us on Telegram

 


@PanagiotisCharalampous