MT to cTrader Trade Copier

by mt2ct in category Other at 02/07/2014
Description

MT4 to cTrader Trade Copier is designed to copy MT4 trades from any demo or live MT4 account to any demo or live cTrader account. 
MT4 Investor Password is enough to start copying trades right now.

Website: http://mt2ct.com/

Download
2538 downloads
How to install
Warning! Executing the following cBot may result in loss of funds. Use it at your own risk.
Notification Publishing copyrighted material is strictly prohibited. If you believe there is copyrighted material in this section you may use the Copyright Infringement Notification form to submit a claim.
Formula / Source Code
Language: C#
Trading Platform: cAlgo
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Threading;
using cAlgo.API;

namespace cAlgo
{
    [Robot(TimeZone = TimeZones.UTC, AccessRights = AccessRights.FullAccess)]
    public class TradeCopierReceiver : Robot
    {
        private const int TimerIntervalInMs = 100;
        private const string CopierTextObjectName = "info";
        private readonly TimeSpan _defaultTimerInterval = TimeSpan.FromMilliseconds(TimerIntervalInMs);
        private CopierFileService _copierFileService;
        private ExecutionService _executionService;

        private DateTime _lastWriteTimeCache = DateTime.MinValue;
        private TimeSpan _maxInterval;

        [Parameter("Symbols", DefaultValue = "")]
        public string SymbolsFilter { get; set; }

        [Parameter("Copy Protection (SL, TP)", DefaultValue = true)]
        public bool CopyProtectionEnabled { get; set; }

        [Parameter("Copy Long (Buy) positions", DefaultValue = true)]
        public bool CopyBuy { get; set; }

        [Parameter("Copy Short (Sell) positions", DefaultValue = true)]
        public bool CopySell { get; set; }

        [Parameter("CopierID")]
        public int CopierID { get; set; }

        protected override void OnStart()
        {
            Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture;

            _copierFileService = new CopierFileService(this);
            _executionService = new ExecutionService(this);

            if (_copierFileService.CanProcessFile)
            {
                Timer.Start(_defaultTimerInterval);
                ChartObjects.DrawText(CopierTextObjectName, "Signal Receiver is running...", StaticPosition.TopRight, Colors.Yellow);
            }
            else
                Stop();
        }

        protected override void OnTimer()
        {
            _copierFileService.UpdateState();

            IEnumerable<TraderCopierArguments> args;
            if (!CanProcessArguments(out args))
                return;

            if (_executionService.Execute(args))
                _lastWriteTimeCache = _copierFileService.LastWriteTime;

            SetProcessingFileResult();
        }

        private bool CanProcessArguments(out IEnumerable<TraderCopierArguments> args)
        {
            args = null;

            if (!_copierFileService.CanProcessFile)
                return false;

            if (_copierFileService.LastWriteTime == _lastWriteTimeCache)
                return false;

            try
            {
                args = File.ReadAllLines(_copierFileService.FilePath).Select(TraderCopierArguments.Parse).ToArray();
            } catch (IOException ex)
            {
                Print("Read information failed: " + ex.Message);
                SetProcessingFileResult();
                return false;
            } catch (Exception exception)
            {
                Print("Failed to read file: " + exception.Message);
                Stop();
                return false;
            }
            return true;
        }

        private void SetProcessingFileResult()
        {
            if (_executionService.ExecutedOperationsCount > 0)
                DoubleTimerInterval();
            else
                ResetTimer();
        }

        private void ResetTimer()
        {
            Timer.Start(_defaultTimerInterval);
        }

        private void DoubleTimerInterval()
        {
            var newInterval = TimeSpan.FromMilliseconds(Timer.Interval.TotalMilliseconds * 2);
            _maxInterval = TimeSpan.FromMinutes(1);
            if (newInterval > _maxInterval)
                newInterval = _maxInterval;
            Timer.Start(newInterval);
        }

        protected override void OnStop()
        {
            Timer.Stop();

            ChartObjects.RemoveObject(CopierTextObjectName);
        }
    }
}
Comments

ashgupta - July 07, 2014 @ 03:11

Download is not working on the Website: http://mt2ct.com/ . Can you please fix it ? I would like to give this copier a go and will like to test it.

mt2ct - July 07, 2014 @ 10:14

Download is working. Please try it one more time.

ashgupta - July 09, 2014 @ 03:04

Still the same issue mate. Can't download as link is down. 

 

The web page at https://onedrive.live.com/download?resid=8354967F438497B7!107 might be temporarily down or it may have moved permanently to a new web address.

mt2ct - July 09, 2014 @ 11:26

Mirror link:

http://mt-ct.com/Setup.zip

aisaac - October 30, 2014 @ 16:48

is possible copy to ctrade at mt4 ?

and copy pending orders

and set trail protection.

thanks.

mt2ct - October 31, 2014 @ 11:45

is possible copy to ctrade at mt4 ?

and copy pending orders

and set trail protection.

thanks.

No, it is not possible to copy pending orders.

Trail protection will be copied if you set trailing stop in MT.

SwapBridgeCapital - January 23, 2015 @ 10:07

Can this be used to copy cTrader to cTrader using the same method? 

Please view my job listing here - http://ctdn.com/jobs/105

Marcin - January 23, 2015 @ 14:29

Hi RedRhinoFX I have got a solution, see Your messages.

