Replies

PanagiotisCharalampous
12 Nov 2024, 06:37

Hi there,

I do not understand your post. Is this a question? Are you suggesting something? How can we help?

Best regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
12 Nov 2024, 06:28

RE: RE: RE: RE: RE: RE: lock buy sell button

tuuguu177 said: 

PanagiotisCharalampous said: 

tuuguu177 said: 

PanagiotisCharalampous said: 

tuuguu177 said: 

PanagiotisCharalampous said: 

Hi there,

Add

using System.Linq;

in the namespaces you use

Best regards,

Panagiotis

I put it but it did not work

Please share the updated cBot code

using System;
using System.Collections.Generic;
using cAlgo.API;
using cAlgo.API.Internals;

using System.Linq;
using cAlgo.Indicators;
using cAlgo.API.Indicators;

namespace cAlgo
{
    [Robot(TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)]
    public class SampleTradingPanel : Robot
    {
        [Parameter("Vertical Position", Group = "Panel alignment", DefaultValue = VerticalAlignment.Top)]
        public VerticalAlignment PanelVerticalAlignment { get; set; }

        [Parameter("Horizontal Position", Group = "Panel alignment", DefaultValue = HorizontalAlignment.Left)]
        public HorizontalAlignment PanelHorizontalAlignment { get; set; }

        [Parameter("Default Lots", Group = "Default trade parameters", DefaultValue = 0.01)]
        public double DefaultLots { get; set; }

        [Parameter("Default Take Profit (pips)", Group = "Default trade parameters", DefaultValue = 100)]
        public double DefaultTakeProfitPips { get; set; }

        [Parameter("Default Stop Loss (pips)", Group = "Default trade parameters", DefaultValue = 20)]
        public double DefaultStopLossPips { get; set; }

        protected override void OnStart()
        {
            var tradingPanel = new TradingPanel(this, Symbol, DefaultLots, DefaultStopLossPips, DefaultTakeProfitPips);

            var border = new Border 
            {
                VerticalAlignment = PanelVerticalAlignment,
                HorizontalAlignment = PanelHorizontalAlignment,
                Style = Styles.CreatePanelBackgroundStyle(),
                Margin = "20 350 2 20",
                Width = 145,
                Child = tradingPanel
            };

            Chart.AddControl(border);
        }
    }

    public class TradingPanel : CustomControl
    {
        private const string LotsInputKey = "LotsKey";
        private const string TakeProfitInputKey = "TPKey";
        private const string StopLossInputKey = "SLKey";
        private readonly IDictionary<string, TextBox> _inputMap = new Dictionary<string, TextBox>();
        private readonly Robot _robot;
        private readonly Symbol _symbol;

        public TradingPanel(Robot robot, Symbol symbol, double defaultLots, double defaultStopLossPips, double defaultTakeProfitPips)
        {
            _robot = robot;
            _symbol = symbol;
            AddChild(CreateTradingPanel(defaultLots, defaultStopLossPips, defaultTakeProfitPips));
        }

        private ControlBase CreateTradingPanel(double defaultLots, double defaultStopLossPips, double defaultTakeProfitPips)
        {
            var mainPanel = new StackPanel();

            var header = CreateHeader();
            mainPanel.AddChild(header);

            var contentPanel = CreateContentPanel(defaultLots, defaultStopLossPips, defaultTakeProfitPips);
            mainPanel.AddChild(contentPanel);

            return mainPanel;
        }

        private ControlBase CreateHeader()
        {
            var headerBorder = new Border 
            {
                BorderThickness = "0 0 0 1",
                Style = Styles.CreateCommonBorderStyle()
            };

            var header = new TextBlock 
            {
                Text = "Quick Trading Panel",
                Margin = "10 7",
                Style = Styles.CreateHeaderStyle()
            };

            headerBorder.Child = header;
            return headerBorder;
        }

        private StackPanel CreateContentPanel(double defaultLots, double defaultStopLossPips, double defaultTakeProfitPips)
        {
            var contentPanel = new StackPanel 
            {
                Margin = 10
            };
            var grid = new Grid(4, 3);
            //var grid2 = new Grid(5, 3);
            grid.Columns[1].SetWidthInPixels(5);

            var sellButton = CreateTradeButton("SELL", Styles.CreateSellButtonStyle(), TradeType.Sell);
            grid.AddChild(sellButton, 0, 0);

            var buyButton = CreateTradeButton("BUY", Styles.CreateBuyButtonStyle(), TradeType.Buy);
            grid.AddChild(buyButton, 0, 2);

            var lotsInput = CreateInputWithLabel("Quantity (Lots)", defaultLots.ToString("F2"), LotsInputKey);
            grid.AddChild(lotsInput, 1, 0, 1, 3);

            var stopLossInput = CreateInputWithLabel("SL/Pips/", defaultStopLossPips.ToString("F1"), StopLossInputKey);
            grid.AddChild(stopLossInput, 2, 0);

            var takeProfitInput = CreateInputWithLabel("TP/Pips/", defaultTakeProfitPips.ToString("F1"), TakeProfitInputKey);
            grid.AddChild(takeProfitInput, 2, 2);

            var closeAllButton = CreateCloseAllButton();
            var closeAllButton2 = CreateCloseAllButton2();
            //grid.AddChild(closeAllButton, 3, 0, 1, 3);
            //grid.AddChild(closeAllButton2, 3, 0, 1, 3);

            grid.AddChild(closeAllButton, 3, 0);
            grid.AddChild(closeAllButton2, 3, 2);

            contentPanel.AddChild(grid);

            return contentPanel;
        }

