What's wrong with cTrader 5.0.28 Optimization Report ?

Created at 30 Aug 2024, 10:27
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!
VI

Vicktor

Joined 24.04.2021

What's wrong with cTrader 5.0.28 Optimization Report ?
30 Aug 2024, 10:27


After installation of cTrader 5.0.28 (it upgraded automatically without my choice) I cannot see the Optimization report.

The result is the following:

Please help.

Vicktor


@Vicktor
Replies

PanagiotisCharalampous
01 Sep 2024, 05:04

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

PanagiotisCharalampous
16 Sep 2024, 07:12

Hi there,

The next time this happens, please send us the contents of C:/Users/%USERNAME%/Documents/cAlgo/Data/cBots/%CBOT NAME% at community@ctrader.com.

Best regards,

Panagiotis


@PanagiotisCharalampous

Vicktor
16 Sep 2024, 21:20

RE: What's wrong with cTrader 5.0.28 Optimization Report ?

PanagiotisCharalampous said: 

Hi there,

The next time this happens, please send us the contents of C:/Users/%USERNAME%/Documents/cAlgo/Data/cBots/%CBOT NAME% at community@ctrader.com.

Best regards,

Panagiotis

Thank you for your replay.

If I understand correctly, I should send the cbot where the issue is happening, but it happens with every bot I use for optimization !!!

Vicktor


@Vicktor

Vicktor
20 Sep 2024, 23:06

RE: What's wrong with cTrader 5.0.28 Optimization Report ?

PanagiotisCharalampous said: 

Hi there,

The next time this happens, please send us the contents of C:/Users/%USERNAME%/Documents/cAlgo/Data/cBots/%CBOT NAME% at community@ctrader.com.

Best regards,

Panagiotis

Hello,

I upgraded to cTrader 5.0.28 but the problems still persists: I cannot see any Report during and after the optimization.

Please help,

Vicktor


@Vicktor

PanagiotisCharalampous
21 Sep 2024, 06:35

RE: RE: What's wrong with cTrader 5.0.28 Optimization Report ?

Vicktor said: 

PanagiotisCharalampous said: 

Hi there,

The next time this happens, please send us the contents of C:/Users/%USERNAME%/Documents/cAlgo/Data/cBots/%CBOT NAME% at community@ctrader.com.

Best regards,

Panagiotis

Hello,

I upgraded to cTrader 5.0.28 but the problems still persists: I cannot see any Report during and after the optimization.

Please help,

Vicktor

Hi Vicktor,

Please follow my instructions above.

Best regards,

Panagiotis


@PanagiotisCharalampous

Vicktor
21 Sep 2024, 21:54

RE: RE: RE: What's wrong with cTrader 5.0.28 Optimization Report ?

PanagiotisCharalampous said: 

Vicktor said: 

PanagiotisCharalampous said: 

Hi there,

The next time this happens, please send us the contents of C:/Users/%USERNAME%/Documents/cAlgo/Data/cBots/%CBOT NAME% at community@ctrader.com.

Best regards,

Panagiotis

Hello,

I upgraded to cTrader 5.0.28 but the problems still persists: I cannot see any Report during and after the optimization.

Please help,

Vicktor

Hi Vicktor,

Please follow my instructions above.

Best regards,

Panagiotis

 

Hello again,

As requested, below is one of the cBots.

Btw, the same issue is with all other cBots.

I got a Mac machine from a friend and I did an extensive comparison using the above mentioned cBot.

Same cBot in a dedicated Windows 10 tower machine (intel i9, 10.900 CPU, 2.80 Ghz, 32 Gb RAM) and same cBot on a dedicated MacMini machine (OS Ventura on Apple M2 processor, 8 Gb RAM)

This is what I found.

  1. even if the Windows machine has more RAM and faster CPU, the optimization is faster with the Mac machine
  2. the “Remaining Time” during the optimization process, with the Mac is accurate, while with the Windows machine is very inaccurate, most often taking double the time declared
  3. with the Mac machine I can see the optimisation results during and after the optimization, while with the Windows machine I can NEVER see the optimization results

 

 

using System;

using System.Linq;

using cAlgo.API;

using cAlgo.API.Indicators;

