Replies

PattyTradeTeam
04 Nov 2024, 19:58

cTrader 5.0.40

Same frustrating problems.
Incredibly, aspects there were working until a week ago with previous version now are totally messed up.

I have written a long thread in the Suggestions section with a list of various bugs.
For now it is not been published, I hope that they do not delete it.


@PattyTradeTeam

PattyTradeTeam
18 Jan 2023, 12:15

RE:

Spotware said:

Dear trader,

The latest version of cTrader is 4.5.6. Please let us know if you still experience issues with the latest version.

Best regards,

cTrader Team

Actually from Spotware site the version that I was able to download is cTrader desktop for Windows 4.5.7

I made a preliminary test:

  1. Two of the most annoying issues still remain, i.e. NO auto-spacing and NO auto-tab when saving/buiding a cBot

Honestly, I would think that the above issue should be easily visible from your side without my feedback !

I had no time yet to test RAM usage and speed test but with the above issue I will not use version 4.5.7 since in version 4.1 they work fine.


@PattyTradeTeam

PattyTradeTeam
11 Jul 2022, 14:49

RE: Example of Robot

Hi Panagiotis,

this is an example robot as you requested.

 

 

 

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 Example_Robot : Robot

    {

        [Parameter("Volume Buy", DefaultValue = 2, MinValue = 0, MaxValue = 5)]

        public double VolumeBuy { get; set; }

        [Parameter("Volume Sell", DefaultValue = 2, MinValue = 0, MaxValue = 5)]

        public double VolumeSell { get; set; }

 

        //MAX BUY

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

        public int MaxBuy { get; set; }

 

        //MAX SELL

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

        public int MaxSell { get; set; }

 

        // MA FAST

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

        public DataSeries MAfast { get; set; }

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

        public int MAfastperiod { get; set; }

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

        public MovingAverageType MAfasttype { get; set; }

        private MovingAverage MA_fast;

 

        // MA SLOW

        [Parameter("MA Slow Source", Group = "MA Slow")]

        public DataSeries MAslow { get; set; }

        [Parameter("MA Slow Period", DefaultValue = 13, Group = "MA Slow")]

        public int MAslowperiod { get; set; }

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

        public MovingAverageType MAslowtype { get; set; }

        private MovingAverage MA_slow;

 

        // CALC

        protected override void OnStart()

        {

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

            MA_slow = Indicators.MovingAverage(MAslow, MAslowperiod, MAslowtype);

        }

 

        protected override void OnTick()

        {

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

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

            bool MA_slow_rise = Functions.IsRising(MA_slow.Result);

            bool MA_slow_fall = Functions.IsFalling(MA_slow.Result);

 

            double max = Functions.Maximum(Bars.ClosePrices, 12);

            double min = Functions.Minimum(Bars.ClosePrices, 12);

            Chart.DrawHorizontalLine("max", max, Color.Blue);

            Chart.DrawHorizontalLine("min", min, Color.Yellow);

 

            // CLOSE BUY

            if (MA_fast_fall == true)

            {

                var pos_USNDAQ_B = Positions.FindAll("USNDAQ_B");

                foreach (var position in pos_USNDAQ_B)

                {

                    if (position.NetProfit > 0.1)

                    {

                        position.Close();

                        Print("CLOSE BUY");

                    }

                }

            }

            // CLOSE SELL

            if (MA_fast_rise == true)

            {

                var pos_USNDAQ_S = Positions.FindAll("USNDAQ_S");

                foreach (var position in pos_USNDAQ_S)

                {

                    if (position.NetProfit > 0.1)

                    {

                        position.Close();

                        Print("CLOSE SELL");

                    }

                }

            }

 

            // TRADE

            var pos_buy = Positions.FindAll("USNDAQ_B");

            var pos_sell = Positions.FindAll("USNDAQ_S");

            if (pos_buy.Length < MaxBuy && pos_sell.Length < MaxSell)

            {

 

                // BUY

                if (MA_slow_rise == true)

                {

                    if (MA_fast_rise == true)

                    {

                        if (Bars.LastBar.Close > MA_fast.Result.LastValue)

                        {

                            var pos_b_USNDAQ = Positions.FindAll("USNDAQ_B");

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

                            {

                                Print("BUY");

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

                            }

                        }

                    }

                }

 

                // SELL

                if (MA_slow_fall == true)

                {

                    if (MA_fast_fall == true)

                    {

                        if (Bars.LastBar.Close < MA_fast.Result.LastValue)

                        {

                            var pos_s_USNDAQ = Positions.FindAll("USNDAQ_S");

                            if (pos_s_USNDAQ.Length < MaxSell && VolumeSell > 0)

                            {

                                Print("SELL");

                                ExecuteMarketOrder(TradeType.Sell, Symbol.Name, VolumeSell, "USNDAQ_S", 0, 0);

                            }

                        }

                    }

                }

 

            }

        }

    }

}

 

 

 

 


@PattyTradeTeam