        private Button CreateTradeButton(string text, Style style, TradeType tradeType)
        {
            var tradeButton = new Button 
            {
                Text = text,
                Style = style,
                Height = 25
            };

            tradeButton.Click += args => ExecuteMarketOrderAsync(tradeType);

            return tradeButton;
        }

        private ControlBase CreateCloseAllButton()
        {
            var closeAllBorder = new Border 
            {
                Margin = "0 20 0 0",
                BorderThickness = "0 1 0 0",
                Style = Styles.CreateCommonBorderStyle()
            };

            var closeButton = new Button 
            {
                Style = Styles.CreateCloseButtonStyle(),
                Text = "Close.A",
                Margin = "0 20 0 0"
            };

            closeButton.Click += args => CloseAll();
            closeAllBorder.Child = closeButton;
            
            return closeAllBorder;
        }

        private ControlBase CreateCloseAllButton2()
        {

            var closeAllBorder2 = new Border 
            {
                Margin = "0 20 0 0",
                BorderThickness = "0 1 0 0",
                Style = Styles.CreateCommonBorderStyle()
            };

            var closeButton2 = new Button 
            {
                Style = Styles.CreateCloseButtonStyle(),
                Text = "Close.P",
                Margin = "0 20 0 0"
            };

            closeButton2.Click += args => ClosePart();
            closeAllBorder2.Child = closeButton2;
            
            return closeAllBorder2;
        }
        
        private Panel CreateInputWithLabel(string label, string defaultValue, string inputKey)
        {
            var stackPanel = new StackPanel 
            {
                Orientation = Orientation.Vertical,
                Margin = "0 10 0 0"
            };

            var textBlock = new TextBlock 
            {
                Text = label
            };

            var input = new TextBox 
            {
                Margin = "0 5 0 0",
                Text = defaultValue,
                Style = Styles.CreateInputStyle()
            };

            _inputMap.Add(inputKey, input);

            stackPanel.AddChild(textBlock);
            stackPanel.AddChild(input);

            return stackPanel;
        }

        private void ExecuteMarketOrderAsync(TradeType tradeType)
        {
            var lots = GetValueFromInput(LotsInputKey, 0);
            if (lots <= 0)
            {
                _robot.Print(string.Format("{0} failed, invalid Lots", tradeType));
                return;
            }

            var stopLossPips = GetValueFromInput(StopLossInputKey, 0);
            var takeProfitPips = GetValueFromInput(TakeProfitInputKey, 0);

            _robot.Print(string.Format("Open position with: LotsParameter: {0}, StopLossPipsParameter: {1}, TakeProfitPipsParameter: {2}", lots, stopLossPips, takeProfitPips));
            
            //var netProfit = Account.UnrealizedNetProfit;
            //var PercentProfit = Math.Round(netProfit / Account.Balance * 100, 2);
            
            var volume = _symbol.QuantityToVolumeInUnits(lots);
            
            if (Account.Equity < Account.Balance * ((100 - maxDrawDown) / 100))
            {
                //foreach (var position in Positions)
                    //ClosePositionAsync(position);
            }
            
            _robot.ExecuteMarketOrderAsync(tradeType, _symbol.Name, volume, "Trade Panel Sample", stopLossPips, takeProfitPips);
        }

        private double GetValueFromInput(string inputKey, double defaultValue)
        {
            double value;

            return double.TryParse(_inputMap[inputKey].Text, out value) ? value : defaultValue;
        }

        private void CloseAll()
        {
            foreach (var position in _robot.Positions)
                _robot.ClosePositionAsync(position);
        }
    
        
        private void ClosePart()
        {
            foreach (var position in _robot.Positions) 
        { 
            
            _robot.ClosePosition(position, 5); 
             
        }
        }
    
    }

