PanagiotisCharalampous's avatar
PanagiotisCharalampous
26 follower(s) 0 following 1006 subscription(s)
Replies

PanagiotisCharalampous
08 May 2020, 12:12

Hi Abdul,

Thanks we received and inspected the information you have sent to us. Based on the received information this might be an issue with your graphics card. Hence we would advise you to start Windows in the Safe Mode, then start cTrader and close it. If no errors appear, it is probably a problem with your with nVidia drivers and you will need to reinstall them.

To start Windows in Safe Mode follow the instructions below
https://support.microsoft.com/en-us/help/12376/windows-10-start-your-pc-in-safe-mode

Best Regards,

Panagiotis 

Join us on Telegram


@PanagiotisCharalampous

PanagiotisCharalampous
08 May 2020, 11:29

Hi yuval.ein,

Do you use OctaFX cTrader or Spotware cTrader? To see your OctaFX account, you need to use OctaFX cTrader.

Best Regards,

Panagiotis 

Join us on Telegram


@PanagiotisCharalampous

PanagiotisCharalampous
08 May 2020, 10:30

Hi yuval.ein,

You can only use the accounts of your broker using your broker's cTrader. If you are using OctaFX cTrader then you should be able to use your OctaFX account and OctaFX price feeds.

Best Regards,

Panagiotis 

Join us on Telegram


@PanagiotisCharalampous

PanagiotisCharalampous
08 May 2020, 10:27

Hi yuval.ein,

No, each indicator/cBot is a different Visual Studio solution.

Best Regards,

Panagiotis 

Join us on Telegram


@PanagiotisCharalampous

PanagiotisCharalampous
08 May 2020, 10:26

Hi yuval.ein,

Yes you can use Visual Studio to debug cBots/Indicators.

Best Regards,

Panagiotis 

Join us on Telegram

 

 


@PanagiotisCharalampous

PanagiotisCharalampous
08 May 2020, 08:51

Hi amirus.stark,

As I said above, we need cBot parameters, backtesting settings and exact dates where you expect your position to close but does not.

Best Regards,

Panagiotis 

Join us on Telegram


@PanagiotisCharalampous

PanagiotisCharalampous
08 May 2020, 08:49

Hi Tengu,

We pushed some fixes in the latest update which probably fixed this issue as well.

Best Regards,

Panagiotis 

Join us on Telegram


@PanagiotisCharalampous

PanagiotisCharalampous
08 May 2020, 08:35 ( Updated at: 21 Dec 2023, 09:22 )

Hi office3131,

I don't

here is my indicator code

using System;
using cAlgo.API;
using cAlgo.API.Indicators;
using Microsoft.Win32;

namespace cAlgo.Indicators
{
    [Indicator(IsOverlay = true, AccessRights = AccessRights.None)]
    public class TEMA_triOLD : Indicator
    {
        [Parameter("Timeframe 1", DefaultValue = "Minute")]
        public TimeFrame tf1 { get; set; }
        public int Period = 14;

        [Parameter("Timeframe 2", DefaultValue = "Minute5")]
        public TimeFrame tf2 { get; set; }
        public int Periodtf2 = 14;

        [Parameter("Timeframe 3", DefaultValue = "Minute15")]
        public TimeFrame tf3 { get; set; }
        public int Periodtf3 = 14;

        [Output("TF A", LineColor = "yellow")]
        public IndicatorDataSeries temaA { get; set; }
        [Output("TF B", LineColor = "red")]
        public IndicatorDataSeries temaB { get; set; }
        [Output("TF C", LineColor = "blue")]
        public IndicatorDataSeries temaC { get; set; }

        private ExponentialMovingAverage ema1;
        private ExponentialMovingAverage ema2;
        private ExponentialMovingAverage ema3;

        private ExponentialMovingAverage ema1tf2;
        private ExponentialMovingAverage ema2tf2;
        private ExponentialMovingAverage ema3tf2;

        private ExponentialMovingAverage ema1tf3;
        private ExponentialMovingAverage ema2tf3;
        private ExponentialMovingAverage ema3tf3;

        public bool tfUp;
        public bool tfDown;
        public string tf2rez;
        public string Reztf1;
        public string Reztf2;
        public string Reztf3;
        public double PMA;

        public double tf2diff;
        public string tf2rezS;
        public string tf3rezS;

        public double tf1perc;
        public double tf2perc;
        public double tf3perc;

        DataSeries stf1, stf2, stf3;

