Topics
30 Aug 2024, 11:09
 0
 165
 0
15 Aug 2024, 13:12
 0
 153
 0
23 Jul 2024, 17:30
 0
 235
 0
02 Jun 2024, 00:49
 2
 363
 3
14 Apr 2024, 00:05
 364
 4
15 Jan 2024, 06:08
 483
 3
Replies

Waxy
05 Sep 2024, 02:23

Hello Spotware,

It seems this issue has gotten worse, as I'm not able to edit the control text anymore.
I also can't remove it and place a new instance, this looks broken on multiple levels, I would appreciate support.

Regards,


@Waxy

Waxy
01 Sep 2024, 01:01

It would be nice to have this event handler soon.

Regards,


@Waxy

Waxy
20 Aug 2024, 18:01

RE: RE: RE: It seems Bars.LoadMoreHistory() has been recently broken and doesn't work

Hello Panagiotis,

Understood, I'll take it as it is, I'm pretty sure something changed here because it was working fine for a long time.

Thanks for your support.
Regards,


@Waxy

Waxy
20 Aug 2024, 04:59 ( Updated at: 20 Aug 2024, 07:29 )

RE: It seems Bars.LoadMoreHistory() has been recently broken and doesn't work

firemyst said: 

Have you considered that there might not be any more history to be loaded, especially if you're not scrolling to the left on the charts? 

See this thread:

https://ctrader.com/forum/cbot-support/38020/

 

Hello Firemyst,

Thanks for your reply.

This function obviously has changed its behavior, because I had an indicator and source control of it and it had working fine for a long time, debugging it led me to find this problem. Regardless of the broker or pair it returns zero and another user had this issue too but check more on this.

See video attached, first it counts bars without using the function on AUDNZD, then I run it again using the function, it turns into a locked refresh loop (doesn't even print the bars until after it loads the data, doesn't even print the initial bar count), at the end it does increase the number of bars but the function still returns zero.

Before this problem, we were able to control how many bars to load in a simple while loop synchronously without issues.

(9+) cTrader - 2024-08-19_23-47-08 - TechSmith Screencast

Regards,
 


@Waxy

Waxy
15 Aug 2024, 13:01

Hello Panagiotis,

I'll post it there as you said but, while some may be suggestions, I think the overload missing for the fractals, and the fact that the even values don't do anything are an issue.

Regards,


@Waxy

Waxy
23 Jul 2024, 17:31

Hello cTrader,


On a relatively recent update, you've added LocalStorage in order for us to avoid setting AccessRights to full access, and this is a great addition.

However, if for some reason the name of the files are not known, we cannot delete them.

I would appreciate for this small change to the API, give us a function to get all filenames, or also delete all files from LocalStorage.

Regards,


@Waxy

Waxy
03 Jun 2024, 19:17

Hello Spotware, thanks for these fixes and changes.

For the logs, would you please add back these 2 also:
- The lines are missing, now there's no distinction between each message and it makes it hard to read.
- Now you cannot sort columns by dates, type or message alphabetically. (because there are no columns anymore)


@Waxy

Waxy
17 May 2024, 22:58

+1 this, it occupies too much space.

Also, you should let us create folders to organize bots and indicators, some of us have too many.


@Waxy

Waxy
17 Apr 2024, 08:35

Hello Panagiotis,

I'm experimenting something with Ajay also and I don't have a crash, but I have an inconsistent behavior, here's a simple code, it doesn't crash, but while it is shown perfectly on Windows (with a few differences between versions), it's not visible on Mac at all.

Here's a code sample:

using System;
using System.Collections.Generic;
using System.Globalization;
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 MacIssue : Robot
{
    private Grid _grid;
    private LabelWithTextBox _control1;
    private ButtonTextBoxWithControl _control2;
    private int _colCounter;

    protected override void OnStart()
    {
        _grid = new Grid(1, 15)
        {
            //ShowGridLines = true,
            Width = 1000,
            Height = 30,
            HorizontalAlignment = HorizontalAlignment.Left,
            VerticalAlignment = VerticalAlignment.Top,
            Margin = new Thickness(0, 30, 0, 0)
        };
        
        _control1 = new LabelWithTextBox(1.0);

        _grid.AddChild(_control1, 0, _colCounter);
        //_grid.Columns[2].SetWidthInPixels(130);
        _grid.Columns[_colCounter].SetWidthToAuto();
        _colCounter++;

        _control2 = new ButtonTextBoxWithControl(100.0);
        
        _grid.AddChild(_control2, 0, _colCounter);
        _grid.Columns[_colCounter].SetWidthToAuto();
        _colCounter++;
        
        Chart.AddControl(_grid);
    }

    protected override void OnTick() { }

    protected override void OnStop() { }

    public int InputRrrBaseTp { get; } = 1;
}

public class ButtonTextBoxWithControl : WrapPanel
{
    public TextBox TextBox { get; }
    public Button Button { get; }

    public ButtonTextBoxWithControl(double defaultRiskValue)
    {
        Orientation = Orientation.Horizontal;
        
        Button = new Button
        {
            Text = "Control 2",
            Width = 70,
            CornerRadius = 0
        };
        
        TextBox = new TextBox
        {
            Width = 50,
            Text = defaultRiskValue.ToString("0.00"),
        };
        
        var defaultBackgroundColor = TextBox.BackgroundColor;
        
        TextBox.TextChanged += args =>
        {
            if (!ValidateDouble(TextBox.Text))
            {
                TextBox.BackgroundColor = Color.Red;
                return;
            }
            
            TextBox.BackgroundColor = defaultBackgroundColor;
        };
        
        var upDownController = new UpDownController();
        
        AddChild(Button);
        AddChild(TextBox);
        AddChild(upDownController);
    }
    
    public void NormalizeValue()
    {
        TextBox.Text = double.Parse(TextBox.Text).ToString("0.00");
    }
    
    private bool ValidateDouble(string value)
    {
        return double.TryParse(value, out var result) && result >= 0;
    }
}

public class LabelWithTextBox : WrapPanel
{
    public TextBox TextBox { get; }

    public LabelWithTextBox(double defaultValue)
    {
        Orientation = Orientation.Horizontal;
        
        var textBlock = new Button
        {
            Text = "Control 1",
            Width = 50,
            Height = 26,
            FontSize = 12,
            //HorizontalContentAlignment = HorizontalAlignment.Center,
            //VerticalContentAlignment = VerticalAlignment.Center,
            HorizontalAlignment = HorizontalAlignment.Center,
            VerticalAlignment = VerticalAlignment.Center,
            //Padding = new Thickness(0, 5, 0, 0),
            CornerRadius = 0,
            //IsEnabled = false,
        };
        
        TextBox = new TextBox
        {
            Width = 70,
            Height = 26,
            Text = $"{defaultValue:F2}",
            IsReadOnly = true,
            FontSize = 12,
            HorizontalAlignment = HorizontalAlignment.Center,
            VerticalAlignment = VerticalAlignment.Center,
            TextAlignment = TextAlignment.Center,
        };
        
        AddChild(textBlock);
        AddChild(TextBox);
    }
}

public class UpDownController : StackPanel
{
    public Button UpButton { get; } 
    public Button DownButton { get; }

    public UpDownController()
    {
        Orientation = Orientation.Vertical;
        
        UpButton = NewButton("▲");

        //UpButton.Click += args => { OnUpButtonClicked(); };
        
        DownButton = NewButton("▼");
        
        //DownButton.Click += args => { OnDownButtonClicked(); };
        
        AddChild(UpButton);
        AddChild(DownButton);
    }

    private Button NewButton(string text) =>
        new()
        {
            Text = text,
            FontSize = 7,
            //Width = 10,
            //Height = 10,
            CornerRadius = 0
        };
}

@Waxy

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

Waxy
02 Feb 2024, 00:27 ( Updated at: 02 Feb 2024, 06:41 )