    public static class Styles
    {
        public static Style CreatePanelBackgroundStyle()
        {
            var style = new Style();
            style.Set(ControlProperty.CornerRadius, 3);
            style.Set(ControlProperty.BackgroundColor, GetColorWithOpacity(Color.FromHex("#292929"), 0.10m), ControlState.DarkTheme);
            style.Set(ControlProperty.BackgroundColor, GetColorWithOpacity(Color.FromHex("#FFFFFF"), 0.10m), ControlState.LightTheme);
            style.Set(ControlProperty.BorderColor, Color.FromHex("#3C3C3C"), ControlState.DarkTheme);
            style.Set(ControlProperty.BorderColor, Color.FromHex("#C3C3C3"), ControlState.LightTheme);
            style.Set(ControlProperty.BorderThickness, new Thickness(1));

            return style;
        }

        public static Style CreateCommonBorderStyle()
        {
            var style = new Style();
            style.Set(ControlProperty.BorderColor, GetColorWithOpacity(Color.FromHex("#FFFFFF"), 0.12m), ControlState.DarkTheme);
            style.Set(ControlProperty.BorderColor, GetColorWithOpacity(Color.FromHex("#000000"), 0.12m), ControlState.LightTheme);
            return style;
        }

        public static Style CreateHeaderStyle()
        {
            var style = new Style();
            style.Set(ControlProperty.ForegroundColor, GetColorWithOpacity("#FFFFFF", 0.70m), ControlState.DarkTheme);
            style.Set(ControlProperty.ForegroundColor, GetColorWithOpacity("#000000", 0.65m), ControlState.LightTheme);
            return style;
        }

        public static Style CreateInputStyle()
        {
            var style = new Style(DefaultStyles.TextBoxStyle);
            style.Set(ControlProperty.BackgroundColor, Color.FromHex("#1A1A1A"), ControlState.DarkTheme);
            style.Set(ControlProperty.BackgroundColor, Color.FromHex("#111111"), ControlState.DarkTheme | ControlState.Hover);
            style.Set(ControlProperty.BackgroundColor, Color.FromHex("#E7EBED"), ControlState.LightTheme);
            style.Set(ControlProperty.BackgroundColor, Color.FromHex("#D6DADC"), ControlState.LightTheme | ControlState.Hover);
            style.Set(ControlProperty.CornerRadius, 3);
            return style;
        }

        public static Style CreateBuyButtonStyle()
        {
            return CreateButtonStyle(Color.FromHex("#009345"), Color.FromHex("#10A651"));
        }

        public static Style CreateSellButtonStyle()
        {
            return CreateButtonStyle(Color.FromHex("#F05824"), Color.FromHex("#FF6C36"));
        }

        public static Style CreateCloseButtonStyle()
        {
            return CreateButtonStyle(Color.FromHex("#F05824"), Color.FromHex("#FF6C36"));
        }

        private static Style CreateButtonStyle(Color color, Color hoverColor)
        {
            var style = new Style(DefaultStyles.ButtonStyle);
            style.Set(ControlProperty.BackgroundColor, color, ControlState.DarkTheme);
            style.Set(ControlProperty.BackgroundColor, color, ControlState.LightTheme);
            style.Set(ControlProperty.BackgroundColor, hoverColor, ControlState.DarkTheme | ControlState.Hover);
            style.Set(ControlProperty.BackgroundColor, hoverColor, ControlState.LightTheme | ControlState.Hover);
            style.Set(ControlProperty.ForegroundColor, Color.FromHex("#FFFFFF"), ControlState.DarkTheme);
            style.Set(ControlProperty.ForegroundColor, Color.FromHex("#FFFFFF"), ControlState.LightTheme);
            return style;
        }

        private static Color GetColorWithOpacity(Color baseColor, decimal opacity)
        {
            var alpha = (int)Math.Round(byte.MaxValue * opacity, MidpointRounding.AwayFromZero);
            return Color.FromArgb(alpha, baseColor);
        }
    }
}

 

Hi there,

The errors are different this time and they are self explanatory. You are using variables that are not defined anywhere.

Best regards,

Panagiotis

could you please give me the code?

Unfortunately I cannot write the code for you. If you have specific programming questions, I am happy to answer them. But if you don't know how to program, it's better to hire a professional.


@PanagiotisCharalampous

PanagiotisCharalampous
12 Nov 2024, 06:25

RE: RE: Custom indicator Plotting horizontal lines at User specified price increments

SaphirSpecs said: 

PanagiotisCharalampous said: 

 

so I’m not really fam with coding on this platform and currently the code does plot horizontal lines on the workspace. 
the ideal output is 

-user defines (current) price at which the algo starts plotting horizontal lines

-user defines increment at which each horizontal line is plotted 

 for example ( Gold 2000, 3, 100) 

algo plots a horizontal line each $3 

currently my code gives me the prompts for each parameter but does not even plot a single line. 
ideally the code would plot automatically using a for loop. But worst case scenario I can manually enter the code for each line 

Hi there,

Can you explain your issue in more detail? What do you expect your code to do and what does it do instead?

Best regards,

Panagiotis

 

Hi there,