kamol - February 19, 2015 @ 19:31

Hi

How does it know the path where I installed MT4.

I installed the EA but could not find any "TradeCopierProvider" file.

Stearns - March 01, 2015 @ 08:50

I agree with kamol.

I did the install, but only found the cAlgo Receiver files, not the MQL Sender files.  

Where can I get that?

Thanks,

Stearno

SwapBridgeCapital - March 02, 2015 @ 08:41

@MindBreaker - https://github.com/breakermind/cAlgoCopier/blob/master/cAlgoSignalProvider.algo - Why not keep the socket connection open? Such as provider <-> server <-> client 

 

that way, the instant a trade opens it will be relayed to the client
because a socket connect is open between the two

Dave_gen - March 09, 2015 @ 04:59

@RedRhinoFX i am interested in Ctrader to cTrader Trade copier , do you happen to have a solution now?

Thanks

 

Marcin - March 28, 2015 @ 21:17

@RedRhinoFX - it is simple example (but if provider set order only one in a day/week/month for what keep socket connection open all the time) or for what send the same data to the server  every tick :)

megamemo - May 25, 2015 @ 20:46

hi and the ea where do i findit?' im count of loss cut somebody explainme 

Gorydan - June 19, 2015 @ 13:02

@mindbreaker As RedRhinoFX said, I would like a version with the socket connection always opened because I use a scalper EA on MT4 that works on price impulsion and closes the positions very fast.

A low latency is very important between MT4 and CTrader. The door between them must stay opened to not have to open it every trade.

Thanks

ahas - July 08, 2015 @ 23:02

anyone still using this cbot? i installed it on mt4 and ctrader but it's not working on ctrader when i press play button it does nothing means not activating. any solution?

topgun - August 11, 2015 @ 18:07

is there a way to say have the MT4 trade 1 lot and the Ctrader to trade 0.5 or 2 lots ?

armagedon - October 18, 2015 @ 18:19

How to make it work in 1 chart at mt4 where other EA is running? I use EA, so need it to be copied into ctrader

lkbaghel - December 18, 2015 @ 05:32

i want copy trader from Ctrder to MT4

olikern26 - June 30, 2016 @ 19:19

Can somebody tell me how the Trade Copier works? How can cAlgo receive signals from indicators on MT4? 

Kumar - July 21, 2016 @ 13:06

Can we have one that copies from ctrader to mt4? ctrader is superb for trading but my broker has only metatrader 4.

ctrader charting platform is the best. One can easily trade H8 or H12 using D2 and D3 as bias charts.

conny.rosenberg@gmail.com - August 05, 2016 @ 11:31

explict file path wath this meen?

nhen - October 31, 2016 @ 08:34

Anyone ever find a solutions for copying trades between two cTrader accounts?

djh.paganprophet@gmail.com - December 04, 2016 @ 00:41

Say I wanted to place a trade with MT4 based on price movement in cTrader..

Can this be done?

kitcadservices - December 22, 2016 @ 01:56

Hi, Thanks This was super easy to install and worked perfectly. Can you let me know when you will be adding a lot multiplyer or similar so it will open trades more suitable to account size. Cheers

Pipdays - January 19, 2017 @ 23:04

The main issue I have with this cBot is that partial trade closure in MT4 causes closure of the entire trade in CT. CT then opens another trade at the current market price for the remaining volume. It is a serious issue as one could lose much money. Do any of the programmers know of a fix?

Pipdays - January 19, 2017 @ 23:10

nHen, simply use www.cmirror.com from Spotware to copy trades from one cTrader account to another. Link all accounts via your cTID and then login to cMirror and enble copying. You may also copy the trades of succesful traders for a fee -copy mine called AAA+ -:)  Although cMirror is efficient in copying trades, it has some bugs with the website - total for all open trades does not add up properly, all linked acounts do not show the signal provide it is mirroring, etc, etc. A new version of cMirror is under construction. 

Oscar.G - March 03, 2017 @ 21:43

What I am doing to avoid the problem of partial closures, is open microlots (1k). Then I can close the positions I want, without changing the commission costs.

Regards

@mDull618

nolenar - April 12, 2017 @ 09:38

Good morning!

The page won't load  http://mt2ct.com/ I get 'your connection has timed out' message, and then the 504 error. (I have refreshed multiple times, and tried different connections.) Can you check it, please?

ChasBrownTH - May 02, 2017 @ 12:12

That domain name is now for sale, so I guess the previous operator gave up?

I have a copy of the MT4 Trade Sender source file, so I put it online, HERE:

http://angloam.net/MT4-cAlgo-TradeCopier-OLD-files/TradeCopierProvider.mq4

Use that source code to build an .ex4, then run it. Change the ID in both MT4 and cAlgo versions, the IT WORKS! At least it works for me, 99.9% of the time.

However lately I had a few problems, some of my VPS instances started using different default MT4 Data Directories/Folders, either in 'Program Files(x86)' OR in .AppData/Roaming/etc .. VERY CONFUSING!

I must stress that the .mq4 FILE I am making available is NOT my work, nor am I 'supporting it'. But if anybody has rael problems getting it to work then I am willing to try to help.

ChasBrownTH - May 02, 2017 @ 12:16

I added the .ex4 as a download.

http://angloam.net/MT4-cAlgo-TradeCopier-OLD-files/TradeCopierProvider.ex4

0