        protected override void Initialize()
        {
            stf1 = MarketData.GetSeries(tf1).Close;
            stf2 = MarketData.GetSeries(tf2).Close;
            stf3 = MarketData.GetSeries(tf3).Close;

            ema1 = Indicators.ExponentialMovingAverage(stf1, Period);
            ema2 = Indicators.ExponentialMovingAverage(ema1.Result, Period);
            ema3 = Indicators.ExponentialMovingAverage(ema2.Result, Period);

            ema1tf2 = Indicators.ExponentialMovingAverage(stf2, Periodtf2);
            ema2tf2 = Indicators.ExponentialMovingAverage(ema1tf2.Result, Periodtf2);
            ema3tf2 = Indicators.ExponentialMovingAverage(ema2tf2.Result, Periodtf2);

            ema1tf3 = Indicators.ExponentialMovingAverage(stf3, Periodtf3);
            ema2tf3 = Indicators.ExponentialMovingAverage(ema1tf3.Result, Periodtf3);
            ema3tf3 = Indicators.ExponentialMovingAverage(ema2tf3.Result, Periodtf3);

        }

        public override void Calculate(int index)
        {
//------REGISTRY set-------------
            //get time MarketSeries.TimeFrame.
            var charttime = MarketSeries.OpenTime[index];
            //var charttime = MarketSeries.TimeFrame.OpenTime[index];

//MarketSeries.
            //get index
            var idx1 = MarketData.GetSeries(tf1).OpenTime.GetIndexByTime(charttime);
            //Print("idx1: " + idx1);
            var idx2 = MarketData.GetSeries(tf2).OpenTime.GetIndexByTime(charttime);
            var idx3 = MarketData.GetSeries(tf3).OpenTime.GetIndexByTime(charttime);

            temaA[index] = 3 * ema1.Result[idx1] - 3 * ema2.Result[idx1] + ema3.Result[idx1];
            //   Print("Tema A " + temaA[index]);
            temaB[index] = 3 * ema1tf2.Result[idx2] - 3 * ema2tf2.Result[idx2] + ema3tf2.Result[idx2];
            //   Print("Tema B " + temaA[index]);
            temaC[index] = 3 * ema1tf3.Result[idx3] - 3 * ema2tf3.Result[idx3] + ema3tf3.Result[idx3];
            //    Print("Tema C " + temaA[index]);

            //--------calc tf1-----------------
            double tA0 = (Math.Round(temaA.Last(0), 2));
            double tA1 = (Math.Round(temaA.Last(1), 2));
            double tA2 = (Math.Round(temaA.Last(2), 2));
            double tA3 = (Math.Round(temaA.Last(3), 2));
            // /*   
            double tf1a1 = (Math.Round(temaA.Last(1), 2));
            double tf1a6 = 0;
            double tf1perc = 0;
            string tf1rez = "" + tf1a1;
            string tf1rezS = "";
            for (int i = 1; i <= 15; i++)
            {
                tf1a6 = (Math.Round(temaA.Last(i), 2));
                if (tf1a6 != tf1a1)
                {
                    if (tf1a6 > tf1a1)
                    {
                        tf1perc = Math.Round(1 * (tf1a1 - tf1a6), 2);
                        tf1rez = "tf1 -DOWN---(" + i + ") " + tf1a6 + "   (1) " + tf1a1 + " i=" + i + " %=" + tf1perc;
                        tf1rezS = "tf1 down";
                        Reztf1 = "down";
                        break;
                    }
                    if (tf1a6 < tf1a1)
                    {
                        tf1perc = Math.Round(1 * (tf1a1 - tf1a6), 2);
                        tf1rez = "tf1 -UP---(" + i + ") " + tf1a6 + "   (1) " + tf1a1 + " i=" + i + " %=" + tf1perc;
                        tf1rezS = "tf1 up";
                        Reztf1 = "up";
                        break;
                    }
                }
            }

//-----calc tf2-------------------
            double tB0 = (Math.Round(temaB.Last(0), 2));
            double tB1 = (Math.Round(temaB.Last(1), 2));
            double tB3 = (Math.Round(temaB.Last(3), 2));
            double tB9 = (Math.Round(temaB.Last(9), 2));
            //    /*
            double tf2a1 = (Math.Round(temaB.Last(1), 2));
            double tf2a6 = 0;
            double tf2perc = 0;
            string tf2rez = "" + tf2a1;
            string tf2rezS = "";
            for (int i = 1; i <= 15; i++)
            {
                tf2a6 = (Math.Round(temaB.Last(i), 2));
                if (tf2a6 != tf2a1)
                {
                    if (tf2a6 > tf2a1)
                    {
                        tf2perc = Math.Round(1 * (tf2a1 - tf2a6), 2);
                        tf2rez = "tf2 -DO---(" + i + ") " + tf2a6 + "   (1) " + tf2a1 + " i=" + i + " %=" + tf2perc;
                        tf2rezS = "tf2 down";
                        Reztf2 = "down";
                        break;
                    }
                    if (tf2a6 < tf2a1)
                    {
                        tf2perc = Math.Round(1 * (tf2a1 - tf2a6), 2);
                        tf2rez = "tf2 -UP---(" + i + ") " + tf2a6 + "   (1) " + tf2a1 + " i=" + i + " %=" + tf2perc;
                        tf2rezS = "tf2 up";
                        Reztf2 = "up";
                        break;
                    }
                }
            }

//-----end  tf2----------------------
//-----calc tf3-------------------
            double tC0 = (Math.Round(temaC.Last(0), 2));
            double tC1 = (Math.Round(temaC.Last(1), 2));
            double tC5 = (Math.Round(temaC.Last(5), 2));
            double tC15 = (Math.Round(temaC.Last(15), 2));

         //   double PMA = 1;
            double tf3a6 = 0;
            double tf3perc = 0;
            double tf3a1 = (Math.Round(temaC.Last(1), 2));
            string tf3rez = "" + tf3a1;
            string tf3rezS = "";
            for (int i = 1; i <= 15; i++)
            {
                tf3a6 = (Math.Round(temaC.Last(i), 2));
                if (tf3a6 != tf3a1)
                {
                    PMA = (tf1perc + tf2perc + tf3perc);
                    if (tf3a6 > tf3a1)
                    {

                        tf3perc = Math.Round(1 * (tf3a1 - tf3a6), 2);
                        PMA = (tf1perc + tf2perc + tf3perc);

                        tf3rez = "tf3 -DO---(" + i + ") " + tf3a6 + "   (1) " + tf3a1 + " i=" + i + " %=" + tf3perc + "\n\t\t\t_triOLD PMA. =" + PMA;
                        tf3rezS = "tf3 down";
                        Reztf3 = "down";
                        break;
                    }
                    if (tf3a6 < tf3a1)
                    {
                        tf3perc = Math.Round(10 * (tf3a1 - tf3a6), 2);
                        PMA = (tf1perc + tf2perc + tf3perc);

                        tf3rez = "tf3 -UP---(" + i + ") " + tf3a6 + "   (1) " + tf3a1 + " i=" + i + " %=" + tf3perc + "\n\t\t\t_triOLD PMA. =" + PMA;
                        tf3rezS = "tf3 up";
                        Reztf3 = "up";
                        break;
                    }
                }
            }

//--end tf3---------------------

//-----calc tema2 diff

            var tf26 = Math.Round(temaB.Last(6), 2);
            var tf20 = Math.Round(temaB.Last(0), 2);
            var tf2diff = tf20 - tf26;
            bool tfUp = tf2diff >= 9 ? true : false;
            bool tfDown = tf2diff <= -9 ? true : false;
            var diffPerc2FR = Math.Round(10000 * (tf2diff / tf20), 3);
            var ColRSI = "Yellow";
            if (RunningMode != RunningMode.Optimization)
            {
                //  Chart.DrawStaticText("AlertBuy", "tf26 " + tf26 + "   " + "  tf20 " + tf20 + "\n\n\n\ntfDown " + tfDown + "   tfUp" + tfUp, VerticalAlignment.Top, HorizontalAlignment.Center, Color.Yellow);
                Chart.DrawStaticText("tf1", "IND " + tf1rez, VerticalAlignment.Top, HorizontalAlignment.Center, Color.Yellow);
                Chart.DrawStaticText("tf2", "\nIND " + tf2rez, VerticalAlignment.Top, HorizontalAlignment.Center, Color.Red);
                Chart.DrawStaticText("tf3", "\n\nIND " + tf3rez, VerticalAlignment.Top, HorizontalAlignment.Center, Color.Aqua);
            }
//---end calc diff--------------
        }
    }
}

