Automated_Trading
Automated_Trading's avatar

Info

Username:Automated_Trading
Name:Automated_Trading
Member since: 28 Jul 2022

About

None

Signature

None

Last Forum Posts

@Losing trade missing in cTrader desktop History.:  05 Jun 2023, 10:37


Spotware said:

Dear Automated_Trading,

We managed to reproduce this issue and we will fix in in an upcoming update.

Best regards,

cTrader Team

Thank you. I'm looking forward to it.

(I tried reinstalling the cTrader 4.7.9, but it didn't solve the problem. It loads the data every time I backtest a bot)

Best regards

@Losing trade missing in cTrader desktop History.:  29 May 2023, 09:32


Automated_Trading said:

firemyst said:

Read this thread and do what's suggested:

Now the cTrader is loading the data each time I want to optimize or backtest the bot. I ran the backtesting letting the data load. I tried again using the same history, but it loads the data again. It is not saving the data. I closed the cTrader and restarted my computer several times, but the problem persists.

Do you maybe know how to fix this?

Another thing I noticed:

 The data is probably saved, because my disk space is getting smaller when I run the optimization/backtesting, but the cTrader 4.7.9 is not using the already saved data. Maybe this is the problem? 

All I did was going to settings / General and 'reset local data to default'. I didn't know It will have to load the data now each time I want to run the backtesting.

You think I'll have to reinstall the cTrader 4.7.9 or is there a better solution? I already have my bots running. Too bad it's not a weekend.

I would run my bots on ICM cTrader 4.6 but it keeps freezing.

Can someone help me fix the problem I'm having? I run the backtesting almost every day, and I'm running the optimization all the time. Loading the data each time is very time-consuming.

@Losing trade missing in cTrader desktop History.:  28 May 2023, 22:30


firemyst said:

Read this thread and do what's suggested:

Now the cTrader is loading the data each time I want to optimize or backtest the bot. I ran the backtesting letting the data load. I tried again using the same history, but it loads the data again. It is not saving the data. I closed the cTrader and restarted my computer several times, but the problem persists.

Do you maybe know how to fix this?

@Losing trade missing in cTrader desktop History.:  28 May 2023, 22:01


firemyst said:

Read this thread and do what's suggested:

Thank you. That worked. Problem solved.

((I noticed the cTrader icons from my 'Multiple Profiles' disappeared. I deleted all profiles and created new ones, but the problem persists, so I just used icons from %SystemRoot%\System32\SHELL32.dll . 

When optimizing my cBot the cTrader has to load the data again. No biggie))

Thanks firemyst

@Losing trade missing in cTrader desktop History.:  26 May 2023, 17:21


Hello

I noticed the cTrader desktop (windows) is not showing the losing trade. The mobile app cTrader (anroid) did register it, and it is visible in history. 

Account number:    (I won't give you my account number here, so everyone can see it. That's why I wrote you an email to community@spotware.com. I gave you my account number the 'DID' and everything, but you wrote me back to write my problem here in the forum.)

Deal ID: DID118378460  (as shown in the screenshot)

134.74 EUR losing deal missing from the cTrader desktop 'History' (gbpusd. cBot)

> Can you please insert the losing deal in my cTrader desktop? Thank you. < 

I need this because of taxes.

If you need my account number, give me an email I can send you it. I won't write my account number in public forum.

Screenshots:

cTrader desktop. Where is the losing trade?

The losing trade is visible in cTrader Web (copy). Not visible in cTrader desktop.

cTrader Mobile app. The losing deal is in the history.

@Please fix this. My strategy is not visible:  07 Mar 2023, 00:12


Delete this Post.

@800% profit a Year Trading Robot Strategy:  05 Mar 2023, 22:30


It is not visible whatever I do. So I will create a new one

@Please fix the code for this cBot:  15 Jan 2023, 21:09


Hi, Please help me.

I've been trying to fix the code with the help of an AI online. I was not succesful.

1.The cBot when I run it in the optimization program on M1 bars from Server (open prices) performs really well. It can even make more than 1000% profit a Month. On M5, on M15, on H1,..

But when I try to optimize or backtest it on Data: tick data from server, the cBot does not make profit.

(yes, I did try to increase or put the live spread data on the M1 bars from server backtest settings)

How so that If the cBot is making such great profit on H1 backtested on M1 bars from server it won't make profit when backtested on tick data (accurate)?

2. The cBot will only open new positions on XAU/USD (Gold) / USD/MXN  on smaller timeframe than M15. It won't open any positions on smaller time frames bellow M15 on EUR/USD or other currency pairs.  Is there any way to modify the code so the cBot will open positions also on EUR/USD on smaller timeframes? Does this have anything to do with the take profit and stop loss and pending orders that the cBot uses (in pips)? (I think the problem is in the Velocity Indicator.. Because when I put the Velocity Indicator on eur/usd it is totally different than on Gold - on the same time frame)

*This is a cAlgo robot that uses Fibonacci bands and velocity indicators to determine when to open trades. The robot uses the OnBar() method to check if the velocity of the market is rising or falling, and if so, it opens a trade using the Abreposicoes() method. The robot also has a number of parameters that can be adjusted by the user, such as the volume of the trade, the period of the ATR and EMA indicators, and the period of the velocity indicator. Additionally, the robot has a number of helper methods such as Carregar_fibo() that loads the Fibonacci bands into a list and OrganizarVetores() that sorts and reverses the list.* It works with creating pending orders. It also cancels the pending order according to market condition.

(I think someone from Portugal made the cBot because of the language)

***Can someone modify the code so it will check on bars open price  only? Or however it should be modified because the cBot breaks accounts in backtest program on Tick data  from Server (accurate) and the cBot makes more than 1000% profit on M1 bars from server open prices even if I backtest it on H1 timeframe. ?!

(in the backtest program we only have M1 bars from Server - open prices ! Why? We should have close prices too. I hope we get the 'M1 bars - close price' option too.

*** Can someone modify the code so the cBot will also open new positions on eur/usd and other currency pairs on smaller timeframes (smaller than M15)? Now it only opens new positions on xau/usd 

Thank you

*****There can be multiple reasons why the robot performs well on one backtest setting but not on another, even when the testing instrument and time frame is the same. Some possible explanations are:

  • The robot's logic may be optimized for the specific data that is used in the "M1 bars from Server (open prices)" setting. For example, it may be using the open prices of each bar as a key input for its calculations and decisions, which would be different from the tick data.
  • The robot may be sensitive to the number of price updates that it receives and the frequency of the updates. In the "Tick Data (accurate)" setting, the robot will receive many more updates than in the "M1 bars from Server (open prices)" setting, which could lead to different results.
  • The robot may be using some other data that is not present in the "Tick Data (accurate)" setting that is important for its calculations and decisions.
  • The robot may be using technical indicators that only work well on a specific kind of data, like the robot in question is using Fibonacci Bands and Velocity indicators, these indicators may work optimally on M1 bars from Server (open prices) but not on tick data.
  • The robot may be using a fixed stop loss or take profit value, which may be optimal for the data used in the "M1 bars from Server (open prices)" setting but not for the "Tick Data (accurate)" setting.

*****It is not specified in the provided code that the robot only opens trades on Gold and not on other currency pairs or on smaller time frames. However, it could be the case that the robot's parameters are not set optimally for smaller time frames or for other currency pairs, or the robot's logic does not account for those cases. It is also possible that the robot is not properly handling the differences in volatility and market conditions for different currency pairs and time frames, which could lead to poor performance in those cases. It is also possible that the robot is running on a strategy that is only meant for gold specifically. It is also possible that the fibo bands and velocity indicators are not working optimally on smaller time frames.

This is a backtest  result for the 5 minute time frame on Gold made on backtest settings M1 bars from Server (open prices)

The bot will not make profit on Tick data.

THIS IS THE CODE FOR THIS cBot. PLEASE HELP ME MODIFY IT OR DO ANYTHING TO IT SO IT WILL BE PROFITABLE ON TICK DATA.  

//#reference: ..\Indicators\FibonacciBands.algo
//#reference: ..\Indicators\Velocidade.algo
// -------------------------------------------------------------------------------
//
//    This is a Template used as a guideline to build your own Robot. 
//
// -------------------------------------------------------------------------------


using System;
using cAlgo.API;
using cAlgo.API.Indicators;
using cAlgo.API.Requests;
using cAlgo.Indicators;
using System.IO;
using System.Collections.Generic;

using System.Linq;
using System.Runtime.InteropServices;
using System.Globalization;


namespace cAlgo.Robots
{
    [Robot(TimeZone = TimeZones.UTC)]
    public class SR_Fibo : Robot
    {
        [Parameter(DefaultValue = 100000)]
        public int Volume { get; set; }
        [Parameter(DefaultValue = 21)]
        public int AtrPeriod { get; set; }
        [Parameter(DefaultValue = 55)]
        public int EmaPeriod { get; set; }
        [Parameter(DefaultValue = 10)]
        public int VelPeriod { get; set; }

        List<double> fibo;
        int idx;

        Velocidade tendencia;
        FibonacciBands fbands;

        double stop, gain, price;
        PendingOrder ordemc, ordemv;
        Position posicao;
        private void Seta_variaveis(TradeType oper)
        {
            Carregar_fibo();

            if (oper == TradeType.Buy)
                price =Precos(fibo, Symbol.Ask, oper);
            else
                price = Precos(fibo, Symbol.Bid, oper);
            stop = Stopcalc(oper, fibo);
            gain = Gaincalc(oper, fibo);

        }

        protected override void OnPendingOrderCreated(PendingOrder newPendingOrder)
        {
            if (newPendingOrder.TradeType == TradeType.Sell)
                ordemv = newPendingOrder;
            else
                ordemc = newPendingOrder;

        }

        protected override void OnBar()
        {
            Carregar_fibo();
            Trade.DeletePendingOrder(ordemv);
            Trade.DeletePendingOrder(ordemc);

            if (tendencia.velocidade.LastValue > 0 && Functions.IsRising(tendencia.velocidade))
                Abreposicoes(TradeType.Buy);
            if (tendencia.velocidade.LastValue < 0 && Functions.IsFalling(tendencia.velocidade))
                Abreposicoes(TradeType.Sell);



        }
        protected override void OnStart()
        {

            tendencia = Indicators.GetIndicator<Velocidade>(MarketSeries.Close, VelPeriod);
            fbands = Indicators.GetIndicator<FibonacciBands>(EmaPeriod, AtrPeriod);

            fibo = new List<double>();
            Carregar_fibo();
            OrganizarVetores();
            Abreposicoes(TradeType.Buy);
            Abreposicoes(TradeType.Sell);
            Print("OK!!!");
        }

        protected override void OnTick()
        {

        }
        private void OrganizarVetores()
        {
            fibo.Sort();
            fibo.Reverse();


        }

        private void Carregar_fibo()
        {
            fibo.Clear();
            fibo.Add(fbands.UpperBand4.LastValue);
            fibo.Add(fbands.UpperBand3.LastValue);
            fibo.Add(fbands.UpperBand2.LastValue);
            fibo.Add(fbands.UpperBand1.LastValue);
            fibo.Add(fbands.LowerBand1.LastValue);
            fibo.Add(fbands.LowerBand2.LastValue);
            fibo.Add(fbands.LowerBand3.LastValue);
            fibo.Add(fbands.LowerBand4.LastValue);
        }

        private void Abreposicoes(TradeType oper)
        {

            Seta_variaveis(oper);
            if (oper == TradeType.Buy)
                Trade.CreateBuyLimitOrder(Symbol, Volume, price, stop, gain, null);
            if (oper == TradeType.Sell)
            {
                Trade.CreateSellLimitOrder(Symbol, Volume, price, stop, gain, null);

            }
        }

        private double Stopcalc(TradeType oper, List<double> sr)
        {
            OrganizarVetores();
            if (oper == TradeType.Sell)
                sr.Sort();
            if (idx < sr.Count - 1 && Math.Abs(sr[idx] - Symbol.Bid) / Symbol.PipSize > 5)
                return sr[idx + 1];
            else if (oper == TradeType.Buy)
                return sr[idx] - 20 * Symbol.PipSize;
            else if (oper == TradeType.Sell)
                return sr[idx] + 20 * Symbol.PipSize;



            return 0;
        }

        private double Gaincalc(TradeType oper, List<double> sr)
        {
            OrganizarVetores();
            if (oper == TradeType.Sell)
                sr.Sort();

            return sr[idx - 1];
        }




        private double Precos(List<double> sr, double price, TradeType oper)
        {
            OrganizarVetores();
            if (oper == TradeType.Buy)
            {
                for (var i = 1; i < sr.Count() - 1; i++)
                {
                    if (tendencia.velocidade.LastValue > 0 && price - sr[i] > 10 * Symbol.PipSize)
                        if (sr[i] < price)
                        {
                            idx = i;
                            return sr[i];
                            break;
                        }


                    if (tendencia.velocidade.LastValue < 0 && price - sr[i] > 10 * Symbol.PipSize)
                        if (sr[i] < price)
                        {

                            idx = i + 1;
                            return sr[i + 1];
                            break;


                        }

                }

            }
            if (oper == TradeType.Sell)
            {

                sr.Sort();

                for (var i = 1; i < sr.Count() - 1; i++)
                {

                    if (tendencia.velocidade.LastValue < 0 && sr[i] - price > 10 * Symbol.PipSize)
                    {

                        if (sr[i] > price)
                        {

                            idx = i;
                            return sr[i];
                            break;
                        }
                    }
                    if (tendencia.velocidade.LastValue > 0 && sr[i] - price > 10 * Symbol.PipSize)
                        if (sr[i] > price)
                        {

                            idx = i + 1;
                            return sr[i + 1];
                            break;


                        }
                }

            }

            return 0;
        }


        protected override void OnPositionOpened(Position posicaoaberta)
        {
            posicao = posicaoaberta;
            Print("Nova posição aberta\n");

        }

        protected override void OnPositionClosed(Position posicaoaberta)
        {
            posicao = null;


        }
        protected override void OnStop()
        {
            Trade.DeletePendingOrder(ordemv);
            Trade.DeletePendingOrder(ordemc);
        }
    }
}

@Strategy: SCALPER:  14 Nov 2022, 13:27


.

@4.2 update breaking basic trendline functionality:  09 Sep 2022, 07:04


PanagiotisCharalampous said:

Hi swingfish,

We were not able to reproduce this behavior. Can you please provide us with the following?

  1. Troubleshooting information with a link to this page.
  2. Your GPU.
  3. Please advise what exactly do you do at 0:22 of the video.

Best Regards,

Panagiotis 

Join us on Telegram and Facebook

I also have this problem. 

Notification Publishing copyrighted material is strictly prohibited. If you believe there is copyrighted material in this section you may use the Copyright Infringement Notification form to submit a claim.

No uploaded.

Warning! Executing cBots downloaded from this section may result in loss of funds. Use them at your own risk.

No uploaded.