Replies

PanagiotisCharalampous
18 Feb 2020, 08:09

RE: Market Sentiment via API?

19621o12@gmail.com said:

Will the market Sentiment become accessible in bots, perhaps via the API?

We do not have such plans at the moment.

Best Regards,

Panagiotis 

Join us on Telegram


@PanagiotisCharalampous

PanagiotisCharalampous
18 Feb 2020, 08:08

Hi NE539,

I do not have an exhaustive list of all the differences but the major one is that you cannot use custom indicators and cBots on cTrader Web. Furthermore, from time to time some features might be available on one platform because they have not been delivered on the other, but in general we are trying to keep both applications on par. In terms of performance, you should expect a better performance from the desktop application since it is native compared to cTrader Web that needs to run within a browser.

Best Regards,

Panagiotis 

Join us on Telegram

 


@PanagiotisCharalampous

PanagiotisCharalampous
17 Feb 2020, 16:29

Hi team500,

This indicator can switch a chart's timeframe and symbol but not open a new chart or close the existing one. The functions it uses are the following

 https://ctrader.com/api/reference/chart/trychangetimeframe

https://ctrader.com/api/reference/chart/trychangetimeframeandsymbol

Best Regards,

Panagiotis 

Join us on Telegram


@PanagiotisCharalampous

PanagiotisCharalampous
17 Feb 2020, 16:19

Hi team500,

There is no such function.

Best Regards,

Panagiotis 

Join us on Telegram

 


@PanagiotisCharalampous

PanagiotisCharalampous
17 Feb 2020, 16:19

Hi A.R.,

Can you post the indicator code?

Best Regards,

Panagiotis 

Join us on Telegram

 


@PanagiotisCharalampous

PanagiotisCharalampous
17 Feb 2020, 16:17

Hi there, 

To fix this issue you need to add a dummy to the indicator and call it from the cBot. See below

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

namespace cAlgo
{
    [Indicator(IsOverlay = false, TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)]
    public class Chickens : Indicator
    {
        [Parameter("Source")]
        public DataSeries Source { get; set; }

        [Output("Main")]
        public IndicatorDataSeries Result { get; set; }

        public int counter = 1;


        protected override void Initialize()
        {
            // Initialize and create nested indicators
            Print("INDICATOR PRINT | calculate | initial value for \"counter\"  " + counter);
        }

        public override void Calculate(int index)
        {

            counter = counter > 100 ? 0 : ++counter;
            ChartObjects.DrawText("max100", "counter " + counter, StaticPosition.BottomRight, Colors.Plum);
        }
    }
}
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.UTC, AccessRights = AccessRights.None)]
    public class ChickenCounter : Robot
    {
        [Parameter(" Source")]
        public DataSeries Source { get; set; }
        private Chickens chick;

        protected override void OnStart()
        {
            // Put your initialization logic here
            chick = Indicators.GetIndicator<Chickens>(Source);
        }

        protected override void OnTick()
        {
            // Put your core logic here
            Print(chick.Result.LastValue);
            Print("OnTick | counter  " + chick.counter);
        }

        protected override void OnStop()
        {
            // Put your deinitialization logic here
        }
    }
}

Best Regards,

Panagiotis 

Join us on Telegram

 


@PanagiotisCharalampous

PanagiotisCharalampous
17 Feb 2020, 15:18

Hi silvanaskocic75,

Did you do anything else than just installing cTrader on desktop e.g. placed orders or opened any positions?

Best Regards,

Panagiotis 

Join us on Telegram

 


@PanagiotisCharalampous

PanagiotisCharalampous
17 Feb 2020, 15:16

Hi TzvetomirTerziysky,

I will raise this issue to the development team to check again.

Best Regards,

Panagiotis 

Join us on Telegram


@PanagiotisCharalampous

PanagiotisCharalampous
17 Feb 2020, 14:02

Hi bienve.pf,

Please provide the cBot code and screenshots of the errors.

Best Regards,

Panagiotis 

Join us on Telegram

 


@PanagiotisCharalampous

PanagiotisCharalampous
17 Feb 2020, 14:00

Hi TzvetomirTerziysky,

As explained above the exception was added in 3.7. After receiving a lot of complaints from users, we have reverted to how it was working in v3.6. It was never working in optimization.

Best Regards,

Panagiotis 

Join us on Telegram


@PanagiotisCharalampous

PanagiotisCharalampous
17 Feb 2020, 12:46

Hi bienve.pf,

We can consider this for future updates.

Best Regards,

Panagiotis 

Join us on Telegram

 


@PanagiotisCharalampous

PanagiotisCharalampous
17 Feb 2020, 12:13

Hi TzvetomirTerziysky,

We put nothing under the carpet. This was never working in optimization. It was just not throwing an exception in v3.6. We restored this functionality in v3.7.

Best Regards,

Panagiotis 

Join us on Telegram

 


@PanagiotisCharalampous

PanagiotisCharalampous
17 Feb 2020, 12:11

Hi Pep,

