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

PanagiotisCharalampous
23 Jan 2021, 10:31

Hi cTKit,

There is no such option in the API at the moment.

Best Regards,

Panagiotis 

Join us on Telegram


@PanagiotisCharalampous

PanagiotisCharalampous
23 Jan 2021, 10:29

Hi JerryTrader,

A workaround would be to just change your target framework in your cBot/Indicator project but you should understand that you do this at your own responsibility.

Best Regards,

Panagiotis 

Join us on Telegram


@PanagiotisCharalampous

PanagiotisCharalampous
22 Jan 2021, 15:54

Hi cTKit,

You can use LastVisibleBarIndex.

Best Regards,

Panagiotis 

Join us on Telegram


@PanagiotisCharalampous

PanagiotisCharalampous
22 Jan 2021, 15:49

Hi JerryTrader,

Unfortunately we cannot commit on an ETA hence the wording. Also we cannot suggest any hacks to the platform, neither support them.

Best Regards,

Panagiotis 

Join us on Telegram


@PanagiotisCharalampous

PanagiotisCharalampous
22 Jan 2021, 14:46

Hi JerryTrader,

We are hoping to migrate cTrader Desktop to .Net Core by summer.

Best Regards,

Panagiotis 

Join us on Telegram


@PanagiotisCharalampous

PanagiotisCharalampous
22 Jan 2021, 10:09

Hi steel.export,

If you need somebody to implement a new feature for your cBot, you can also consider posting a Job

Best Regards,

Panagiotis 

Join us on Telegram


@PanagiotisCharalampous

PanagiotisCharalampous
22 Jan 2021, 08:22 ( Updated at: 21 Dec 2023, 09:22 )

Hi eleetsdrahcir,

TP and SL are orders and they are not relevant to deals, You can see this information in Position Info and Order Info

Best Regards,

Panagiotis 

Join us on Telegram


@PanagiotisCharalampous

PanagiotisCharalampous
22 Jan 2021, 08:04

Hi smoothgeek2016,

cTrader Desktop 4.0 will have the option to keep the trend line horizontal and create finite horizontal lines.

Best Regards,

Panagiotis 

Join us on Telegram


@PanagiotisCharalampous

PanagiotisCharalampous
22 Jan 2021, 08:01

Hi ctid1074959,

You can consider posting a Job too.

Best Regards,

Panagiotis 

Join us on Telegram


@PanagiotisCharalampous

PanagiotisCharalampous
22 Jan 2021, 07:59

Hi ctid1074959,

Can you share the code you are using?

Best Regards,

Panagiotis 

Join us on Telegram


@PanagiotisCharalampous

PanagiotisCharalampous
21 Jan 2021, 11:55

Hi lampies_mvr,

To enable your account, you need to contact your broker.

Best Regards,

Panagiotis 

Join us on Telegram

 


@PanagiotisCharalampous

PanagiotisCharalampous
21 Jan 2021, 08:51

Hi rgasch,

1) Print() method for indicators works only in cTrader Automate

2) Your indicator code seems outdated. Please use the one below

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

namespace cAlgo.Indicators
{
    [Indicator(IsOverlay = true, AccessRights = AccessRights.None)]
    public class HeikenAshiPro : Indicator
    {
        [Output("_haOpen")]
        public IndicatorDataSeries _haOpen { get; set; }
        [Output("_haClose")]
        public IndicatorDataSeries _haClose { get; set; }
        [Output("_haHigh")]
        public IndicatorDataSeries _haHigh { get; set; }
        [Output("_haLow")]
        public IndicatorDataSeries _haLow { get; set; }
        [Output("_haColorDir")]
        public IndicatorDataSeries _haColorDir { get; set; }


        protected override void Initialize()
        {
        }


        public override void Calculate(int index)
        {
            var open = Bars.OpenPrices[index];
            var high = Bars.HighPrices[index];
            var low = Bars.LowPrices[index];
            var close = Bars.ClosePrices[index];
            var time = Bars.OpenTimes[index];

            var haClose = (open + high + low + close) / 4;
            var haOpen = (index > 0) ? (_haOpen[index - 1] + _haClose[index - 1]) / 2 : (open + close) / 2;
            var haHigh = Math.Max(Math.Max(high, haOpen), haClose);
            var haLow = Math.Min(Math.Min(low, haOpen), haClose);

            _haOpen[index] = haOpen;
            _haHigh[index] = haHigh;
            _haLow[index] = haLow;
            _haClose[index] = haClose;
            _haColorDir[index] = haClose > haOpen ? 1 : -1;
            Print("XXX " + index);
            Print("YYY " + _haOpen[index]);

            Chart.ChartType = ChartType.Line;
            drawCandle(index, time, haOpen, haHigh, haLow, haClose);
        }


        private void drawTrendLine(int id, DateTime time1, double open1, DateTime time2, double open2, double close2)
        {
            var clr = close2 > open2 ? Color.ForestGreen : Color.OrangeRed;
            Chart.DrawTrendLine("trendline" + id, time1, open1, time2, open2, clr, 2);
        }