I tried your indicator and it plots the lines fine. 

So I do not see a problem.

Best regards,


@PanagiotisCharalampous

PanagiotisCharalampous
11 Nov 2024, 14:25

RE: RE: RE: Cannot login to app ctrader android

balnisrokas said: 

balnisrokas said: 

PanagiotisCharalampous said: 

Hi there,

Can you record a video demonstrating what you are looking at?

Best regards,

Panagiotis

https://files.fm/u/4txfsb9mh3 here is video

So, any ideas? I need to trade and i cannot do it

Hi there,

It seems you have confirmed that you are a US resident. If you uninstall it and reinstall it, it should ask you again. If you are not a US resident, then click that you are not.

Best regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
11 Nov 2024, 14:11

RE: RE: Risk-Reward Tool - Where is it?

JohnnyG said: 

PanagiotisCharalampous said: 

Hi there,

This tool is only available on cTrader Web at the moment.

Best regards,

Panagiotis

Why? It would be useful, if all platforms would have same usability. 

It will be added to the rest of the applications in future updates


@PanagiotisCharalampous

PanagiotisCharalampous
11 Nov 2024, 14:11

RE: RE: RE: RE: lock buy sell button

tuuguu177 said: 

PanagiotisCharalampous said: 

tuuguu177 said: 

PanagiotisCharalampous said: 

Hi there,

Add

using System.Linq;

in the namespaces you use

Best regards,

Panagiotis

I put it but it did not work

Please share the updated cBot code

using System;
using System.Collections.Generic;
using cAlgo.API;
using cAlgo.API.Internals;

using System.Linq;
using cAlgo.Indicators;
using cAlgo.API.Indicators;

namespace cAlgo
{
    [Robot(TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)]
    public class SampleTradingPanel : Robot
    {
        [Parameter("Vertical Position", Group = "Panel alignment", DefaultValue = VerticalAlignment.Top)]
        public VerticalAlignment PanelVerticalAlignment { get; set; }

        [Parameter("Horizontal Position", Group = "Panel alignment", DefaultValue = HorizontalAlignment.Left)]
        public HorizontalAlignment PanelHorizontalAlignment { get; set; }

        [Parameter("Default Lots", Group = "Default trade parameters", DefaultValue = 0.01)]
        public double DefaultLots { get; set; }

        [Parameter("Default Take Profit (pips)", Group = "Default trade parameters", DefaultValue = 100)]
        public double DefaultTakeProfitPips { get; set; }

        [Parameter("Default Stop Loss (pips)", Group = "Default trade parameters", DefaultValue = 20)]
        public double DefaultStopLossPips { get; set; }

        protected override void OnStart()
        {
            var tradingPanel = new TradingPanel(this, Symbol, DefaultLots, DefaultStopLossPips, DefaultTakeProfitPips);

            var border = new Border 
            {
                VerticalAlignment = PanelVerticalAlignment,
                HorizontalAlignment = PanelHorizontalAlignment,
                Style = Styles.CreatePanelBackgroundStyle(),
                Margin = "20 350 2 20",
                Width = 145,
                Child = tradingPanel
            };

            Chart.AddControl(border);
        }
    }

    public class TradingPanel : CustomControl
    {
        private const string LotsInputKey = "LotsKey";
        private const string TakeProfitInputKey = "TPKey";
        private const string StopLossInputKey = "SLKey";
        private readonly IDictionary<string, TextBox> _inputMap = new Dictionary<string, TextBox>();
        private readonly Robot _robot;
        private readonly Symbol _symbol;

        public TradingPanel(Robot robot, Symbol symbol, double defaultLots, double defaultStopLossPips, double defaultTakeProfitPips)
        {
            _robot = robot;
            _symbol = symbol;
            AddChild(CreateTradingPanel(defaultLots, defaultStopLossPips, defaultTakeProfitPips));
        }

        private ControlBase CreateTradingPanel(double defaultLots, double defaultStopLossPips, double defaultTakeProfitPips)
        {
            var mainPanel = new StackPanel();

            var header = CreateHeader();
            mainPanel.AddChild(header);

            var contentPanel = CreateContentPanel(defaultLots, defaultStopLossPips, defaultTakeProfitPips);
            mainPanel.AddChild(contentPanel);

            return mainPanel;
        }

        private ControlBase CreateHeader()
        {
            var headerBorder = new Border 
            {
                BorderThickness = "0 0 0 1",
                Style = Styles.CreateCommonBorderStyle()
            };

            var header = new TextBlock 
            {
                Text = "Quick Trading Panel",
                Margin = "10 7",
                Style = Styles.CreateHeaderStyle()
            };

            headerBorder.Child = header;
            return headerBorder;
        }

