Replies

Intetics
17 Jan 2024, 11:59 ( Updated at: 18 Jan 2024, 14:11 )

RE: RE: RE: RE: RE: MarketData.GetBars hangs forever

PanagiotisCharalampous said: 

 

Thanks @PanagiotisCharalampous. Is there a temporary solution/hack I could use locally while you're guys finishish a proper fix? It's just a showstopper that stops the whole work I'm doing. 

Unfortunately there isn't. It seems that some data of the specific broker is corrupted and needs to be fixed

Ok, clear. How long do you think it will take to fix the data? Are we talking more days or weeks?


@Intetics

Intetics
15 Jan 2024, 08:54 ( Updated at: 15 Jan 2024, 12:20 )

RE: RE: RE: MarketData.GetBars hangs forever

PanagiotisCharalampous said: 

Intetics said: 

PanagiotisCharalampous said: 

Hi there,

Thanks for the information, we will investigate it

Best regards,

Panagiotis

HI PanagiotisCharalampous,

Did you guys manage to reproduce the issue?

Regards

Hi there,

Yes and we are working on a solution.

Best regards,

Panagiotis

Thanks @PanagiotisCharalampous. Is there a temporary solution/hack I could use locally while you're guys finishish a proper fix? It's just a showstopper that stops the whole work I'm doing. 


@Intetics

Intetics
13 Jan 2024, 08:02

RE: MarketData.GetBars hangs forever

PanagiotisCharalampous said: 

Hi there,

Thanks for the information, we will investigate it

Best regards,

Panagiotis

HI PanagiotisCharalampous,

Did you guys manage to reproduce the issue?

Regards


@Intetics

Intetics
21 Dec 2023, 07:20

RE: Sometimes MarketData.GetBars hangs forever

PanagiotisCharalampous said: 

Hi there,

Can you share the complete cBot code as well as the broker, so that we can reproduce and investigate?

Best regards,

Panagiotis

cTrader restart fixed the issue. Are there cTrader internal logs that I could share with you when it happens in the future?


@Intetics

Intetics
21 Dec 2023, 07:18 ( Updated at: 21 Dec 2023, 09:23 )

RE: % Commission

PanagiotisCharalampous said: 

Hi there,

There is no such option at the moment.

Best regards,

Panagiotis

Thank Panagiotis,

But that makes cTrading backtesting completely useless for anything except FX. Nobody trades stocks in millions with the same fee for different stocks. Here is a typical fee structure for CFD/stocks:

Are you guys planning to implement it in the near future?


@Intetics

Intetics
20 Dec 2023, 15:26

RE: MarketHours TimeTillClose Backtesting Bug

PanagiotisCharalampous said: 

Hi there,

Please send us the complete cBot code and your broker so that we can reproduce this issue on backtesting.

Best regards,

Panagiotis

Somehow I can't reproduce it anymore. Really weird. I'll keep an eye on it.


@Intetics

Intetics
20 Dec 2023, 10:27 ( Updated at: 20 Dec 2023, 10:56 )

Hm, actually

Action<Bars> callback = o =>{        Bars result = o;    Print("Market Bars found");};
MarketData.GetBarsAsync(TimeFrame.Daily, "American_Express_(AXP.N)", callback);

also hangs forever and never moves past the GetBarsAsync line.

Any suggestions how to avoid it?


@Intetics

Intetics
20 Dec 2023, 08:01

Ok, found GetBarsAsync. Just wondering why did you guys decide to implement it with callbacks rather than proper Task Async methods?


@Intetics

Intetics
20 Dec 2023, 06:42

RE: cTrader doesn't set SL bug

PanagiotisCharalampous said: 

Hi there,

This is not a bug, it's by design. You should check for these cases in your code and act accordingly.

Best regards,

Panagiotis

Hi Panagiotis,

How come not setting a stop loss can be by design? Shouldn't the ExecuteMarketOrder return IsSuccessful = false if the code can't place the trade I want?

Regards


@Intetics

Intetics
11 Dec 2023, 11:25

RE: CFD Backtesting Margin Calculations Bug

PanagiotisCharalampous said: 

Hi again,

Thank you. We managed to reproduce the problem and we will fix it in an upcoming release.

Best regards,

Panagiotis

Thanks @PanagiotisCharalampous . Does cTrader autoupdate on a new version? I can't seem to find this option in the settings.


@Intetics

Intetics
11 Dec 2023, 10:26

RE: RE: RE: Backtesting Max Drawdown in $

PanagiotisCharalampous said: 

Intetics said: 

PanagiotisCharalampous said: 

Hi there,

This information is not available in backtesting results at the moment.

Best regards,

Panagiotis

Hi PanagiotisCharalampous ,

Is this information available on the UI?

Regards

No it is not

Thanks. Are there plans to add this information at least to the UI? Because I can see this info for my Optimisation runs, but for whatever reasons it's not available for backtesting…


@Intetics

Intetics
11 Dec 2023, 09:44

RE: Backtesting Max Drawdown in $

PanagiotisCharalampous said: 

Hi there,

This information is not available in backtesting results at the moment.

Best regards,

Panagiotis

Hi PanagiotisCharalampous ,

Is this information available on the UI?

Regards


@Intetics

Intetics
08 Dec 2023, 13:57 ( Updated at: 09 Dec 2023, 05:51 )

Hi PanagiotisCharalampous, is there an update on this one?


@Intetics

Intetics
08 Dec 2023, 11:38 ( Updated at: 11 Dec 2023, 09:36 )

RE: CFD Backtesting Margin Calculations Bug

PanagiotisCharalampous said: 

Hi there,

Can you please share the complete cBot code and your broker so that we can reproduce this behavior?

Best regards,

Panagiotis

Hi, 

sure, that's the whole code:

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

namespace cAlgo.Robots
{
    [Robot(TimeZone = TimeZones.EasternStandardTime, AccessRights = AccessRights.FullAccess)]
    public class FreeMarginBug : Robot
    {
        [Parameter(DefaultValue = "Hello world!")]
        public string Message { get; set; }

        protected override void OnStart()
        {
            Print(Message);
        }

        protected override void OnBar()
        {
            if (Time == new DateTime(2023, 03, 20, 12, 0, 0))
            {
                double qty = 109;
                Print($"Account Balance: {Account.Balance}");
                Print($"Margin Before: {Account.Margin}");
                Print($"Free Margin Before: {Account.FreeMargin}");
                Print($"Price: {Symbol.Ask}");
                ExecuteMarketOrder(TradeType.Buy, SymbolName, qty, "MyBot", 40, 20, "Test", false);
                Print($"Expected Margin: {qty * Symbol.Ask / Symbol.DynamicLeverage.First().Leverage}");
                Print($"Actual Margin: {Account.Margin}");
                Print($"Free Margin After: {Account.FreeMargin}");
            }
        }
    }
}

Steps to reproduce:

  1. Create a new bot “FreeMarginBug”
  2. Select Apple as a financial instrument
  3. Set the first date of the backtesting to 19/03/2023
  4. Run the backtesting and check the log window 

Additional data:

  • Broker: PepperStone
  • Account Type: Test
  • Account Balance: 10,000

The same happens with any stock CFD on any date and any quantity. Specific stock and date was choosen just to simplify the debugging process.

 


@Intetics