using cAlgo.API.Internals;

using cAlgo.Indicators;

 

namespace cAlgo.Robots

{

    [Robot(TimeZone = TimeZones.EEuropeStandardTime, AccessRights = AccessRights.None)]

    public class USNDAQ_1D : Robot

    {

        [Parameter("Vol Buy", DefaultValue = 0.2, MinValue = 0, MaxValue = 5)]

        public double VolumeBuy { get; set; }

 

        /[Parameter("MAX BUY", DefaultValue = 1, MinValue = 0, MaxValue = 5)]

        public int MaxBuy { get; set; }

 

        [Parameter("MAX BUY 1", DefaultValue = 1, MinValue = 0, MaxValue = 5)]

        public int MaxBuy_1 { get; set; }

 

        [Parameter("MAX BUY 2", DefaultValue = 1, MinValue = 0, MaxValue = 5)]

        public int MaxBuy_2 { get; set; }

 

        /[Parameter("MAX BUY 3", DefaultValue = 1, MinValue = 0, MaxValue = 5)]

        public int MaxBuy_3 { get; set; }

 

        [Parameter("Trade Type", DefaultValue = 1, MinValue = 1, MaxValue = 2)]

        public int Trade_Type { get; set; }

 

        [Parameter("Close Type", DefaultValue = 1, MinValue = 1, MaxValue = 2)]

        public int Close_Type { get; set; }

 

        [Parameter("SL Type", DefaultValue = 0, MinValue = 0, MaxValue = 3)]

        public int SL_Type { get; set; }

 

        [Parameter("Prpfit Calc", DefaultValue = 4.0, MinValue = 3.0, MaxValue = 5.0, Step = 0.5)]

        public double profit_calc { get; set; }

 

        [Parameter("Bars Period", DefaultValue = 12, MinValue = 1, MaxValue = 200)]

        public int BarsPeriod { get; set; }

 

        [Parameter("Fast Source", Group = "Fast")]

        public DataSeries MAfast { get; set; }

        [Parameter("Fast Period", MinValue = 1, DefaultValue = 5, Group = "Fast")]

        public int MAfastperiod { get; set; }

        [Parameter("Fast Type", DefaultValue = "Simple", Group = "Fast")]

        public MovingAverageType MAfasttype { get; set; }

        private MovingAverage MA_fast;

 

        [Parameter("200 Source", Group = "200")]

        public DataSeries MA200 { get; set; }

        [Parameter("200 Period", MinValue = 50, DefaultValue = 200, Group = "200")]

        public int MA200period { get; set; }

        [Parameter("200 Type", DefaultValue = "Simple", Group = "200")]

        public MovingAverageType MA200type { get; set; }

        private MovingAverage MA_200;

 

        private Bars m60;

        private Bars d1;

        private Bars M1;

 

        public string Titolo = "USNDAQ";

        public string Titolo__Br = "USNDAQ__Br";

        public string Titolo__B1r = "USNDAQ__B1r";

        public string Titolo__B2r = "USNDAQ__B2r";

        public string Titolo__B3r = "USNDAQ__B3r";

       public string m60_high = null;

        public string m60_low = null;

        public double profit_ratio = 0;

 

        // CALC

        protected override void OnStart()

        {

            MA_fast = Indicators.MovingAverage(MAfast, MAfastperiod, MAfasttype);

            MA_200 = Indicators.MovingAverage(MA200, MA200period, MA200type);

            m60 = MarketData.GetBars(TimeFrame.Hour);

            d1 = MarketData.GetBars(TimeFrame.Daily);

            M1 = MarketData.GetBars(TimeFrame.Monthly);

        }

 

        protected override void OnTick()

