Replies

eofe
30 Apr 2020, 13:42

RE:

eofe said:

Hi,

1) Run this code to reproduce bug.

        protected override void OnTick()
        {
            Print(Account.Currency);
        }

2) Disconnect ctrader and reconnect it.

3) You will observe account currency is now null.

 

Is there a workaround you can suggest please before the bug is rectified?

Strangely this problem does not affect demo account. It affects Live accounts.

cTrader support did you manage to replicate this bug?


@eofe

eofe
21 Feb 2020, 12:21

RE:

srubtsov said:

Use the exact time to get today's bar is not so good way, because a bar can be not created yet, bar creates exactly after the first tick in the bar. So the best way here to use BarOpened event.

protected override void OnStart()
{
    Bars eurgbpDailyBars = MarketData.GetBars(TimeFrame.Daily, "EURGBP");
    eurgbpDailyBars.BarOpened += OnEurgbpDailyBarOpened;
}

private void OnEurgbpDailyBarOpened(BarOpenedEventArgs args)
{
    Print("HighPrices.Last(1): " + args.Bars.HighPrices.Last(1));
}

 

 

Will explore your suggestion, thank you.


@eofe

eofe
21 Feb 2020, 11:35

After further testing, I realised the problem was usually caused during the first multi symbol variable initiation. I updated the code to initialise bars in onstart instead of onbar and it seems to fix the problem. Will monitor next week.

Is there a difference in how ctrader initialise bars vs marketseries? Maybe one is Async while the other one is not?

Or maybe the proxy lag from 2ms to 80ms could have caused it.


@eofe

eofe
06 Dec 2019, 09:34

RE:

PanagiotisCharalampous said:

Hi eofe,

Christmas was the target for the Beta :) We cannot give an ETA for release to brokers, it depends on how the Beta testing will go. We will release to brokers as soon as we are confident that 3.7 is stable enough for production environments.

Best Regards,

Panagiotis


Noted Panagiotis. Please don’t make the cTrader fans wait too long!


@eofe

eofe
06 Dec 2019, 09:20

RE:

PanagiotisCharalampous said:

Hi eofe,

The bar's open time is taken from the first new tick that will arrive for that bar. This is why you get different opening times.

Regarding sample, I am not sure what do you need exactly but below you can see a very simple example of listening to the BarOpened event

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 BarOpenedExample : Robot
    {
        protected override void OnStart()
        {
            var bars = MarketData.GetBars(TimeFrame.Minute, "GBPUSD");
            bars.BarOpened += Bars_BarOpened;
        }

        private void Bars_BarOpened(BarOpenedEventArgs obj)
        {
            Print("New bar created for " + obj.Bars.SymbolName + " at " + obj.Bars.Last(0).OpenTime);
        }
    }
}

Best Regards,

Panagiotis 

Join us on Telegram

 


that will do fine, Panagiotis. Many thanks.

can we expect 3.7 to be pushed out to brokers by Xmas as you have mentioned in your earlier posts?


@eofe

eofe
14 Nov 2019, 09:22

Thanks for your quick answer Panagiotis.

Could you give me some pointers as to how would you structure the code so readmytrades() will work as intended please?


@eofe

eofe
01 Jul 2019, 15:18

Thanks again for your answer Paul. I have tried the quick and dirty way using file system but I wanted to explore if it can be done in a faster and more effcient manner via the system ram level. Will check out the publish and subscribe method you shared.


@eofe

eofe
27 Jun 2019, 10:32

Great tool Paul! Will try it.

I still wonder why ctrader is slowly removing all the bid ask spread numbers from mobile watchlist and now symbol watch. There is no reason to remove this basic feature of ctrader unless brokers don’t want us to compare spreads?


@eofe

eofe
25 Jun 2019, 21:25

Thanks for the explanation Paul. I will go test it out.


@eofe

eofe
19 Jun 2019, 18:18

The page you shared is very helpful. Thanks.


@eofe