I figured out how to debug with rider.

"Settings | Build, Execution, Deployment | Debugger" and click "Set Rider as a default debugger"

It should prompt you to use Rider for debugging.

Allow JIT Rider Debugging Session to be Started with Debugger.Launch() : RIDER-18701 (jetbrains.com)

Regards,


@Waxy

Waxy
16 Jan 2024, 18:29

RE: cTrader randomly crashing

Hello Panagiotis, 

The only thing the log says is “CbotName” crashed

As for sending the code, can I share it via email? The code is private, and I cannot share it publicly.

Regards,

PanagiotisCharalampous said: 

Hi Waxy,

Can you share the cBot's code and log after the crash as well?

Best regards,

Panagiotis

 


@Waxy

Waxy
20 Sep 2023, 15:29

Hello,

Here's a sample, just any reference to fractals makes it print the values, something that didn't happen before 4.8.27.

using cAlgo.API;
using cAlgo.API.Indicators;

namespace cAlgo;

[Indicator(AccessRights = AccessRights.None, IsOverlay = true)]
public class FractalsIssue : Indicator
{
    private Fractals _fractals;

    protected override void Initialize()
    {
        _fractals = Indicators.Fractals(5);
    }

    public override void Calculate(int index)
    {
        var _ = _fractals.UpFractal[index];
    }
}

@Waxy

Waxy
12 Jun 2023, 22:05

RE:

firemyst said:

Have you tried altering the access rights permissions of your bots?

 

Yes, although the new overload with SoundType shouldn't need it, I've tried with AccessRights.None and AccessRights.FullAccess

 


@Waxy

Waxy
12 Jun 2023, 13:03

You can change the values of these parameters at runtime, this is why they have "set" accessors, you can change their values.

This Prints:
Hello World
Hello World2
 

using cAlgo.API;

namespace cAlgo.Robots;

[Robot(AccessRights = AccessRights.None)]
public class NewcBot : Robot
{
    [Parameter(DefaultValue = "Hello world!")]
    public string Message { get; set; }

    protected override void OnStart()
    {
        Print(Message);
        
        Message += "2";
        
        Print(Message);
    }

}



 


@Waxy

Waxy
23 Jan 2023, 06:48 ( Updated at: 21 Dec 2023, 09:23 )

Hello Spotware, sorry for the late reply.

I'm unable to replicate the same behavior, I'm getting this window now:



Here are the Logs of System.Core.Lib but I don't know if they will be useful now

C:\Users\USUARIO\AppData\Local\Spotware\cTrader\abb70432efbee65d18af69e79fe8efe1\app_4.5.7.12682\x64\System.Private.CoreLib.pdb: Cannot find or open the PDB file.
C:\Users\USUARIO\AppData\Local\Spotware\dotnet\shared\Microsoft.NETCore.App\6.0.0\System.Private.CoreLib.pdb: Cannot find or open the PDB file.
D:\a\_work\1\s\artifacts\obj\coreclr\System.Private.CoreLib\x64\Release\System.Private.CoreLib.pdb: Cannot find or open the PDB file.
C:\Users\USUARIO\AppData\Local\Temp\SymbolCache\System.Private.CoreLib.pdb\57c2d4282221452cad4df86bbd5d6fa0ffffffff\System.Private.CoreLib.pdb: Cannot find or open the PDB file.
C:\Users\USUARIO\AppData\Local\Temp\SymbolCache\MicrosoftPublicSymbols\System.Private.CoreLib.pdb\57c2d4282221452cad4df86bbd5d6fa0ffffffff\System.Private.CoreLib.pdb: Cannot find or open the PDB file.
C:\Users\USUARIO\AppData\Local\Temp\SymbolCache\System.Private.CoreLib.pdb\57c2d4282221452cad4df86bbd5d6fa01\System.Private.CoreLib.pdb: Cannot find or open the PDB file.
C:\Users\USUARIO\AppData\Local\Temp\SymbolCache\MicrosoftPublicSymbols\System.Private.CoreLib.pdb\57c2d4282221452cad4df86bbd5d6fa01\System.Private.CoreLib.pdb: Cannot find or open the PDB file.
SYMSRV:  BYINDEX: 0x1
         C:\Users\USUARIO\AppData\Local\Temp\SymbolCache*https://msdl.microsoft.com/download/symbols
         System.Private.CoreLib.pdb
         57C2D4282221452CAD4DF86BBD5D6FA0ffffffff