        private StackPanel CreateContentPanel(double defaultLots, double defaultStopLossPips, double defaultTakeProfitPips)
        {
            var contentPanel = new StackPanel 
            {
                Margin = 10
            };
            var grid = new Grid(4, 3);
            //var grid2 = new Grid(5, 3);
            grid.Columns[1].SetWidthInPixels(5);

            var sellButton = CreateTradeButton("SELL", Styles.CreateSellButtonStyle(), TradeType.Sell);
            grid.AddChild(sellButton, 0, 0);

            var buyButton = CreateTradeButton("BUY", Styles.CreateBuyButtonStyle(), TradeType.Buy);
            grid.AddChild(buyButton, 0, 2);

            var lotsInput = CreateInputWithLabel("Quantity (Lots)", defaultLots.ToString("F2"), LotsInputKey);
            grid.AddChild(lotsInput, 1, 0, 1, 3);

            var stopLossInput = CreateInputWithLabel("SL/Pips/", defaultStopLossPips.ToString("F1"), StopLossInputKey);
            grid.AddChild(stopLossInput, 2, 0);

            var takeProfitInput = CreateInputWithLabel("TP/Pips/", defaultTakeProfitPips.ToString("F1"), TakeProfitInputKey);
            grid.AddChild(takeProfitInput, 2, 2);

            var closeAllButton = CreateCloseAllButton();
            var closeAllButton2 = CreateCloseAllButton2();
            //grid.AddChild(closeAllButton, 3, 0, 1, 3);
            //grid.AddChild(closeAllButton2, 3, 0, 1, 3);

            grid.AddChild(closeAllButton, 3, 0);
            grid.AddChild(closeAllButton2, 3, 2);

            contentPanel.AddChild(grid);

            return contentPanel;
        }

        private Button CreateTradeButton(string text, Style style, TradeType tradeType)
        {
            var tradeButton = new Button 
            {
                Text = text,
                Style = style,
                Height = 25
            };

            tradeButton.Click += args => ExecuteMarketOrderAsync(tradeType);

            return tradeButton;
        }

        private ControlBase CreateCloseAllButton()
        {
            var closeAllBorder = new Border 
            {
                Margin = "0 20 0 0",
                BorderThickness = "0 1 0 0",
                Style = Styles.CreateCommonBorderStyle()
            };

            var closeButton = new Button 
            {
                Style = Styles.CreateCloseButtonStyle(),
                Text = "Close.A",
                Margin = "0 20 0 0"
            };

            closeButton.Click += args => CloseAll();
            closeAllBorder.Child = closeButton;
            
            return closeAllBorder;
        }

        private ControlBase CreateCloseAllButton2()
        {

            var closeAllBorder2 = new Border 
            {
                Margin = "0 20 0 0",
                BorderThickness = "0 1 0 0",
                Style = Styles.CreateCommonBorderStyle()
            };

            var closeButton2 = new Button 
            {
                Style = Styles.CreateCloseButtonStyle(),
                Text = "Close.P",
                Margin = "0 20 0 0"
            };

            closeButton2.Click += args => ClosePart();
            closeAllBorder2.Child = closeButton2;
            
            return closeAllBorder2;
        }
        
        private Panel CreateInputWithLabel(string label, string defaultValue, string inputKey)
        {
            var stackPanel = new StackPanel 
            {
                Orientation = Orientation.Vertical,
                Margin = "0 10 0 0"
            };

            var textBlock = new TextBlock 
            {
                Text = label
            };

            var input = new TextBox 
            {
                Margin = "0 5 0 0",
                Text = defaultValue,
                Style = Styles.CreateInputStyle()
            };

            _inputMap.Add(inputKey, input);

            stackPanel.AddChild(textBlock);
            stackPanel.AddChild(input);

            return stackPanel;
        }

        private void ExecuteMarketOrderAsync(TradeType tradeType)
        {
            var lots = GetValueFromInput(LotsInputKey, 0);
            if (lots <= 0)
            {
                _robot.Print(string.Format("{0} failed, invalid Lots", tradeType));
                return;
            }

            var stopLossPips = GetValueFromInput(StopLossInputKey, 0);
            var takeProfitPips = GetValueFromInput(TakeProfitInputKey, 0);

            _robot.Print(string.Format("Open position with: LotsParameter: {0}, StopLossPipsParameter: {1}, TakeProfitPipsParameter: {2}", lots, stopLossPips, takeProfitPips));
            
            //var netProfit = Account.UnrealizedNetProfit;
            //var PercentProfit = Math.Round(netProfit / Account.Balance * 100, 2);
            
            var volume = _symbol.QuantityToVolumeInUnits(lots);
            
            if (Account.Equity < Account.Balance * ((100 - maxDrawDown) / 100))
            {
                //foreach (var position in Positions)
                    //ClosePositionAsync(position);
            }
            
            _robot.ExecuteMarketOrderAsync(tradeType, _symbol.Name, volume, "Trade Panel Sample", stopLossPips, takeProfitPips);
        }

