Introducing Chart Controls in Automate API

Panagiotis Charalampous's avatar
Panagiotis Charalampous since: 13 Jan 2017; 
 10 Oct 2019, 11:56
Introducing Chart Controls in Automate API

Hi Xavier R,

This is a bug. We will fix it in an update.

Best Regards,

Panagiotis

Head of Community Management at cTrader
Jiri Beloch's avatar
Jiri Beloch since: 31 Aug 2015; 
 17 Nov 2019, 01:20

Hi,

Would it be possible to add Z-order/index property? If we would be able to render controls behind bars that would be great too.

Thanks,
Jiri

Co-Founder & CTO at Poshtrader Ltd ⎯ www.poshtrader.com
Jiri Beloch's avatar
Jiri Beloch since: 31 Aug 2015; 
 17 Nov 2019, 01:23
RE:

Panagiotis Charalampous said:

Hi Xavier R,

This is a bug. We will fix it in an update.

Best Regards,

Panagiotis

Please, leave it as a feature so we can render custom price markers in the axis.

Co-Founder & CTO at Poshtrader Ltd ⎯ www.poshtrader.com
Jiri Beloch's avatar
Jiri Beloch since: 31 Aug 2015; 
 17 Nov 2019, 02:06

Corner radius doesn't work on TextBlock and TextBox? I haven't tested other controls so it might be totally broken as well.

Co-Founder & CTO at Poshtrader Ltd ⎯ www.poshtrader.com
paul.williams125 since: 03 Dec 2019; 
 03 Dec 2019, 19:56
PRESS BUTTON - TO RUN MORE THAN ONE EVENT

//-----------------------------------------------------------
//           PRESS BUTTON - TO  RUN MORE THAN ONE EVENT
//-----------------------------------------------------------

// ---------- This to be added just before protected override void Initialize() and OnStart()  below The Declaration of supplementary objects and variables Area.

        int x =0;

        public event Action On;
        public event Action Off;

//-----------------------------------------------------------
//----------- This code must be added Only to - protected override void Initialize() and OnStart() otherwise freezes - for good reason..
            var buttonStyle = new Style();
            buttonStyle.Set(ControlProperty.BackgroundColor, Color.Red, ControlState.DarkTheme);
            buttonStyle.Set(ControlProperty.BackgroundColor, Color.Green, ControlState.DarkTheme | ControlState.Checked);
            var checkBox = new CheckBox 
            {
                Style = buttonStyle,
                Width = 50,
                Height = 200,
                VerticalAlignment = VerticalAlignment.Top,
                HorizontalAlignment = HorizontalAlignment.Right,
                Margin = 5,
                Padding = "10 4 10 4"
            };
            checkBox.Checked += args => On.Invoke();
            On += () =>
            {
                x = 2;
                if (x == 2)
                    Chart.DrawStaticText("NOTES3", "\nHELLO ", VerticalAlignment.Top, HorizontalAlignment.Center, Color.White);
//-----------write your code. for when the button is clicked on, and turns Green.
            };

            checkBox.Unchecked += args => Off.Invoke();
            Off += () =>
            {
                x = 3;
                if (x == 3)
                    Chart.DrawStaticText("NOTES3", "\nGOODBYE ", VerticalAlignment.Top, HorizontalAlignment.Center, Color.White);
//-----------write your code. for when the button is clicked Off, and turns Red.
//-----------Please note .. you can only use the variables here,  x is only 3 while here, and will not change in your main program, when the button is pressed.
            };

 Chart.AddControl(checkBox);