Replies

PanagiotisCharalampous
12 Oct 2020, 08:32

Hi star_indark,

If you need somebody to develop something for you, you can always post a Job or hire a Consultant.

Best Regards,

Panagiotis 

Join us on Telegram


@PanagiotisCharalampous

PanagiotisCharalampous
12 Oct 2020, 08:23

Hi mcho911,

This is an old thread so probably you are facing different issues. Please send us some troubleshooting information as per the instructions above

Best Regards,

Panagiotis 

Join us on Telegram


@PanagiotisCharalampous

PanagiotisCharalampous
09 Oct 2020, 15:09

Hi star_indark,

See below an example on how to read MACD and RSI values from a custom indicator

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 NewIndicator : Indicator
    {
        [Parameter(DefaultValue = 0.0)]
        public double Parameter { get; set; }

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

        MacdCrossOver _macd;
        RelativeStrengthIndex _rsi;
        protected override void Initialize()
        {
            _macd = Indicators.MacdCrossOver(26, 12, 9);
            _rsi = Indicators.RelativeStrengthIndex(Bars.ClosePrices, 14);
        }

        public override void Calculate(int index)
        {
            Print("MACD: " + _macd.MACD[index]);
            Print("RSI: " + _rsi.Result[index]);
        }
    }
}

Best Regards,

Panagiotis 

Join us on Telegram


@PanagiotisCharalampous

PanagiotisCharalampous
09 Oct 2020, 10:12

Hi xammo,

I am fed up with it so decided to write the following code in an attempt to catch the issue but every time the disconnect happens the bot (below) has stopped and no email is sent (email setup is 100% ok/the other bots running fire off emails no problems) so

The events provided by the cBot are triggered only when the server disconnects you for any reason. When disconnections occur for any other reason beyond our control (e.g. bad connection, poor server performance) then these events will not be triggered.  

please advise what is wrong with the code or how I can achieve the desired results of sending emails every time a connect/disconnect happens

Based on the above, probably the events were not triggered at all. Also if your disconnection is caused by a general internet disconnection, obviously no emails will be sent

But also just to add Panagiotis with all due respect I think you and I both know that a single point of failure in any system is not ‘good enough’ and using a recommended VPS is still a single point of failure no matter which way you look at it

We recommend this as the first step to take for your cBot to run 24/7. Frequent infrastructure outages is something you need to check before proceeding with a software solution to the problem. Disconnections every some hours should not be the case. Is your VPS provider reliable? Where is your VPS located? What is the ping time? Do your machine specs meet the recommended requirements? Can it handle your cBot execution efficiently? In any case, if you need fault tolerance, this is something you need to develop it yourself, since a cBot is your software.

 I have seen other posts going back 5+ years that are requesting greater fault tolerance and resilience of cTrader such as being able to autostart bots if a machine restarts unexpectedly/system crash

Here it is

 

 I really think Spotware need to start putting some effort into making their software (up for an award I think I saw - hope that goes well!) more resilient (for example why isn’t there already a built in tick box in the settings to send an email on server connect/disconnect?)

Our part of the software is fault tolerant. Our servers are up and running for 10 years now and we had no downtime yet.

(for example why isn’t there already a built in tick box in the settings to send an email on server connect/disconnect?)

As explained above, we cannot know if there is any issue on your side. You need to handle these cases yourself.   

 what about developing the ability I already spoke about where the same bot can run concurrently on different machines (multiple machines managing the same code/positions at the same time - I am  sure that would win Spotware many awards! :)

The same cBot can run concurrently on different machines. Nothing prevents you from doing so. But you need to handle the concurrency issues yourself, since it is your logic that is being executed. This is not something cTrader can handle for you, cTrader is just the platform for your strategy to be executed on. It is like asking from a multicore CPU to do the parallel programming for you. This is not possible. If you need concurrency, you need to write the cBot code in a way that it can run concurrently on many machines. 

Best Regards,

Panagiotis 

Join us on Telegram


@PanagiotisCharalampous

PanagiotisCharalampous
09 Oct 2020, 07:48

Hi linton.nkambule,

You can always ask for professional assistance by posting a Job or contacting a Consultant.

Best Regards,

Panagiotis 

Join us on Telegram


@PanagiotisCharalampous

PanagiotisCharalampous
08 Oct 2020, 15:02

Hi Alex,

The best thing would be use Visual Studio for your development. cTrader Automate editor is very primitive compared to Visual Studio.

Best Regards,

Panagiotis 

Join us on Telegram


@PanagiotisCharalampous