        private double GetValueFromInput(string inputKey, double defaultValue)
        {
            double value;

            return double.TryParse(_inputMap[inputKey].Text, out value) ? value : defaultValue;
        }

        private void CloseAll()
        {
            foreach (var position in _robot.Positions)
                _robot.ClosePositionAsync(position);
        }
    
        
        private void ClosePart()
        {
            foreach (var position in _robot.Positions) 
        { 
            
            _robot.ClosePosition(position, 5); 
             
        }
        }
    
    }

    public static class Styles
    {
        public static Style CreatePanelBackgroundStyle()
        {
            var style = new Style();
            style.Set(ControlProperty.CornerRadius, 3);
            style.Set(ControlProperty.BackgroundColor, GetColorWithOpacity(Color.FromHex("#292929"), 0.10m), ControlState.DarkTheme);
            style.Set(ControlProperty.BackgroundColor, GetColorWithOpacity(Color.FromHex("#FFFFFF"), 0.10m), ControlState.LightTheme);
            style.Set(ControlProperty.BorderColor, Color.FromHex("#3C3C3C"), ControlState.DarkTheme);
            style.Set(ControlProperty.BorderColor, Color.FromHex("#C3C3C3"), ControlState.LightTheme);
            style.Set(ControlProperty.BorderThickness, new Thickness(1));

            return style;
        }

        public static Style CreateCommonBorderStyle()
        {
            var style = new Style();
            style.Set(ControlProperty.BorderColor, GetColorWithOpacity(Color.FromHex("#FFFFFF"), 0.12m), ControlState.DarkTheme);
            style.Set(ControlProperty.BorderColor, GetColorWithOpacity(Color.FromHex("#000000"), 0.12m), ControlState.LightTheme);
            return style;
        }

        public static Style CreateHeaderStyle()
        {
            var style = new Style();
            style.Set(ControlProperty.ForegroundColor, GetColorWithOpacity("#FFFFFF", 0.70m), ControlState.DarkTheme);
            style.Set(ControlProperty.ForegroundColor, GetColorWithOpacity("#000000", 0.65m), ControlState.LightTheme);
            return style;
        }

        public static Style CreateInputStyle()
        {
            var style = new Style(DefaultStyles.TextBoxStyle);
            style.Set(ControlProperty.BackgroundColor, Color.FromHex("#1A1A1A"), ControlState.DarkTheme);
            style.Set(ControlProperty.BackgroundColor, Color.FromHex("#111111"), ControlState.DarkTheme | ControlState.Hover);
            style.Set(ControlProperty.BackgroundColor, Color.FromHex("#E7EBED"), ControlState.LightTheme);
            style.Set(ControlProperty.BackgroundColor, Color.FromHex("#D6DADC"), ControlState.LightTheme | ControlState.Hover);
            style.Set(ControlProperty.CornerRadius, 3);
            return style;
        }

        public static Style CreateBuyButtonStyle()
        {
            return CreateButtonStyle(Color.FromHex("#009345"), Color.FromHex("#10A651"));
        }

        public static Style CreateSellButtonStyle()
        {
            return CreateButtonStyle(Color.FromHex("#F05824"), Color.FromHex("#FF6C36"));
        }

        public static Style CreateCloseButtonStyle()
        {
            return CreateButtonStyle(Color.FromHex("#F05824"), Color.FromHex("#FF6C36"));
        }

        private static Style CreateButtonStyle(Color color, Color hoverColor)
        {
            var style = new Style(DefaultStyles.ButtonStyle);
            style.Set(ControlProperty.BackgroundColor, color, ControlState.DarkTheme);
            style.Set(ControlProperty.BackgroundColor, color, ControlState.LightTheme);
            style.Set(ControlProperty.BackgroundColor, hoverColor, ControlState.DarkTheme | ControlState.Hover);
            style.Set(ControlProperty.BackgroundColor, hoverColor, ControlState.LightTheme | ControlState.Hover);
            style.Set(ControlProperty.ForegroundColor, Color.FromHex("#FFFFFF"), ControlState.DarkTheme);
            style.Set(ControlProperty.ForegroundColor, Color.FromHex("#FFFFFF"), ControlState.LightTheme);
            return style;
        }

        private static Color GetColorWithOpacity(Color baseColor, decimal opacity)
        {
            var alpha = (int)Math.Round(byte.MaxValue * opacity, MidpointRounding.AwayFromZero);
            return Color.FromArgb(alpha, baseColor);
        }
    }
}

 

Hi there,

The errors are different this time and they are self explanatory. You are using variables that are not defined anywhere.

Best regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
11 Nov 2024, 14:07

Hi there,

This is not possible at the moment but you can suggest it in Suggestions.

Best regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
11 Nov 2024, 14:05

RE: RE: cTrader web NOT usable lately!!