SYMSRV:  UNC: C:\Users\USUARIO\AppData\Local\Temp\SymbolCache\System.Private.CoreLib.pdb\57C2D4282221452CAD4DF86BBD5D6FA0ffffffff\System.Private.CoreLib.pdb - file not found


SYMSRV:  UNC: C:\Users\USUARIO\AppData\Local\Temp\SymbolCache\System.Private.CoreLib.pdb\57C2D4282221452CAD4DF86BBD5D6FA0ffffffff\System.Private.CoreLib.pd_ - file not found


SYMSRV:  UNC: C:\Users\USUARIO\AppData\Local\Temp\SymbolCache\System.Private.CoreLib.pdb\57C2D4282221452CAD4DF86BBD5D6FA0ffffffff\file.ptr - file not found


SYMSRV:  HTTPGET: /download/symbols/index2.txt


SYMSRV:  HttpQueryInfo: 80190194 - HTTP_STATUS_NOT_FOUND


SYMSRV:  HTTPGET: /download/symbols/System.Private.CoreLib.pdb/57C2D4282221452CAD4DF86BBD5D6FA0ffffffff/System.Private.CoreLib.pdb


SYMSRV:  HttpQueryInfo: 801900c8 - HTTP_STATUS_OK


SYMSRV:  System.Private.CoreLib.pdb from https://msdl.microsoft.com/download/symbols: 1633924 bytes 

SYMSRV:  PATH: C:\Users\USUARIO\AppData\Local\Temp\SymbolCache\System.Private.CoreLib.pdb\57C2D4282221452CAD4DF86BBD5D6FA0ffffffff\System.Private.CoreLib.pdb


SYMSRV:  RESULT: 0x00000000


https://msdl.microsoft.com/download/symbols: Symbols downloaded from symbol server.
C:\Users\USUARIO\AppData\Local\Temp\SymbolCache\System.Private.CoreLib.pdb\57C2D4282221452CAD4DF86BBD5D6FA0ffffffff\System.Private.CoreLib.pdb: Symbols loaded.

 


@Waxy

Waxy
10 Jan 2023, 21:34 ( Updated at: 21 Dec 2023, 09:23 )

RE:

Spotware said:

Dear Waxy,

Can you please change the setting to "Load all modules" and try his scenario one more time? 

Best regards,

cTrader Team

Hello Spotware, 

You can see I have Load all modules checked, but still, it doesn't work, would appreciate your support:
Regards,




 

 


@Waxy

Waxy
23 Dec 2022, 22:23

RE:

This isn't possible, you can use indicator data from a bot but you cannot use attributes like Output inside a bot.


@Waxy

Waxy
23 Dec 2022, 22:15

RE: RE:

What he means is that in

var kyushu_d_bullish = kyushu_d.kyushu_bullish;

Since kyushu_d is a Bars object, it doesn't have any "kyushu_bullish" property

kyushu_d has properties like kyushu_d.OpenPrices.Last(n) and etc you can use instead

 


@Waxy

Waxy
18 Dec 2022, 01:16 ( Updated at: 21 Dec 2023, 09:23 )

RE: Still not working for me With VS2022 17.3.4 and Ctrader Automate version 1.0.4 (which is the latest version)

So, in case someone is still experiencing this issue, I was able to sort it out by changing the kind of debug symbols, inside the project properties, changed it to PDB file, current platform:

The System.Private.Core issue is still present in some of my solutions though

Regards,


@Waxy