PanagiotisCharalampous
08 Oct 2020, 09:42

Hi jayteasuk,

It seems you are using Open API 1.0 to develop your application. You need to use Open API 2.0 since v1.0 will be decommissioned next month.

Best Regards,

Panagiotis 

Join us on Telegram


@PanagiotisCharalampous

PanagiotisCharalampous
08 Oct 2020, 08:12

Hi ctid2568413,

I could not reproduce the issue unfortunately. Also this is not a cTrader related issue but a general WinForms programming issue. You may want to think of a different approach for your application.

Best Regards,

 

Panagiotis 

Join us on Telegram


@PanagiotisCharalampous

PanagiotisCharalampous
08 Oct 2020, 08:09

Hi m.cambria1996,

Navigate to Automate > Indicators, right click on the indicator you want to uninstall and select Delete.

Best Regards,

Panagiotis 

Join us on Telegram


@PanagiotisCharalampous

PanagiotisCharalampous
08 Oct 2020, 07:59

Hi genappsforex,

Please provide us more information on how to reproduce this error.

Best Regards,

Panagiotis 

Join us on Telegram


@PanagiotisCharalampous

PanagiotisCharalampous
08 Oct 2020, 07:56

Hi xabbu,

This happens because you are reading only the last value of the indicator here

                while (!csvParser.EndOfData)
                {
                    // Read current line fields, pointer moves to the next line.
                    string[] fields = csvParser.ReadFields();
                    _datefield = fields[0];

                    _evzValue = fields[1];

                }

You should be using collections e.g. a list and store all the values, not only the last one.

Best Regards,

Panagiotis 

Join us on Telegram 


@PanagiotisCharalampous

PanagiotisCharalampous
08 Oct 2020, 07:50

Hi Adrian,

There is no such option at the moment.

Best Regards,

Panagiotis 

Join us on Telegram


@PanagiotisCharalampous

PanagiotisCharalampous
07 Oct 2020, 07:55

Hi Mick,

Stop limit orders are not available on FIX API at the moment.

Best Regards,

Panagiotis 

Join us on Telegram


@PanagiotisCharalampous

PanagiotisCharalampous
06 Oct 2020, 16:45

Hi giovanisgarabotto,

For somebody to help you, you need to share your cBot code and explain what do you need to be changed.

Best Regards,

Panagiotis 

Join us on Telegram


@PanagiotisCharalampous

PanagiotisCharalampous
06 Oct 2020, 14:41

Hi ManInMoon,

Stop outs are used by brokers for their own protection. Traders should never rely on a stop out for protection. They should use stop losses. 

Best Regards,

Panagiotis 

Join us on Telegram


@PanagiotisCharalampous

PanagiotisCharalampous
06 Oct 2020, 12:38

Hi snowchilli,

There is no such information in OTC markets so you cannot expect to have this in a CFD platform.

Best Regards,

Panagiotis 

Join us on Telegram


@PanagiotisCharalampous

PanagiotisCharalampous
06 Oct 2020, 12:19

Hi Mason,

If you google for cTrader VWAP indicators, you will find a lot.

Best Regards,

Panagiotis 

Join us on Telegram


@PanagiotisCharalampous

PanagiotisCharalampous
06 Oct 2020, 11:53

Hi Christian,

DeltaClose is not populated for Live trendbars, only for historical ones, since the bar has not closed yet. You should be using the bid price instead. 

 Best Regards,

Panagiotis 

Join us on Telegram


@PanagiotisCharalampous

PanagiotisCharalampous
06 Oct 2020, 11:05

Hi xabbu,

It cannot get simpler than the link I posted above. Here is again the code sample

    using(var reader = new StreamReader(@"C:\test.csv"))
    {
        List<string> listA = new List<string>();
        List<string> listB = new List<string>();
        while (!reader.EndOfStream)
        {
            var line = reader.ReadLine();
            var values = line.Split(';');

            listA.Add(values[0]);
            listB.Add(values[1]);
        }
    }

You can do it anywhere you want. If you cannot implement it, then maybe you should ask for professional assistance.

Best Regards,

Panagiotis 

Join us on Telegram 


@PanagiotisCharalampous

PanagiotisCharalampous
06 Oct 2020, 10:38

Hi xabbu,

I am still not sure what information are you looking for. Can you make your question more specific? If you just want to draw imported values, then just add them to an IndicatorDataSeries and the indicator will do the job for you. Check any of the sample indicators available in cTrader on how to do this.

Best Regards,

Panagiotis 

Join us on Telegram 


@PanagiotisCharalampous