RobinRaePhoto said: 

PanagiotisCharalampous said: 

Hi there,

Thank you for reporting this issue. Could you please send us some troubleshooting information the next time this happens? Please paste a link to this discussion inside the text box before you submit it.

Best regards,

Panagiotis
 

Thank you for your response. The video instruction did not show how to access the “troubleshooting” submission box. I finally figured out how to access it. I just submitted the troubleshooting information, including the link to this discussion. How will I hear back about this? 

Hi there,

The high memory usage in the browser may be due to a video card issue, which sometimes requires a computer restart to restore performance.

Please restart your Mac and check if your setup meets the minimum system requirements for cTrader. You can review them here: cTrader System Requirements.

If the issue persists, please wait for the next cTrader release, where we are working on fixing any potential issues.

Best regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
11 Nov 2024, 08:47

RE: RE: RE: RE: How to get list of trader history

ctid8575994 said: 

PanagiotisCharalampous said: 

ctid8575994 said: 

PanagiotisCharalampous said: 

Hi there,

It is really hard to help you with this level of information since do not know what you are doing. Your issue could be anywhere, from wrong dates, wrong account id or any other oversight in your code. A way forward would be to reproduce your issue using the example project. If you cannot, the problem is somewhere in your code. If you can, then provide us the necessary information to reproduce it as well.

Best regards,

Panagiotis

Hi,
Thank you for your response. Please visit https://github.com/Agus-Wei/ctrader-openapi for the reproduce code.

Please use below variable values 

appClientId = "11952_cukFsQKaloXkbJIP6Qi95k9jZ4Dqux1ehviD8Xm4rf4NP70Nr6"appClientSecret = "5100bMPPdKnTIkVf4nNdgP752oxzggUgbdd3hKWLr3hldHP5He"accessToken = "7NYgAg33OeHobiiWVTVEafIIZUvD019QVIdHYTGoOdI"

Here is what I get when I try to get Deal List



On app.ctrader.com, I can see my account already have trade history as shown on the screenshot below

Hi there,

I am not an expert in Python but I could not find where do you read the ProtoOADealListRes response.

Best regards,

Panagiotis

Hi,
It is on this part print("Message received: \n", Protobuf.extract(message))

as on below screenshot, it only give me ctidTraderAccountId.

Obviously this method does not do anything more. You would need to write some more code to read the deals out of the extracted message. 


@PanagiotisCharalampous

PanagiotisCharalampous
11 Nov 2024, 08:43

Hi there,

Can you record a video demonstrating what you are looking at?

Best regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
11 Nov 2024, 08:41

Hi there,

Unfortunately this is not possible at the moment. It will be added in a future update of Open API.

Best regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
11 Nov 2024, 08:16

RE: RE: Backtest for a multisymbol strategy crashes after upgrade to ctrader 5.0.x

richardsmits007 said: 

PanagiotisCharalampous said: 

Hi Richard, 

Can you please let us know your broker as well?

Best regards,

Panagiotis

Hi Panagiotis,

I'm using Pepperstone (Europe) as broker.

Best regards,

Richard

Thank you. The issue will be investigated and resolved in an upcoming update


@PanagiotisCharalampous

PanagiotisCharalampous
11 Nov 2024, 07:52

RE: RE: RE: Layout not saved

MeiFungLim said: 

MeiFungLim said: 

PanagiotisCharalampous said: 

Hi there,

Can you record a video so that we can understand what the issue is?

Best regards,

Panagiotis

I'll try illustrate what happened with a screenshot when it disarrayed, instead of a video.
(Because It is impossible to record the disarraying process which will happen when I am away from the keyboard - sleeping/running/taking a break, etc, and it is not possible to video record my chart for 7-8 hours. The video in this case, if captured, will only examplify the already disarrayed tabs instead of the process of being disarrayed. A screenshot of what happened after being disarrayed, will do the work as a video does i.e. to examplify the already disarrayed tabs).

As mentioned earlier, the issue is my tabs become disarrayed which happened after I logged back in i.e. after I logged off to go to sleep or after I logged off to go for a break - a run/a meal, etc). 
I will illustrate with the aid of a screenshot as best as I can.

To illustrate, below is a screenshot of my laid out charts (I do multi frame analysis, 1 instrument (s&p 200) and 1 lead indicator (us 30)).

In this window, you can see that: as I  only trade s&p 200 and am doing multi time frame analysis, my charts are laid out in chronologically in tabs in this category: from Daily to 1 tick - Daily, 4H, 1H, 15 minutes, 5 minutes, 1 minute and 1 tick. 
Each chart contains in a tab (Daily chart tab to tick chart tab)  plays an important role in my multi time frame analysis which I do quickly before I enter into each trade, thus each chart is laid out open neatly in chronological order (from biggest timeframe to smallest timeframe). This way I can form a multi frame analytical view of the price before I enter into a trade (I only have about half an hour before each trade to do the analysis).

