Topics
08 Sep 2023, 19:06
 511
 2
Replies

Algo_robot
11 Nov 2024, 15:08 ( Updated at: 12 Nov 2024, 06:20 )

RE: cTrader 5, wrong backtesting result, when not using Visual Mode. m1 Bars.

Hi,

It happens on any cBot in cTrader 5. Also, with the already built in “Sample RSI cBot”.

I am experiencing an issue with cTrader 5 when conducting a backtest using m1 bars in Visual Mode compared to non-Visual Mode, which produces vastly different outcomes. The results obtained in Visual Mode are accurate, and this discrepancy needs resolution. The optimization result using m1 bars is also inaccurate just like the backtesting result when not using visual mode.

 

Video=

https://youtu.be/6b7uyPiow-k


@Algo_robot

Algo_robot
04 Jun 2024, 07:11 ( Updated at: 04 Jun 2024, 07:29 )

thanks


@Algo_robot

Algo_robot
25 May 2024, 10:34 ( Updated at: 25 May 2024, 14:55 )

I made a Windows backup (restore point) today and copied the original cAlgo folder to another disk to save my cBots etc... 

Then, I deleted the entire cAlgo folder from my documents on the C drive. 

When I tried to open the new cTrader, it started, and now I have cTrader 5.0. 

- I will copy my cBots from the original backup folder on the other disk to the new cAlgo folder the cTrader just created. 

- or I will try to identify the problem in the first cAlgo folder, using my first windows restore point.

 

UPDATE:

Problem identified: 

*The problem was in the "cAlgo/Sources/Robots" folder. Even when I deleted all the cBots one by one in the ICM cTrader platform, there were still some left in the "Robots" folder. When I deleted those cBots from the “Robots” folder, I was able to start the new cTrader 5.0


@Algo_robot

Algo_robot
20 May 2024, 13:25 ( Updated at: 21 May 2024, 05:35 )

Hi, cTrader team.

Somehow, I posted it twice..

Please delete this post:

 https://ctrader.com/algos/cbots/show/4254

 

If you could also remove my comment from here:

https://ctrader.com/algos/cbots/show/3150#comment-4424

 

 

And after you remove both the post and the comment, if you please remove this thread, me asking you to do all this.. 

Thanks a lot


@Algo_robot

Algo_robot
10 Oct 2023, 11:13 ( Updated at: 11 Oct 2023, 06:33 )

The issue has been resolved.

Trader "kstiks" didn't have the new .NET 6 installed. 

For those who are unable to optimize the cBot due to using .NET 4, please download and install .NET 6 from the following 

link: https://dotnet.microsoft.com/en-us/download

My cBot is built using .NET 6.

 

Thank you

Best regards,

Mark


@Algo_robot

Algo_robot
10 Oct 2023, 09:47

RE: Problem with optimization

PanagiotisChar said: 

Hi there,

Can he click on the optimization passes and check the logs? There could be some useful information there.

 


I requested that he perform this action, but he mentioned that the Log is empty.

It's worth noting that all other eight individuals who have rented the cBot for a month have been able to run optimization in cTrader without any issues.

However, this particular individual is unable to optimize the cBot, despite having an i5 processor and 16 GB of RAM, along with a Windows 11 operating system.

I'm puzzled as to what could be causing this specific issue. 

 

Do you have any other advice or ideas regarding the possible cause of this issue? 

If anyone else has insights or suggestions, please don't hesitate to share them.

 


@Algo_robot

Algo_robot
08 Oct 2023, 12:06 ( Updated at: 09 Oct 2023, 12:53 )

RE: Problem with optimization

PanagiotisChar said: 

Hi there,

Can you provide exact steps to reproduce this problem?

 

Hello Panagiotis Char,

I hold immense respect for your contributions to cTrader.

I'm reaching out regarding a situation with a client of mine, trader "kstiks," who rented my cBot ( https://ctrader.com/algos/cbots/show/3678 ).

The issue at hand is that he can successfully conduct backtests with the cBot, but he encounters difficulties when attempting to optimize it. He can't optimize the cBot.

 Are there any insights or ideas you might have about the possible reasons behind this problem?

I greatly appreciate your advice and assistance.

Thank you.

YouTube video:

(He waited patiently for some time after recording this video, hoping to see if he would receive any optimization results at all. Unfortunately, the optimization process only yields zeros.)

https://www.youtube.com/watch?v=6j3hhMoooiU&ab_channel=PROTraderEurope

 


@Algo_robot

Algo_robot
03 Oct 2023, 10:10 ( Updated at: 03 Oct 2023, 10:59 )