        private void drawCandle(int id, DateTime t, double open, double high, double low, double close)
        {

            var clr = close > open ? Color.ForestGreen : Color.OrangeRed;
            Chart.DrawTrendLine("candlebody" + id, t, open, t, close, clr, candlewidth(Chart.ZoomLevel));
            Chart.DrawTrendLine("candlewick" + id, t, high, t, low, clr, 1);

            Chart.DrawEllipse("price" + id, t, Bars.ClosePrices.LastValue, t, Bars.ClosePrices.LastValue, Color.Blue, 8);
            resetCandlewidth();

        }


        private int candlewidth(int zoomlevel)
        {
            return zoomlevel <= 10 ? 1 : (zoomlevel <= 20 ? 2 : (zoomlevel <= 40 ? 5 : (zoomlevel <= 80 ? 10 : (zoomlevel <= 180 ? 20 : (zoomlevel <= 320 ? 40 : (60))))));
        }


        private void resetCandlewidth()
        {
            //  if (_previousZoomLevel != Chart.ZoomLevel)
            {
                //_previousZoomLevel = Chart.ZoomLevel;
                for (int i = 0; i < _haOpen.Count; i++)
                {
                    var time = Bars.OpenTimes[i];
                    var haclr = _haClose[i] > _haOpen[i] ? Color.ForestGreen : Color.OrangeRed;
                    Chart.DrawTrendLine("candlebody" + i, time, _haOpen[i], time, _haClose[i], haclr, candlewidth(Chart.ZoomLevel));

                    var dotwidth = Chart.ZoomLevel <= 80 ? 5 : 8;
                    Chart.DrawEllipse("price" + i, time, Bars.ClosePrices[i], time, Bars.ClosePrices[i], Color.Blue, dotwidth);
                }
            }
        }



    }
}

Best Regards,

Panagiotis 

Join us on Telegram

 


@PanagiotisCharalampous

PanagiotisCharalampous
21 Jan 2021, 08:35

Hi TOPGUNFX,

The last value of the indicator is always Last(0), shifted or not. If you want assosiate the indicator values with the bars then you need to take into consideration the shift as well. For example, based on your example above, the Jaws value that corresponds to Bars.Last(0) is alligator.Jaws.Last(13);

Best Regards,

Panagiotis 

Join us on Telegram


@PanagiotisCharalampous

PanagiotisCharalampous
21 Jan 2021, 08:26 ( Updated at: 21 Dec 2023, 09:22 )

Hi rbrt.gorski,

Here you go

Best Regards,

Panagiotis 

Join us on Telegram


@PanagiotisCharalampous

PanagiotisCharalampous
21 Jan 2021, 08:20

Hi Johannes ,

Please post your issue in the relevant section and provide more information like exact steps to reproduce this behavior. This section is for suggestions only and this thread will be deleted soon.

Best Regards,

Panagiotis 

Join us on Telegram


@PanagiotisCharalampous

PanagiotisCharalampous
20 Jan 2021, 12:24

Hi samuel.jus.cornelio,

Here you go

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 NewcBot : Robot
    {
        [Parameter(DefaultValue = 0.0)]
        public double Parameter { get; set; }
        DateTime _lastTrade;
        protected override void OnStart()
        {
            _lastTrade = Server.Time.AddDays(-1);
        }

        protected override void OnTick()
        {
            if (_lastTrade.DayOfYear != Server.Time.DayOfYear)
            {
                ExecuteMarketOrder(TradeType.Buy, Symbol.Name, 1000);
                _lastTrade = Server.Time;
            }
        }

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

Best Regards,

Panagiotis 

Join us on Telegram


@PanagiotisCharalampous

PanagiotisCharalampous
20 Jan 2021, 09:47

Hi 3rrr168,

Ok thanks, as mentioned above, to assist you further you need to provide us with the complete source code and steps to reproduce so that we can understand what the issue is and propose the proper alternative.

Best Regards,

Panagiotis 

Join us on Telegram


@PanagiotisCharalampous

PanagiotisCharalampous
20 Jan 2021, 08:27

Hi antoniogmd,

There is no such feature in cTrader. You can write a custom indicator for this.

Best Regards,

Panagiotis 

Join us on Telegram


@PanagiotisCharalampous

PanagiotisCharalampous
20 Jan 2021, 08:25

Hi 3rrr168,

Are the simultaneous orders executed by the same instance or by different instances?

Best Regards,

Panagiotis 

Join us on Telegram


@PanagiotisCharalampous

PanagiotisCharalampous
20 Jan 2021, 08:20

Hi samuel.jus.cornelio,

It's not one line of code :) You need to record the datetime at which the trade took place and then check if your current Server.Time day has changed before placing another one.

Best Regards,

Panagiotis 

Join us on Telegram


@PanagiotisCharalampous