Replies

PanagiotisCharalampous
03 Sep 2018, 12:33

Hi Pete,

If the server does not receive heartbeats from the client then it will close the connection. Please try sending one heartbeat every 10 seconds for each subscription and let me know if it works.

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
03 Sep 2018, 12:09

Hi ctid491211,

Do you send heartbeats to the server to keep the connection active?

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
03 Sep 2018, 11:42

Hi mparama,

No it is not possible since the ChartScale information is not available via the API.

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
03 Sep 2018, 11:34

Hi noppanon,

When placing the stop order and setting SL and TP in pips, try rounding to one decimal place.

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
03 Sep 2018, 11:31

Hi kikky.ua,

Thanks for posting in our forum. Even though I cannot commit to a release date, it will be released sometime during the following weeks.

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
03 Sep 2018, 11:29

Hi Dean,

cTrader Automate API 3.01 is available only on Spotware cTrader Publi Beta at the moment. We will roll out to brokers as soon as beta testing is finished.

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
03 Sep 2018, 11:20

Hi nordic,

This is a known bug and has been fixed in Spotware cTrader Public Beta. Can you try it as well and confirm that is working properly for your cBot?

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
03 Sep 2018, 11:10

Hi Eric,

If you want to plot data series on the chart, you need to use a custom indicator and then add it on the chart.

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
03 Sep 2018, 11:02

Hi thongbaogiaodich,

Here it is

Chart.DrawStaticText("pipsaway", PipsAway, VerticalAlignment.Top, HorizontalAlignment.Right, Color.Red);

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
03 Sep 2018, 10:57

Hi Sasha,

You can try something like this

 private double _lastClose;
 protected override void OnTick()
 {
    if (MarketSeries.Close.Last(1) != _lastClose)
    {
       //Bar changed
       _lastClose = MarketSeries.Close.Last(1);
    }
 }

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
31 Aug 2018, 17:52

Hi jjcolacicco,

Thanks for clarifying. Unfortunately there is no such feature currently in cTrader.

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
31 Aug 2018, 17:22

Hi 9511486,

Thanks for posting in our forum. In order to display something on the chart you either need to create an indicator and put the relevant values in an IndicatorDataSeries property with an Output attribute (See sample indicators) or use any of the drawing functionalities available in the new API.

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
31 Aug 2018, 16:44

Hi jjcolacicco,

Thanks for posting in our forum. It is not clear what you are asking for. Do you want to programmatically change the candlestick colors?

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
31 Aug 2018, 16:28

Hi Noppanon,

If your SL and TP have decimal places please make sure to round them to the Symbol's digits. See below

TakeProfit = Math.Round(TakeProfit, Symbol.Digits);

It is a known issue that non rounded values might be the cause of such messages and we will fix it in a future release.

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
31 Aug 2018, 15:18

Hi alexey_r,

Thanks for posting in our forum. Mirrored positions are visible in cTrader since they are positions belonging to your account. However I am not sure what you mean with balance changes and transaction history. Do you mean the strategy provider's balance and transactions?

Best Regards,

Panagiotis

 


@PanagiotisCharalampous

PanagiotisCharalampous
31 Aug 2018, 14:43

Hi,

Here is the indicator equivalent

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

namespace cAlgo
{
    [Indicator(IsOverlay = true, TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)]
    public class NewIndicator : Indicator
    {

        RelativeStrengthIndex _rsi;
        protected override void Initialize()
        {
            _rsi = Indicators.RelativeStrengthIndex(MarketSeries.Close, 14);
        }

        public override void Calculate(int index)
        {
            Chart.DrawText("RSI", _rsi.Result.LastValue.ToString(), Server.Time, Symbol.Ask, Color.Red);
        }
    }
}

 


@PanagiotisCharalampous

PanagiotisCharalampous
31 Aug 2018, 11:41

Hi oneb700d@gmail.com,

The code was written with the new version of the API, 3.01. Have you tried it on Spotware cTrader Public Beta?

Best Regards,

Panagiots


@PanagiotisCharalampous

PanagiotisCharalampous
31 Aug 2018, 10:59

Hi oneb700d@gmail.com,

Is this what you are looking for?

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
    {

        RelativeStrengthIndex _rsi;
        protected override void OnStart()
        {
            _rsi = Indicators.RelativeStrengthIndex(MarketSeries.Close, 14);
        }
        protected override void OnTick()
        {
            Chart.DrawText("RSI", _rsi.Result.LastValue.ToString(), Server.Time, Symbol.Ask, Color.Red);
        }

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

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
31 Aug 2018, 10:53

Hi mathmaia,

The feature is in our backlog however it will not be available soon.

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
31 Aug 2018, 10:49

Ηi noppanon,

I cannot provide a definite answer for this, since I do not have enough information. but usually these issues occur when the price for the order is not valid e.g. within the spread.

Best Regards,

Panagiotis


@PanagiotisCharalampous