1) The reason behind the NaN values is that you are trying to access indices with negative values (index - ik). You should make the relevant checks and make sure you are using an index with a positive value.

2) The gap issue is not related with the NaN issue. To fix the gap issue just start adding values from the index before i.e. the start index and value of the green series should be the same with the end index and value of the red series and vise versa.

Best Regards,

Panagiotis 

Join us on Telegram

 


@PanagiotisCharalampous

PanagiotisCharalampous
17 Feb 2020, 09:56

Hi reza h,

Your question is very general for somebody to give you a specific answer. So I will try to give a general answer to a general question, in case it helps. Use a flag that will be raised when the first hammer is detected. When the flag has been raised, do not detect any hammers. Lower the flag whenever you think it should be lowered.

Best Regards,

Panagiotis 

Join us on Telegram

 


@PanagiotisCharalampous

PanagiotisCharalampous
17 Feb 2020, 09:50

Hi traderfxmaster007,

See below

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

namespace cAlgo
{
    [Indicator(IsOverlay = true, TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)]
    public class LEXtrend : Indicator
    {
        [Parameter("LEX Period", DefaultValue = 14, MinValue = 1, MaxValue = 25)]
        public int Period { get; set; }

        [Parameter("LEX Threshold", DefaultValue = 20, MinValue = 20, MaxValue = 60)]
        public int Threshold { get; set; }

        [Parameter("Arrow Offset", DefaultValue = 5, MinValue = 1, Step = 1)]
        public double arrowOffset { get; set; }

        private string upArrow = "▲";
        private string downArrow = "▼";

        private IchimokuKinkoHyo Ichimoku;
        private DirectionalMovementSystem dms;

        protected override void Initialize()
        {
            Ichimoku = Indicators.IchimokuKinkoHyo(9, 26, 52);
            dms = Indicators.DirectionalMovementSystem(Period);

            arrowOffset = Symbol.PipSize * arrowOffset;

        }
        public override void Calculate(int index)
        {
            double high = Bars.HighPrices[index];
            double low = Bars.LowPrices[index];

            if (BuySignal())
                Chart.DrawStaticText(string.Format("Buy {0}", index), upArrow, VerticalAlignment.Top, HorizontalAlignment.Center, Color.Lime);

            if (SellSignal())
                Chart.DrawStaticText(string.Format("Sell {0}", index), downArrow, VerticalAlignment.Top, HorizontalAlignment.Center, Color.Red);
        }

        #region Predicate
        public bool BuySignal()
        {

            return Bars.ClosePrices.Last(1) > Bars.OpenPrices.Last(1) && Bars.ClosePrices.Last(1) > Ichimoku.KijunSen.Last(1) && dms.DIPlus.Last(1) > dms.DIMinus.Last(1) && dms.DIPlus.Last(1) > Threshold && (Bars.ClosePrices.Last(2) < Bars.OpenPrices.Last(2) || Bars.ClosePrices.Last(2) < Ichimoku.KijunSen.Last(2) || dms.DIPlus.Last(2) < dms.DIMinus.Last(2) || dms.DIPlus.Last(2) <= Threshold);
        }
        public bool SellSignal()
        {

            return Bars.ClosePrices.Last(1) < Bars.OpenPrices.Last(1) && Bars.ClosePrices.Last(1) < Ichimoku.KijunSen.Last(1) && dms.DIPlus.Last(1) < dms.DIMinus.Last(1) && dms.DIMinus.Last(1) > Threshold && (Bars.ClosePrices.Last(2) > Bars.OpenPrices.Last(2) || Bars.ClosePrices.Last(2) > Ichimoku.KijunSen.Last(2) || dms.DIPlus.Last(2) > dms.DIMinus.Last(2) || dms.DIMinus.Last(2) <= Threshold);

        }
        #endregion

    }
}

Best Regards,

Panagiotis 

Join us on Telegram

 


@PanagiotisCharalampous

PanagiotisCharalampous
17 Feb 2020, 09:46

Hi martins,

There is no such option at the moment.

Best Regards,

Panagiotis 

Join us on Telegram

 


@PanagiotisCharalampous

PanagiotisCharalampous
17 Feb 2020, 09:44

Hi acrigney,

Probably there is an open position in loss that causes this.

Best Regards,

Panagiotis 

Join us on Telegram

 


@PanagiotisCharalampous

PanagiotisCharalampous
17 Feb 2020, 09:41

Hi Vipin,

This example is not supported anymore. Read more here.

Best Regards,

Panagiotis 

Join us on Telegram

 


@PanagiotisCharalampous

PanagiotisCharalampous
17 Feb 2020, 09:28

Hi danielvme,

Thanks for your suggestion. Please post your suggestions in the Suggestions section of the forum.

Best Regards,

Panagiotis 

Join us on Telegram

 


@PanagiotisCharalampous

PanagiotisCharalampous
17 Feb 2020, 09:26

Hi henderson.nigel,

No there is no such setting. Please make sure you are using the same setting i.e. optimization method and cBot parameters.

Best Regards,

Panagiotis 

Join us on Telegram

 


@PanagiotisCharalampous