Dear cTrader,

 

When will I be able to edit my post?

https://ctrader.com/algos/cbots/show/3678

 

I would like to add this at the end of the post:

 


You are welcome to test this  robot for free until October 3, 2023. After that date, the robot will no longer open any new trades. However, you can still conduct backtesting and optimization with it up to that date. Please be aware that the results may differ based on the broker you use. The robot has been specifically optimized for IC Markets. If you opt for a different broker, I suggest optimizing the robot to ensure it operates at its best under your chosen broker's conditions and data feed. This will help you achieve the optimal results for your trading strategy.


@Algo_robot

Algo_robot
11 Sep 2023, 08:57

RE: cTrader algo site error

Spotware said: 

Dear trader,

Thank you for reporting this. Can you please try now?

Best regards,

cTrader Team

Dear cTrader,

I am very grateful for your prompt and effective solution. It works perfectly now.

I would like to express my appreciation for the opportunity to use the cTrader. It is the only platform I trade on. Thanks to you, I can create cBots or trade manually and achieve good profits. I don’t know what I would do without you. The cTrader is the most advanced platform there is. You guys are awesome!

Best regards,

Mark


@Algo_robot

Algo_robot
30 Aug 2023, 17:29

AROON

I tried with different approaches. And when I enable the AROON only sell positions are open, or when I try with a different approach in the source code it won't even open any trades..

Anyone can help me fix this?

1. cBot only opens sell positions!

 [Parameter("Use Aroon Logic", Group = "Aroon Logic", DefaultValue = false)]
public bool UseAroonLogic { get; set; }

[Parameter("Aroon Periods", Group = "Aroon Logic", DefaultValue = 25)]
public int AroonPeriods { get; set; }

[Parameter("Aroon Up Threshold (%)", Group = "Aroon Logic", DefaultValue = 70, MinValue = 0, MaxValue = 100)]
public double AroonUpThresholdPercentage { get; set; }

[Parameter("Aroon Down Threshold (%)", Group = "Aroon Logic", DefaultValue = 30, MinValue = 0, MaxValue = 100)]
public double AroonDownThresholdPercentage { get; set; }

private Aroon _accumulativeSwingIndex;

OnStart

aroon = Indicators.Aroon(AroonPeriods);
            _accumulativeSwingIndex = Indicators.Aroon(AroonPeriods);

 

if (UseAroonLogic)
{
    aroon = Indicators.Aroon(AroonPeriods);
}

 

OnBar

 

   var currentAroonUp = _accumulativeSwingIndex.Up.Last(0);
    var currentAroonDown = _accumulativeSwingIndex.Down.Last(0);
    var previousAroonUp = _accumulativeSwingIndex.Up.Last(1);
    var previousAroonDown = _accumulativeSwingIndex.Down.Last(1);
    
    
    // Calculate the dynamic thresholds based on the Aroon values and user-defined percentages
double aroonUpThreshold = currentAroonUp * (AroonUpThresholdPercentage / 80.0);
double aroonDownThreshold = currentAroonDown * (AroonDownThresholdPercentage / 20.0);

 

BUY

(!UseAroonLogic || (UseAroonLogic && currentAroonUp > aroonUpThreshold && currentAroonDown < aroonDownThreshold))

 

SELL

(!UseAroonLogic || (UseAroonLogic && currentAroonUp > aroonUpThreshold && currentAroonDown < aroonDownThreshold))


 

 2. cBot won't open any positions if I enable the Aroon logic.

 

[Parameter("Use Aroon Logic", Group = "Aroon Logic", DefaultValue = false)]
public bool UseAroonLogic { get; set; }

[Parameter("Aroon Periods", Group = "Aroon Logic", DefaultValue = 25)]
public int AroonPeriods { get; set; }

(thresholds already defined in the OnBar method)

 

private Aroon _accumulativeSwingIndex;

OnStart

if (UseAroonLogic)
{
    aroon = Indicators.Aroon(AroonPeriods);
}

OnBar / OnTick 

// Define the fixed Aroon thresholds for buy and sell signals
const double BuyAroonUpThreshold = 90;
const double BuyAroonDownThreshold = 10;
const double SellAroonUpThreshold = 10;
const double SellAroonDownThreshold = 90;

 

BUY

(!UseAroonLogic || (UseAroonLogic && _accumulativeSwingIndex.Up.Last(0) > BuyAroonUpThreshold && _accumulativeSwingIndex.Down.Last(0) < BuyAroonDownThreshold)) 

