Issue with Windows 11 Pro

Created at 14 Apr 2024, 00:05
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!
Waxy's avatar

Waxy

Joined 12.05.2015

Issue with Windows 11 Pro
14 Apr 2024, 00:05


Hello Spotware,

I have cTrader crashing or being unreliable with Windows 11 Pro, but I do not have issues when the same algo runs on Windows 11 Home or Windows 10 Home/Pro.

I repeat, there are issues with cTrader and Windows 11 Pro.

 

Here's the code used Below:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using cAlgo.API;
using cAlgo.API.Collections;
using cAlgo.API.Indicators;
using cAlgo.API.Internals;

namespace cAlgo.Robots;

[Robot(AccessRights = AccessRights.None)]
public class TestWindows11ProIssue : Robot
{
    public Border TextBorder { get; set; }
    public Button TextButton { get; set; }
    public TextBlock TextBlock { get; set; }

    protected override void OnStart()
    {
        TextBorder = new Border
        {
            //BorderColor = Color.White,
            //BorderThickness = 1,
            //HorizontalAlignment = HorizontalAlignment.Right,
            //VerticalAlignment = VerticalAlignment.Top,
            Margin = new Thickness(0, -22, 0, 0)
        };
        
        //TextBlock = new TextBlock
        //{
        //    HorizontalAlignment = HorizontalAlignment.Center,
        //    VerticalAlignment = VerticalAlignment.Center,
        //    TextAlignment = TextAlignment.Center,
        //    Text = "This is a text sample",
        //    ForegroundColor = Chart.ColorSettings.BackgroundColor,
        //    BackgroundColor = Chart.ColorSettings.ForegroundColor,
        //    Width = 200,
        //    Height = 20,
        //    IsHitTestVisible = true
        //};
        
        TextButton = new Button
        {
            //Content = TextBlock,
            //Margin = 0,
            //Padding = 0,
            //BackgroundColor = Color.Transparent,
            //--
            //HorizontalAlignment = HorizontalAlignment.Center,
            //VerticalAlignment = VerticalAlignment.Center,
            Text = "This is a text sample",
            //ForegroundColor = Chart.ColorSettings.BackgroundColor,
            //BackgroundColor = Chart.ColorSettings.ForegroundColor,
            //Width = 200,
            //Height = 20,
            //IsHitTestVisible = true
        };
        
        TextBorder.Child = TextButton;
        
        Chart.AddControl(TextBorder, Bars.OpenTimes[Bars.Count - 5], Symbol.Ask);
    }

    protected override void OnTick()
    {
        // Handle price updates here
    }

    protected override void OnStop()
    {
        // Handle cBot stop here
    }
}

 

 

@Waxy
Replies

ajaycc3
14 Apr 2024, 10:31 ( Updated at: 15 Apr 2024, 05:23 )

Issue on windows 11 professional

I am getting the same errors on windows 11 professional. 

Please can someone look into this asap? 

@PanagiotisCharalampous - Can you help with this?

Seems to be working fine on Windows 10 and Windows 11 home. But not on Windows 11 Professional? 

 


@ajaycc3

PanagiotisCharalampous
15 Apr 2024, 06:59

Hi there,

The issue is a result of using negative values Thickness

Margin = new Thickness(0, -22, 0, 0)

Please use positive or zero values only.

Best regards, 

Panagiotis


@PanagiotisCharalampous

Waxy
15 Apr 2024, 08:05

Hello Panagiotis,

This doesn't seem to address the inconsistencies between the different Windows versions, it shouldn't crash this way.

Besides, is there other way to put this control above the ask line besides negative margin? I will try with Canvas Top/Bottom and get back when I'm able to test it.

I have seen other size and margin inconsistencies that are not using negative margins, if possible to replicate I'll attach it here.

Thanks for your reply.

Regards,


@Waxy

PanagiotisCharalampous
15 Apr 2024, 11:14

RE: Issue with Windows 11 Pro

Waxy said: 

Hello Panagiotis,

This doesn't seem to address the inconsistencies between the different Windows versions, it shouldn't crash this way.

Besides, is there other way to put this control above the ask line besides negative margin? I will try with Canvas Top/Bottom and get back when I'm able to test it.

I have seen other size and margin inconsistencies that are not using negative margins, if possible to replicate I'll attach it here.

Thanks for your reply.

Regards,

Hi Waxy,

The inconsistency is in the behavior of the OS, not of cTrader. The one version supports negative numbers, the other does not. We can't do something about this at the moment except of also disabling the option for the one that works, for the sake of consistency. You should use the y parameter to place the control where you need it.

Best regards,

Panagiotis


@PanagiotisCharalampous