Best Regards,

Panagiotis 

Join us on Telegram


@PanagiotisCharalampous

PanagiotisCharalampous
07 May 2020, 15:36

Hi amirus.stark,

You need to provide more information about your issue like cBot parameters, backtesting settings and exact dates where you expect your position to close but does not.

Best Regards,

Panagiotis 

Join us on Telegram


@PanagiotisCharalampous

PanagiotisCharalampous
07 May 2020, 15:31

Hi Abdul,

Unfortunately this information does not allow us to determine the problem. To investigate further please send us your settings file and any custom indicators you might me using at community@spotware.com. You can find your settings file at C:\Users\User\AppData\Roaming\broker-cTrader\Settings.

Best Regards,

Panagiotis 

Join us on Telegram


@PanagiotisCharalampous

PanagiotisCharalampous
07 May 2020, 14:44

Hi lordyy,

You can add a counter in OnBar() that will start counting after the position was entered.

Best Regards,

Panagiotis 

Join us on Telegram

 


@PanagiotisCharalampous

PanagiotisCharalampous
07 May 2020, 14:42

Hi amirus.stark,

You can add a condition checking if positions are 0 before opening a position e.g. Positions.Count() == 0.

Best Regards,

Panagiotis 

Join us on Telegram

 


@PanagiotisCharalampous