        {

            bool MA_fast_rise = Functions.IsRising(MA_fast.Result);

            bool MA_fast_fall = Functions.IsFalling(MA_fast.Result);

            bool MA_200_rise = Functions.IsRising(MA_200.Result);

            bool MA_200_fall = Functions.IsFalling(MA_200.Result);

 

            double m60_high = m60.Last(1).High;

            double m60_low = m60.Last(1).Low;

            double D1_high = d1.Last(1).High;

            double D1_low = d1.Last(1).Low;

            double M1_high = M1.Last(1).High;

            double M1_low = M1.Last(1).Low;

 

            Chart.DrawHorizontalLine("d1_High", D1_high, Color.Orange);

            Chart.DrawHorizontalLine("d1_Low", D1_low, Color.Orange);

            Chart.DrawHorizontalLine("M1_High", M1_high, Color.Cyan);

            Chart.DrawHorizontalLine("M1_Low", M1_low, Color.Cyan);

 

            ////////////////////////////////////

            // CLOSE

            ////////////////////////////////////

 

            ///// CLOSE 1

            if (Close_Type == 1)

            {

                // CLOSE BUY

                if (M1_high < D1_high)

                {

                    var close__Br = Positions.FindAll(Titolo__Br);

                    foreach (var positionBr in close__Br)

                    {

                        profit_ratio = Math.Max((positionBr.EntryPrice + (positionBr.EntryPrice * (profit_calc / 100))), M1_high);

                        if (positionBr.NetProfit > 0.1 && Symbol.Ask >= profit_ratio)

                        {

                            positionBr.Close();

                            Print("CLOSE BUY Br");

                        }

                    }

                    var close__B1r = Positions.FindAll(Titolo__B1r);

                    foreach (var positionB1r in close__B1r)

                    {

                        profit_ratio = Math.Max((positionB1r.EntryPrice + (positionB1r.EntryPrice * (profit_calc / 100))), M1_high);

                        if (positionB1r.NetProfit > 0.1 && Symbol.Ask >= profit_ratio)

                        {

                            positionB1r.Close();

                            Print("CLOSE BUY B1r");

                        }

                    }

                    var close__B2r = Positions.FindAll(Titolo__B2r);

                    foreach (var positionB2r in close__B2r)

                    {

                        profit_ratio = Math.Max((positionB2r.EntryPrice + (positionB2r.EntryPrice * (profit_calc / 100))), M1_high);

                        if (positionB2r.NetProfit > 0.1 && Symbol.Ask >= profit_ratio)

                        {

                            positionB2r.Close();

                            Print("CLOSE BUY B2r");

                        }

                    }

                    var close__B3r = Positions.FindAll(Titolo__B3r);

                    foreach (var positionB3r in close__B3r)

                    {

                        profit_ratio = Math.Max((positionB3r.EntryPrice + (positionB3r.EntryPrice * (profit_calc / 100))), M1_high);

                        if (positionB3r.NetProfit > 0.1 && Symbol.Ask >= profit_ratio)

                        {

                            positionB3r.Close();

                            Print("CLOSE BUY B3r");

                        }

                    }

                    if (close__Br.Length > 0 | close__B1r.Length > 0 | close__B2r.Length > 0 | close__B3r.Length > 0)

                    {

                        Chart.DrawHorizontalLine("profit", profit_ratio, Color.Red);

                    }

                }

                else if (M1_high >= D1_high)

                {

                    var close__Br = Positions.FindAll(Titolo__Br);

                    foreach (var positionBr in close__Br)

                    {

                        profit_ratio = Math.Max((positionBr.EntryPrice + (positionBr.EntryPrice * (profit_calc / 100))), M1_high);

                        if (positionBr.NetProfit > 0.1 && Symbol.Ask >= profit_ratio)

                        {

                            positionBr.Close();

                            Print("CLOSE BUY Br");

                        }

                    }

                    var close__B1r = Positions.FindAll(Titolo__B1r);

                    foreach (var positionB1r in close__B1r)

                    {

                        profit_ratio = Math.Max((positionB1r.EntryPrice + (positionB1r.EntryPrice * (profit_calc / 100))), M1_high);

                        if (positionB1r.NetProfit > 0.1 && Symbol.Ask >= profit_ratio)

                        {

                            positionB1r.Close();

                            Print("CLOSE BUY B1r");

                        }

                    }

                    var close__B2r = Positions.FindAll(Titolo__B2r);

                    foreach (var positionB2r in close__B2r)

                    {

                        profit_ratio = Math.Max((positionB2r.EntryPrice + (positionB2r.EntryPrice * (profit_calc / 100))), M1_high);

                        if (positionB2r.NetProfit > 0.1 && Symbol.Ask >= profit_ratio)

                        {

                            positionB2r.Close();

                            Print("CLOSE BUY B2r");

                        }

                    }

                    var close__B3r = Positions.FindAll(Titolo__B3r);

                    foreach (var positionB3r in close__B3r)

                    {

                        profit_ratio = Math.Max((positionB3r.EntryPrice + (positionB3r.EntryPrice * (profit_calc / 100))), M1_high);

                        if (positionB3r.NetProfit > 0.1 && Symbol.Ask >= profit_ratio)

                        {

                            positionB3r.Close();

                            Print("CLOSE BUY B3r");

                        }

                    }

                }

            }

 

            ///// CLOSE 2

            else if (Close_Type == 2)

            {

                // CLOSE BUY

                var close__Br = Positions.FindAll(Titolo__Br);

                foreach (var positionBr in close__Br)

                {

                    profit_ratio = Math.Max((positionBr.EntryPrice + (positionBr.EntryPrice * (profit_calc / 100))), M1_high);

                    if (positionBr.NetProfit > 0.1 && Symbol.Ask >= profit_ratio)

                    {

                        positionBr.Close();

                        Print("CLOSE BUY Br");

                    }

                }

                var close__B1r = Positions.FindAll(Titolo__B1r);

                foreach (var positionB1r in close__B1r)

                {

                    profit_ratio = Math.Max((positionB1r.EntryPrice + (positionB1r.EntryPrice * (profit_calc / 100))), M1_high);

                    if (positionB1r.NetProfit > 0.1 && Symbol.Ask >= profit_ratio)

                    {

                        positionB1r.Close();

                        Print("CLOSE BUY B1r");

                    }

                }

                var close__B2r = Positions.FindAll(Titolo__B2r);

                foreach (var positionB2r in close__B2r)

                {

                    profit_ratio = Math.Max((positionB2r.EntryPrice + (positionB2r.EntryPrice * (profit_calc / 100))), M1_high);

                    if (positionB2r.NetProfit > 0.1 && Symbol.Ask >= profit_ratio)

                    {

                        positionB2r.Close();

                        Print("CLOSE BUY B2r");

                    }

                }

                var close__B3r = Positions.FindAll(Titolo__B3r);

                foreach (var positionB3r in close__B3r)

                {

                    profit_ratio = Math.Max((positionB3r.EntryPrice + (positionB3r.EntryPrice * (profit_calc / 100))), M1_high);

                    if (positionB3r.NetProfit > 0.1 && Symbol.Ask >= profit_ratio)

                    {

                        positionB3r.Close();

                        Print("CLOSE BUY B3r");

                    }

                }

            }

 

 

            ////////////////////////////////////

            // TRADE

            ////////////////////////////////////

 

            if (Symbol.Spread <= 1.3)

            {

                if (Trade_Type == 1)

                {

                    if (d1.Last(1).Close < d1.Last(1).Open && m60.Last(1).Close > d1.Last(1).Open && Symbol.Ask > D1_low && m60_low > D1_low)

                    {

                        var pos_b = Positions.FindAll(Titolo__Br);

                        if (pos_b.Length < MaxBuy && VolumeBuy > 0)

                        {

                            Print("BUY _____ C1 " + Titolo__Br);

                            ExecuteMarketOrder(TradeType.Buy, Symbol.Name, VolumeBuy, Titolo__Br, 0, 0);

                        }

                        var pos_b1 = Positions.FindAll(Titolo__B1r);

                        if (pos_b1.Length < MaxBuy_1 && VolumeBuy > 0)

                        {

                            Print("BUY _____ C1 " + Titolo__B1r);

                            ExecuteMarketOrder(TradeType.Buy, Symbol.Name, VolumeBuy, Titolo__B1r, 0, 0);

                        }

                    }

                }

 

                else if (Trade_Type == 2)

                {

                    if (d1.Last(1).Close < d1.Last(1).Open && Bars.LastBar.Low < D1_low && Symbol.Ask > D1_low && m60_low > D1_low)

                    {

                        var pos_b2 = Positions.FindAll(Titolo__B2r);

                        if (pos_b2.Length < MaxBuy_2 && VolumeBuy > 0)

                        {

                            Print("BUY _____ C1 " + Titolo__B2r);

                            ExecuteMarketOrder(TradeType.Buy, Symbol.Name, VolumeBuy, Titolo__B2r, 0, 0);

                        }

                        var pos_b3 = Positions.FindAll(Titolo__B3r);

                        if (pos_b3.Length < MaxBuy_3 && VolumeBuy > 0)

                        {

                            Print("BUY _____ C1 " + Titolo__B3r);

                            ExecuteMarketOrder(TradeType.Buy, Symbol.Name, VolumeBuy, Titolo__B3r, 0, 0);

                        }

                    }

                }

            }

 

 

            ////////////////////////////////////

            // SL

            ////////////////////////////////////

 

            // SL 1

            if (SL_Type == 1)

            {

                if (VolumeBuy > 0)

                {

                    var position_buy = Positions.FindAll(Titolo__Br);

                    foreach (var open_buy in position_buy)

                    {

                        if (open_buy.NetProfit > Symbol.Spread * 2 && MA_fast_fall == true)

                        {

                            open_buy.ModifyStopLossPrice(open_buy.EntryPrice + Symbol.Spread);

                        }

                        if (open_buy.StopLoss == null)

                        {

                            open_buy.ModifyStopLossPrice(M1_low);

                        }

                    }

                    var position_buy1 = Positions.FindAll(Titolo__B1r);

                    foreach (var open_buy in position_buy1)

                    {

                        if (open_buy.NetProfit > Symbol.Spread * 2 && MA_fast_fall == true)

                        {

                            open_buy.ModifyStopLossPrice(open_buy.EntryPrice + Symbol.Spread);

                        }

                        if (open_buy.StopLoss == null)

                        {

                            open_buy.ModifyStopLossPrice(M1_low);

                        }

                    }

                    var position_buy2 = Positions.FindAll(Titolo__B2r);

                    foreach (var open_buy in position_buy2)

                    {

                        if (open_buy.NetProfit > Symbol.Spread * 2 && MA_fast_fall == true)

                        {

                            open_buy.ModifyStopLossPrice(open_buy.EntryPrice + Symbol.Spread);

                        }

                        if (open_buy.StopLoss == null)

                        {

                            open_buy.ModifyStopLossPrice(M1_low);

                        }

                    }

                    var position_buy3 = Positions.FindAll(Titolo__B3r);

                    foreach (var open_buy in position_buy3)

                    {

                        if (open_buy.NetProfit > Symbol.Spread * 2 && MA_fast_fall == true)

                        {

                            open_buy.ModifyStopLossPrice(open_buy.EntryPrice + Symbol.Spread);

                        }

                        if (open_buy.StopLoss == null)

                        {

                            open_buy.ModifyStopLossPrice(M1_low);

                        }

                    }

                }

            }

 

            // SL 2

            else if (SL_Type == 2)

            {

                if (VolumeBuy > 0)

                {

                    var position_buy = Positions.FindAll(Titolo__Br);

                    foreach (var open_buy in position_buy)

                    {

                        if (open_buy.NetProfit > Symbol.Spread * 2 && MA_fast_fall == true)

                        {

                            open_buy.ModifyStopLossPrice(open_buy.EntryPrice + Symbol.Spread);

                        }

                        if (open_buy.StopLoss == null)

                        {

                            open_buy.ModifyStopLossPrice(MA_200.Result.LastValue - (Symbol.Spread * BarsPeriod));

                        }

                    }

                    var position_buy1 = Positions.FindAll(Titolo__B1r);

                    foreach (var open_buy in position_buy1)

                    {

                        if (open_buy.NetProfit > Symbol.Spread * 2 && MA_fast_fall == true)

                        {

                            open_buy.ModifyStopLossPrice(open_buy.EntryPrice + Symbol.Spread);

                        }

                        if (open_buy.StopLoss == null)

                        {

                            open_buy.ModifyStopLossPrice(MA_200.Result.LastValue - (Symbol.Spread * BarsPeriod));

                        }

                    }

                    var position_buy2 = Positions.FindAll(Titolo__B2r);

                    foreach (var open_buy in position_buy2)

                    {

                        if (open_buy.NetProfit > Symbol.Spread * 2 && MA_fast_fall == true)

                        {

                            open_buy.ModifyStopLossPrice(open_buy.EntryPrice + Symbol.Spread);

                        }

                        if (open_buy.StopLoss == null)

                        {

                            open_buy.ModifyStopLossPrice(MA_200.Result.LastValue - (Symbol.Spread * BarsPeriod));

                        }

                    }

                    var position_buy3 = Positions.FindAll(Titolo__B3r);

                    foreach (var open_buy in position_buy3)

                    {

                        if (open_buy.NetProfit > Symbol.Spread * 2 && MA_fast_fall == true)

                        {

                            open_buy.ModifyStopLossPrice(open_buy.EntryPrice + Symbol.Spread);

                        }

                        if (open_buy.StopLoss == null)

                        {

                            open_buy.ModifyStopLossPrice(MA_200.Result.LastValue - (Symbol.Spread * BarsPeriod));

                        }

                    }

                }

            }

 

            // SL 3

            else if (SL_Type == 3)

            {

                if (VolumeBuy > 0)

                {

                    var position_buy = Positions.FindAll(Titolo__Br);

                    foreach (var open_buy in position_buy)

                    {

                        open_buy.ModifyStopLossPrice(MA_200.Result.LastValue - (Symbol.Spread * BarsPeriod));

                    }

                    var position_buy1 = Positions.FindAll(Titolo__B1r);

                    foreach (var open_buy in position_buy1)

                    {

                        open_buy.ModifyStopLossPrice(MA_200.Result.LastValue - (Symbol.Spread * BarsPeriod));

                    }

                    var position_buy2 = Positions.FindAll(Titolo__B2r);

                    foreach (var open_buy in position_buy2)

                    {

                        open_buy.ModifyStopLossPrice(MA_200.Result.LastValue - (Symbol.Spread * BarsPeriod));

                    }

                    var position_buy3 = Positions.FindAll(Titolo__B3r);

                    foreach (var open_buy in position_buy3)

                    {

                        open_buy.ModifyStopLossPrice(MA_200.Result.LastValue - (Symbol.Spread * BarsPeriod));

                    }

                }

            }

 

        }

    }

}


 


