Replies

PanagiotisCharalampous
28 Jun 2018, 11:05

Hi to both,

Can you please explain how you create the new accounts? Are they demo accounts or live accounts?

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
28 Jun 2018, 10:57

Hi Patrick,

Can you please try rounding SL and TP values to the decimal places allowed by the symbol and let me know if this resolves the issues?

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
28 Jun 2018, 09:41

Hi mparama,

You can use Thread.Sleep() method.

Best Regards,

Panagiotis 


@PanagiotisCharalampous

PanagiotisCharalampous
28 Jun 2018, 09:30

Hi lslord64,

As Astroke proposed, you should talk to your broker about this.

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
28 Jun 2018, 09:27

Hi irmscher9,

As afhacker siad it is possible but not via the cAlgo.API, which is what I assume you are looking for. You just need to develop a custom way to communincate this instruction to all robots. It could be via named pipes, reading from a file or anything else convenient for you.

Best Regards,

Panagiots


@PanagiotisCharalampous

PanagiotisCharalampous
28 Jun 2018, 09:23

Hi 1222Ht,

Can you please clarify what you mean with "still not perform what i wanted"? What do you want the cBot to do and what does it do? Why do you need a SL and TP with 2 decimal places?

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
28 Jun 2018, 09:15

Hi 3047070,

Yes that's it.

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
27 Jun 2018, 17:07

Ηι 1222Ht,

Without the source code I can only make assumptions. Based on the log, I would suggest to round SL and TP to the decimals allowed by the symbol.

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
27 Jun 2018, 16:50

Hi 1222Ht,

We would be able to help you if you posted the complete source code of the cBot, so that we can reproduce the issue. Also, can you check the log to see if you receive a message. Maybe this will clarify the reason that the cBot stops.

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
27 Jun 2018, 16:44

Hi Prabaharan,

Personally I am not aware of such tools. Google has introduced generation of PHP classes for proto 3 but Trading API uses proto 2.

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
27 Jun 2018, 16:24

Hi Prabaharan,

This is WS API and has nothing to do with Connect API. This API is used for integrations with the back end systems of the brokers. Documentation for Connect API is found here.

Best Regards,

Panagiotis

 


@PanagiotisCharalampous

PanagiotisCharalampous
27 Jun 2018, 16:19

Hi Prabaharan,

Connect Trading API uses protocol buffers, not json. Which document are you referring too?

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
27 Jun 2018, 16:04

Hi Prabaharan,

I did not understand what you mean. If you get curl response without an error, then why do you think this is an API problem and not a php issue? Can you please elaborate?

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
27 Jun 2018, 15:52

Hi Prabaharan,

This seems to be a php issue and not an API one. Since most of the community members are .net programmers, I would advise you to seek for an answer in php forum as well.

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
27 Jun 2018, 09:39

Hi Mikro,

Did you try to contact the developers directly?

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
27 Jun 2018, 09:00

Hi MixMan,

You can send it at community@spotware.com.

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
27 Jun 2018, 08:59

Hi,

It is an aggregation from all our servers.

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
26 Jun 2018, 16:45

Hi cwik_m.

The reason is that the cBot seems to crash due to a wrong number of parameters when initializing the indicator. Change your initialization code to the following

 fastMa = Indicators.GetIndicator<HullMovingAverage>(MarketSeries.Close, 21);

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
26 Jun 2018, 15:32

Hi cwik_m,

You are using an obsolete method of referencing indicators. After correcting it, cBot seems to be building fine. See below my version


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

namespace cAlgo
{
    [Robot(TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)]
    public class SampleTrend : Robot
    {
        [Parameter("MA Type")]
        public MovingAverageType MAType { get; set; }

        [Parameter()]
        public DataSeries SourceSeries { get; set; }

        [Parameter("Slow Periods", DefaultValue = 10)]
        public int SlowPeriods { get; set; }

        [Parameter("Fast Periods", DefaultValue = 5)]
        public int FastPeriods { get; set; }

        [Parameter("Quantity (Lots)", DefaultValue = 1, MinValue = 0.01, Step = 0.01)]
        public double Quantity { get; set; }

        private MovingAverage slowMa;
        private HullMovingAverage fastMa;
        private const string label = "Sample Trend";

        protected override void OnStart()
        {
            fastMa = Indicators.GetIndicator<HullMovingAverage>(21);
            slowMa = Indicators.MovingAverage(SourceSeries, SlowPeriods, MAType);
        }

        protected override void OnTick()
        {
            var longPosition = Positions.Find(label, Symbol, TradeType.Buy);
            var shortPosition = Positions.Find(label, Symbol, TradeType.Sell);

            var currentSlowMa = slowMa.Result.Last(0);
            var currentFastMa = fastMa.Result.Last(0);

            if (currentSlowMa <= currentFastMa && longPosition == null)
            {
                if (shortPosition != null)
                    ClosePosition(shortPosition);
                ExecuteMarketOrder(TradeType.Buy, Symbol, VolumeInUnits, label);
            }
            else if (currentSlowMa >= currentFastMa && shortPosition == null)
            {
                if (longPosition != null)
                    ClosePosition(longPosition);
                ExecuteMarketOrder(TradeType.Sell, Symbol, VolumeInUnits, label);
            }
        }

        private double VolumeInUnits
        {
            get { return Symbol.QuantityToVolumeInUnits(Quantity); }
        }
    }
}

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
26 Jun 2018, 12:47

Hi sryap,

Yes this is the correct message.

Best Regards,

Panagiotis


@PanagiotisCharalampous