PanagiotisCharalampous
07 May 2020, 11:08

Hi Luca,

There is no specific question here to be answered. You ask from people to go through a 500 lines cBot that does not even build, to spot your mistakes. This is time consuming and nobody will do it. Why should they? You should either teach yourself programming or pay somebody write the code for you. If you have specific questions, we are happy to answer them. But nobody will spend 3-4 hours trying to understand what are you trying to do and fix your code's logical mistakes.

Best Regards,

Panagiotis 

Join us on Telegram

 


@PanagiotisCharalampous

PanagiotisCharalampous
07 May 2020, 10:34

Hi office3131,

There is a local declaration of PMA variable inside the Calculate function which overrides the global one.

            double PMA = 0;
            double tf3a6 = 0;
            double tf3perc = 0;

You need to delete it.

Best Regards,

Panagiotis 

Join us on Telegram


@PanagiotisCharalampous

PanagiotisCharalampous
07 May 2020, 10:22

Hi Abdul,

 When cTrader crashes, it usually reports two messages in the Windows event log, one of which contains important information for further investigation. It seems that one message is missing from your report and it contains critical information for us to determine the problem. Can please check again the messages in the event viewer and make sure that you have sent everything to us?

Best Regards,

Panagiotis 

Join us on Telegram


@PanagiotisCharalampous

PanagiotisCharalampous
07 May 2020, 09:25

Hi VulcanTrader,

There is no mobile application for cTrader Copy at the moment. Regarding your commissions they will be deposited to the account that provides the strategy.

Best Regards,

Panagiotis 

Join us on Telegram


@PanagiotisCharalampous

PanagiotisCharalampous
07 May 2020, 09:21

Hi Chay,

In principle what needs to be done is to load more bars for the other timeframe you are trying to use until data is loaded for the bar under calculation. Below the solution I provided to a similar problem

using System;
using cAlgo.API;
using cAlgo.API.Indicators;
using cAlgo.API.Internals;

namespace cAlgo.Indicators
{
    [Indicator(IsOverlay = true, TimeZone = TimeZones.UTC)]
    public class ematf : Indicator
    {
        [Parameter("MA TF")]
        public TimeFrame matf { get; set; }

        [Parameter("Period")]
        public int emaper { get; set; }

        [Output("EMA TF", Color = Colors.White)]
        public IndicatorDataSeries main { get; set; }

        Bars bars;

        protected override void Initialize()
        {

            bars = MarketData.GetBars(matf);
        }

        public override void Calculate(int index)
        {
            while (double.IsNaN(bars.ClosePrices[bars.OpenTimes.GetIndexByTime(Bars.OpenTimes[index])]))
            {
                bars.LoadMoreHistory();
            }
            var ma1 = Indicators.ExponentialMovingAverage(bars.ClosePrices, emaper).Result;
            //get time
            var charttime = Bars.OpenTimes[index];

            //get index
            var idx1 = bars.OpenTimes.GetIndexByTime(charttime);

            main[index] = ma1[idx1];


        }

    }
}

Best Regards,

Panagiotis 

Join us on Telegram


@PanagiotisCharalampous

PanagiotisCharalampous
07 May 2020, 09:05

Hi Vamsi,

1. We will need more information about this. You will need to provide us with the source code and steps to reproduce this behavior. It is almost certain that there is something wrong on your side.

2. You can find OpenAPIMessagesFactory here. Note that there are no instructions to update the Open API Library project. The instructions refer to updating only the proto classes found in the Proto folder.

3. Positions and pending orders can be retrieved using ProtoOAReconcileReq.

4. It seems to be a bug in the example project. Please go to OpenApiMessagesPresentation, Line 114 and change 

 sbReconcile.Append("ID: " + position.HasPositionId + Environment.NewLine);

to

sbReconcile.Append("ID: " + position.PositionId + Environment.NewLine);

5. See point 4

Best Regards,

Panagiotis 

Join us on Telegram


@PanagiotisCharalampous

PanagiotisCharalampous
07 May 2020, 08:37

Hi Eliezer,

You still need to use Last() for ClosePrices. See below

 var PreviusClose = Bars.ClosePrices.Last(5);

Best Regards,

Panagiotis 

Join us on Telegram

 


@PanagiotisCharalampous

PanagiotisCharalampous
07 May 2020, 08:34

Hi Pierluigi,

When you stop following a strategy the funds will remain in your subaccount. You can move the remaining balance to your main account by right clicking on the subaccount and selecting Remove Funds.

Best Regards,

Panagiotis 

Join us on Telegram

 


@PanagiotisCharalampous