To illustrate the difference in the tab:
For example in the Daily timeframe, I do not have much drawings (no lines) to gain an overview of the daily trend. Clean picture.
But in the smaller timeframes, (4H to 15 minutes) I will have more drawings in order to gain a better picture of the strategic levels of entry/exit, especially more (drawings) in the 5 minutes chart tab to tick chart tab, (the more drawings are there) to refine my entry and exit.

To illustrate when the charts become disarrayed:
When disarrayed, the initially Daily chart tab could go to the middle or to the last or wherever in the window - row of tabs.
I will insert a picture and a video after I log back in.
The  initially tick chart tab could become the first tab or the second or again wherever.
Then the initially 4H tab could become the seventh or the fifth or again wherever.

The issues lie on the total of these 2 things:
1. The tab itself cannot be re-arranged, I cannot simply just shift it around
2. Even it does move, it is beyond frustrating to lay the seven tabs (from Daily chart tab to tick chart tab) again.
Why is it frustrating? Because to trade consistently profitably alone is extremely hard, like we all know. And to achieve that I must have certain mindset (disciplined and calm, at the very least). Those mindsets cannot be achieved if my tool is not working properly (I came to the app because the web kept mucking up).

So I hope my explanation is clear to illustrate the frustrating problems.
And you can help this disarraying of saved tabs to be resolved with this example.

Thanks


 

I have just logged back in, and as I said earlier, this is the screenshot of the disarrayed tabs (again the proceess of being disarrayed cannot be captured in the video because I was asleep, as you'd have seen in the time posted earlier).


To speel it ouit, my multi time frame analysis from Daily to tick has now become all voer the place.
C trader, be it web or app, has proven to be not working for me. Web was multi functioning - not saving, causing me a lot of heading whilst trading. App is also not saving. A basic siple key feature in a chart, faulty. Not something I'd ever encountered before. Giving me unnecessary problems.

 

Thank you! I have reported the issue to the product team and it will be resolved in the next update


@PanagiotisCharalampous

PanagiotisCharalampous
11 Nov 2024, 07:01

Hi there,

Workspaces do not synchronize between different applications.

Best regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
11 Nov 2024, 07:00

Hi there,

This tool is only available on cTrader Web at the moment.

Best regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
11 Nov 2024, 06:54

Hi Mark,

Please share your cBot code and backtesting parameters and settings that will allow us to reproduce this problem.

Best regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
11 Nov 2024, 06:52

RE: RE: lock buy sell button

tuuguu177 said: 

PanagiotisCharalampous said: 

Hi there,

Add

using System.Linq;

in the namespaces you use

Best regards,

Panagiotis

I put it but it did not work

Please share the updated cBot code


@PanagiotisCharalampous

PanagiotisCharalampous
11 Nov 2024, 06:48 ( Updated at: 11 Nov 2024, 06:51 )

RE: New update made my algo stop working- backtest not working either

nayibseluja said: 

As I stated in the subject. The new update is not working. Backtest is not getting any trade, and it's not actually loading in some instances. I already deleted and reinstalled and same issues. Can I roll it back? Or can you guys fix this please?

Please create a new thread and explain to us in detail how we can reproduce your issue.


@PanagiotisCharalampous

PanagiotisCharalampous
11 Nov 2024, 06:46

RE: RE: How to get list of trader history

ctid8575994 said: 

PanagiotisCharalampous said: 

Hi there,

It is really hard to help you with this level of information since do not know what you are doing. Your issue could be anywhere, from wrong dates, wrong account id or any other oversight in your code. A way forward would be to reproduce your issue using the example project. If you cannot, the problem is somewhere in your code. If you can, then provide us the necessary information to reproduce it as well.

Best regards,

Panagiotis

Hi,
Thank you for your response. Please visit https://github.com/Agus-Wei/ctrader-openapi for the reproduce code.

Please use below variable values 

appClientId = "11952_cukFsQKaloXkbJIP6Qi95k9jZ4Dqux1ehviD8Xm4rf4NP70Nr6"appClientSecret = "5100bMPPdKnTIkVf4nNdgP752oxzggUgbdd3hKWLr3hldHP5He"accessToken = "7NYgAg33OeHobiiWVTVEafIIZUvD019QVIdHYTGoOdI"

Here is what I get when I try to get Deal List



On app.ctrader.com, I can see my account already have trade history as shown on the screenshot below

Hi there,

I am not an expert in Python but I could not find where do you read the ProtoOADealListRes response.

Best regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
11 Nov 2024, 06:35

Hi there,

Could you please send us some troubleshooting information the next time this happens? Please paste a link to this discussion inside the text box before you submit it.

Best regards,

Panagiotis
 


@PanagiotisCharalampous