@Vicktor

PanagiotisCharalampous
22 Sep 2024, 05:11

RE: RE: RE: RE: What's wrong with cTrader 5.0.28 Optimization Report ?

Hi Vicktor,

I did not ask for the cBot's source code. I asked for the contents of C:/Users/%USERNAME%/Documents/cAlgo/Data/cBots/%CBOT NAME%  to be sent at community@ctrader.com.

Best regards,

Panagiotis

 


@PanagiotisCharalampous

Vicktor
22 Sep 2024, 16:50

RE: RE: RE: RE: RE: What's wrong with cTrader 5.0.28 Optimization Report ?

PanagiotisCharalampous said: 

Hi Vicktor,

I did not ask for the cBot's source code. I asked for the contents of C:/Users/%USERNAME%/Documents/cAlgo/Data/cBots/%CBOT NAME%  to be sent at community@ctrader.com.

Best regards,

Panagiotis

 

Sorry for the misunderstanding.

As requested I sent the compressed copy of the folder cBots to community@ctrader.com.

Please keep me updated and thank you for your kind assistance.

Vicktor


@Vicktor

PanagiotisCharalampous
23 Sep 2024, 05:22

RE: RE: RE: RE: RE: RE: What's wrong with cTrader 5.0.28 Optimization Report ?

Vicktor said: 

PanagiotisCharalampous said: 

Hi Vicktor,

I did not ask for the cBot's source code. I asked for the contents of C:/Users/%USERNAME%/Documents/cAlgo/Data/cBots/%CBOT NAME%  to be sent at community@ctrader.com.

Best regards,

Panagiotis

 

Sorry for the misunderstanding.

As requested I sent the compressed copy of the folder cBots to community@ctrader.com.

Please keep me updated and thank you for your kind assistance.

Vicktor

Hi Vicktor,

Thanks. Email received and forwarded to the product team.

Best regards,

Panagiotis


@PanagiotisCharalampous