SELL

(!UseAroonLogic || (UseAroonLogic && _accumulativeSwingIndex.Up.Last(0) > SellAroonUpThreshold && _accumulativeSwingIndex.Down.Last(0) < SellAroonDownThreshold)) 

 

 

 


@Algo_robot

Algo_robot
21 Aug 2023, 07:24 ( Updated at: 21 Dec 2023, 09:23 )

RE: Delete these posts that I created. cBots

Spotware said: 

Dear trader,

We have deleted your cBots. You should be able to delete your own cBots now.

Best regards,

cTrader Team

 

Dear cTrader

 

Thank you very much for deleting the old posts / cBots.

 

I'm still not able to delete my own cBots / posts. Could you please make this happen?

The delete button is not visible.

 


@Algo_robot

Algo_robot
12 Aug 2023, 20:31 ( Updated at: 15 Jan 2024, 14:48 )

I wrote to you about this scammer spammer 2 days ago.

Please remove his post or the robot he uploaded.

The scammer uploaded my robot. 

 

This is a security risk! If someone wants to buy the robot, and he contacts the scammer/spammer and pays the money, people will think I screwed them.  People already bought my robots, and I am not a scammer. I want people to trust me. I write so many emails to the people who are interested in my robot, and I teach them how to use the  cTrader.. I teach them how to backtest and optimize my robot and so much more. I work really hard all day long.

I do not deserve the disrespect these scammers are showing. 

 

Please do something about the spam post and the scammer:

SCAMMER LINK:  [https://ctrader.com/algos/cbots/show/3556]

 

Thanks for understanding.

 


@Algo_robot

Algo_robot
10 Aug 2023, 20:41 ( Updated at: 15 Jan 2024, 14:49 )

RE: RE: How do i delete the cBot I uploaded?

algorithmic.trading.eu_gmail.com said: 

Spotware said: 

Dear trader,

Please share with us the link of your cBot and we will delete it for you.

Best regards,

cTrader Team

 

These are the cBots I posted. Please delete the posts:

[https://ctrader.com/algos/cbots/show/3369]

[https://ctrader.com/algos/cbots/show/3375]

[https://ctrader.com/algos/cbots/show/3389]

[https://ctrader.com/algos/cbots/show/3507]

[https://ctrader.com/algos/cbots/show/3381]

[https://ctrader.com/algos/cbots/show/3529]

 

Thank you

 


@Algo_robot

Algo_robot
10 Aug 2023, 20:38 ( Updated at: 15 Jan 2024, 14:49 )

RE: How do i delete the cBot I uploaded?

Spotware said: 

Dear trader,

Please share with us the link of your cBot and we will delete it for you.

Best regards,

cTrader Team

 

These are the cBots I posted. Please delete the posts:

[https://ctrader.com/algos/cbots/show/3369]

[https://ctrader.com/algos/cbots/show/3375]

[https://ctrader.com/algos/cbots/show/3389]

[https://ctrader.com/algos/cbots/show/3507]

[https://ctrader.com/algos/cbots/show/3381]

[https://ctrader.com/algos/cbots/show/3529]

 

Thank you


@Algo_robot

Algo_robot
21 Apr 2023, 10:07

RE:

Spotware said:

Dear trader,

Can you please provide us with the source code of a cBot that will allow us to reproduce this problem?

Best regards,

cTrader Team

Hello cTrader team.

 

The optimization is not slow anymore. It works great now.

Thank you very much.

Kind regards


@Algo_robot

Algo_robot
20 Apr 2023, 11:06

Just to be clear. Will this issue be resolved?

Have you tried the source code I gave you?

I would really like to see this working like it should be working:

  [Parameter("Quantity (Lots)", Group = "Volume", DefaultValue = 0.01, MinValue = 0.01, Step = 0.01)]
        public double Quantity { get; set; }

 


@Algo_robot

Algo_robot
20 Apr 2023, 11:02

RE:

thebeinvest said:

I'm trying to optimize a cBot in cTrader Desktop version 4.7.7, but it freezes and doesn't perform trades. On a VPS server with version 4.6.6 it is working, however, very slow because it is a server with low hardware.
On my normal PC, it was working normally in versions prior to optimization.

Hi,

Maybe you have the same problem as I had. Add some virtual RAM. Now my optimization is not freezing.

Check this post where cTrader team helped me with his problem.

 


@Algo_robot

Algo_robot
18 Apr 2023, 23:15 ( Updated at: 18 Apr 2023, 23:33 )

RE:

PanagiotisChar said:

Hi there,

Can you share some code so that we can try it too?

Aieden Technologies

Need help? Join us on Telegram

Need premium support? Trade with us

 

Hi PanagiotisChar. I'm a big fan of yours. You helped cTrader become the best and most advanced platform there is. I have huge respect for you.

 

I've found an already-built-in cBot by cTrader that uses Quantity. There is an error in ''Step = 0.01''

 

Sample Breakout cBot

// -------------------------------------------------------------------------------------------------
//
//    This code is a cTrader Automate API example.
//
//    This cBot is intended to be used as a sample and does not guarantee any particular outcome or
//    profit of any kind. Use it at your own risk.
//    
//    All changes to this file might be lost on the next application update.
//    If you are going to modify this file please make a copy using the "Duplicate" command.
//
//    The "Sample Breakout cBot" will check the difference in pips between the Upper Bollinger Band and the Lower Bollinger Band 
//    and compare it against the "Band Height" parameter specified by the user.  If the height  is lower than the number of pips 
//    specified, the market is considered to be consolidating, and the first candlestick to cross the upper or lower band will 
//    generate a buy or sell signal. The user can specify the number of periods that the market should be consolidating in the 
//    "Consolidation Periods" parameter. The position is closed by a Stop Loss or Take Profit.  
//
// -------------------------------------------------------------------------------------------------
using System;
using System.Linq;
using cAlgo.API;
using cAlgo.API.Indicators;
using cAlgo.API.Internals;
using cAlgo.Indicators;

namespace cAlgo
{
    [Robot(TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)]
    public class SampleBreakoutcBot : Robot
    {

        [Parameter("Quantity (Lots)", Group = "Volume", DefaultValue = 0.01, MinValue = 0.01, Step = 0.01)]
        public double Quantity { get; set; }

        [Parameter("Stop Loss (pips)", Group = "Protection", DefaultValue = 20, MinValue = 1)]
        public int StopLossInPips { get; set; }

        [Parameter("Take Profit (pips)", Group = "Protection", DefaultValue = 40, MinValue = 1)]
        public int TakeProfitInPips { get; set; }

        [Parameter("Source", Group = "Bollinger Bands")]
        public DataSeries Source { get; set; }

        [Parameter("Band Height (pips)", Group = "Bollinger Bands", DefaultValue = 40.0, MinValue = 0)]
        public double BandHeightPips { get; set; }

        [Parameter("Bollinger Bands Deviations", Group = "Bollinger Bands", DefaultValue = 2)]
        public double Deviations { get; set; }

        [Parameter("Bollinger Bands Periods", Group = "Bollinger Bands", DefaultValue = 20)]
        public int Periods { get; set; }

        [Parameter("Bollinger Bands MA Type", Group = "Bollinger Bands")]
        public MovingAverageType MAType { get; set; }

        [Parameter("Consolidation Periods", Group = "Bollinger Bands", DefaultValue = 2)]
        public int ConsolidationPeriods { get; set; }

        BollingerBands bollingerBands;
        string label = "Sample Breakout cBot";
        int consolidation;

        protected override void OnStart()
        {
            bollingerBands = Indicators.BollingerBands(Source, Periods, Deviations, MAType);
        }

        protected override void OnBar()
        {

            var top = bollingerBands.Top.Last(1);
            var bottom = bollingerBands.Bottom.Last(1);

            if (top - bottom <= BandHeightPips * Symbol.PipSize)
            {
                consolidation = consolidation + 1;
            }
            else
            {
                consolidation = 0;
            }

            if (consolidation >= ConsolidationPeriods)
            {
                var volumeInUnits = Symbol.QuantityToVolumeInUnits(Quantity);
                if (Ask > top)
                {
                    ExecuteMarketOrder(TradeType.Buy, SymbolName, volumeInUnits, label, StopLossInPips, TakeProfitInPips);

                    consolidation = 0;
                }
                else if (Bid < bottom)
                {
                    ExecuteMarketOrder(TradeType.Sell, SymbolName, volumeInUnits, label, StopLossInPips, TakeProfitInPips);

                    consolidation = 0;
                }
            }
        }
    }
}


@Algo_robot

Algo_robot
18 Apr 2023, 23:09 ( Updated at: 18 Apr 2023, 23:28 )

RE:

firemyst said:

I feel like it should work as you have it.

However, perhaps it's acting the way it does because with some brokers like IC Markets, users cannot trade in 0.01 lots. I believe their minimum is 0.1 lots. Maybe that's the issue?

I would try you code on two different brokers that allow for different sizes. For instance, Pepperstone allows for 0.01 lots, so try it with Pepperstone and then IC Markets and see what happens?

IC Markets allows 0.01 Lot. I tried the bot on different brokers. The problem is the same.

I've found an already-built-in cBot by cTrader that uses Quantity. There is an error in 'Step = 0.01' '

Sample Breakout cBot (already build in cBot by cTrader)

// -------------------------------------------------------------------------------------------------
//
//    This code is a cTrader Automate API example.
//
//    This cBot is intended to be used as a sample and does not guarantee any particular outcome or
//    profit of any kind. Use it at your own risk.
//    
//    All changes to this file might be lost on the next application update.
//    If you are going to modify this file please make a copy using the "Duplicate" command.
//
//    The "Sample Breakout cBot" will check the difference in pips between the Upper Bollinger Band and the Lower Bollinger Band 
//    and compare it against the "Band Height" parameter specified by the user.  If the height  is lower than the number of pips 
//    specified, the market is considered to be consolidating, and the first candlestick to cross the upper or lower band will 
//    generate a buy or sell signal. The user can specify the number of periods that the market should be consolidating in the 
//    "Consolidation Periods" parameter. The position is closed by a Stop Loss or Take Profit.  
//
// -------------------------------------------------------------------------------------------------
using System;
using System.Linq;
using cAlgo.API;
using cAlgo.API.Indicators;
using cAlgo.API.Internals;
using cAlgo.Indicators;

namespace cAlgo
{
    [Robot(TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)]
    public class SampleBreakoutcBot : Robot
    {

        [Parameter("Quantity (Lots)", Group = "Volume", DefaultValue = 0.01, MinValue = 0.01, Step = 0.01)]
        public double Quantity { get; set; }

        [Parameter("Stop Loss (pips)", Group = "Protection", DefaultValue = 20, MinValue = 1)]
        public int StopLossInPips { get; set; }

        [Parameter("Take Profit (pips)", Group = "Protection", DefaultValue = 40, MinValue = 1)]
        public int TakeProfitInPips { get; set; }

        [Parameter("Source", Group = "Bollinger Bands")]
        public DataSeries Source { get; set; }

        [Parameter("Band Height (pips)", Group = "Bollinger Bands", DefaultValue = 40.0, MinValue = 0)]
        public double BandHeightPips { get; set; }

        [Parameter("Bollinger Bands Deviations", Group = "Bollinger Bands", DefaultValue = 2)]
        public double Deviations { get; set; }

        [Parameter("Bollinger Bands Periods", Group = "Bollinger Bands", DefaultValue = 20)]
        public int Periods { get; set; }

        [Parameter("Bollinger Bands MA Type", Group = "Bollinger Bands")]
        public MovingAverageType MAType { get; set; }

        [Parameter("Consolidation Periods", Group = "Bollinger Bands", DefaultValue = 2)]
        public int ConsolidationPeriods { get; set; }

        BollingerBands bollingerBands;
        string label = "Sample Breakout cBot";
        int consolidation;

        protected override void OnStart()
        {
            bollingerBands = Indicators.BollingerBands(Source, Periods, Deviations, MAType);
        }

        protected override void OnBar()
        {

            var top = bollingerBands.Top.Last(1);
            var bottom = bollingerBands.Bottom.Last(1);

            if (top - bottom <= BandHeightPips * Symbol.PipSize)
            {
                consolidation = consolidation + 1;
            }
            else
            {
                consolidation = 0;
            }

            if (consolidation >= ConsolidationPeriods)
            {
                var volumeInUnits = Symbol.QuantityToVolumeInUnits(Quantity);
                if (Ask > top)
                {
                    ExecuteMarketOrder(TradeType.Buy, SymbolName, volumeInUnits, label, StopLossInPips, TakeProfitInPips);

                    consolidation = 0;
                }
                else if (Bid < bottom)
                {
                    ExecuteMarketOrder(TradeType.Sell, SymbolName, volumeInUnits, label, StopLossInPips, TakeProfitInPips);

                    consolidation = 0;
                }
            }
        }
    }
}


@Algo_robot

Algo_robot
18 Apr 2023, 22:56 ( Updated at: 21 Dec 2023, 09:23 )

RE:

Spotware said:

Dear trader,

The error indicates that your system has run out of memory. What is your computer's physical and virtual RAM? Is paging file enabled? If no, please enable it.

Best regards,

cTrader Team

I changed it to 80000 mb.

 

I hope this is correct. Please let me know if it's not correct.

Screenshots:

 

 

 


@Algo_robot