ChasBrownTH's avatar
Made a breakthrough in 2015, finally created a Robot that works and makes money. It is not perfect yet, but I have high hopes! The moral is, never stop trying!
ChasBrownTH's avatar


Member since: 20 May 2015

Favorite symbols:



Enthusiastic amateur trader, with 11 years trying to find a 'Holy Grail'. Damn all success until recently, but always trying! :)


Made a breakthrough in 2015, finally created a Robot that works and makes money. It is not perfect yet, but I have high hopes! The moral is, never stop trying!

Last Algorithm Comments

@Rasmussen Martingale Bot v.4:  21 Jul 2017, 00:09

I do not trust backtests, or even optimising, but it can be a good place to start. Having now done lots of promising back tests, as well as some live forward tests, it is making good profits. If the trend continues I shall risk some real money soon'ish. I am trying it out on lots of pairs, with AudUsd and UsdJpy being favourites for me. Using a setup derived from Optimising the past 90 days I then allowed live Demo trading and each made sensible decisions and good profits. BUT it is still far too early to know if this is all a fluke, or is repeatable. I think readers ought to know that the 'Martingale' aspect is far from being the usual wild erratic suicide ride that most are, but instead it can be used in a managed limited way, or not at all. Please do not be put off by the Martingale name, in this case it is just a shorthand for a logical response to some errant trades. 'Rasmussen' seems to have a decent trade selection mechanism, however only time and live trading will tell. It would be good to hear from other users or interested parties as the author suggested. I shall be making a few suggestions once I am ready, as well as making saved Parameter Setups available to anybody who wants to share them. Quid Pro Quo, as they say  ;)

@Rasmussen Martingale Bot v.4:  17 Jul 2017, 22:49

Fascinating work, clearly lots of effort went into this, thanks for sharing it. Just started running tests but seems to have real potential, but all trading needs great care of course. Fingers Crossed ;)

@Martingale Robot:  02 May 2017, 12:57

I love Martingales, in Backtesting, but not when they eventually trash my Real account, even a tiny one! However overall I have made money, just not as easily as I had hoped, but it is worth exploting, I think? I also persevere with them, trying to get one of the many variants just right. Thanks for sharing this! ;)

@Martingale twist:  02 May 2017, 12:35

This implodes and wipes the account on the very first trade in my attempts at backtesting? It just creates a new Buy order on every tick, how could it ever work? Your screenshot shows only Sells, did you upload the wrong code ?

@MT to cTrader Trade Copier:  02 May 2017, 12:17

@MT to cTrader Trade Copier:  02 May 2017, 12:16

I added the .ex4 as a download.

@MT to cTrader Trade Copier:  02 May 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: 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.

@Tango Trade Optimizer:  31 Aug 2016, 18:58

This is a clever idea, thanks for sharing! ;)

@Time Range Highlighter:  05 Aug 2016, 22:57

Thanks, 'pennyfx'. It graphically reminds me to pay attention at key times of the day. I needed to reduce the 'HistogramHeight' setting, or my 1m charts got flattened. ;)

@Trade Tweeter:  31 Jul 2016, 19:35

An excellent idea and very well implemented. Many thanks  ;)

Last Forum Posts

@Any working mt4-ct trade copy solution?:  02 May 2017, 18:17

Caveat: Since the website is now offline and for sale it seems to have been abandoned?

So you can get the mt4 source here >>

The MT4 Trade Sender .ex4 is here >>

Hope this helps, remember to set the ID in both the MT4 and CTrader setups. The only problem I ever had is that MT4 sometimes moves the 'Data Area', it can be in


where it is looked for by the cAlgo bot, but sometimes MQ4 writes into

"C:\Program Files (x86)\MetaTrader 4 IC Markets\terminal.exe"

In which case the cAlgo bot cannot find the file and fails to work, so I am trying to modify the code, but it is 'very cryptic', at least to me! It would be far easier if the path was always fixed and constant, but in some cases it isn't. I think Microsoft are to blame, they 'improve' things in newere versions and abandon past users sometimes.

@Existing cAlgo stopped working after installing a new cAlgo obtained from  22 Jan 2017, 21:45

GeoFinex said:

cAlgo not working

Please send it to

Hi i am facing the same problem, my existing cAlgo as well as cTrader stopped working.

I tried to uninstall and reinstall it but a message displays "cannot install application contact support"

Please let me know how can i fix this issue. I already sent the error file to the said email. Regards

I had a similar problem, cAlgo loaded but did not display a window. cTrader loaded, but did not let me add any charts.

Alt-Ctrl-Shift-T did nothing at all in cAlgo .. I tried various levels of renaming and deleting, which didn't help.

As a last resort I deleted everything in /Documents and /AppData/Roaming -> THAT WORKED !!

I copied back my BOTs and everything is fine now, but I have no idea what went wrong of if it will recur ?

This all happend when I was trading LIVE, with REAL MONEY .. it was very scary!

Luckily I keep a couple of backup PC's running, plus a pair of VPS, so I was able to shut down my trades.

I LIKE cAlgo, but sometimes it is 'Out For Lunch' for no obvious reason ? Also all my instances disconnect several times a week, with no pattern I can see.

Maybe there are answers? Maybe this description helps some other User?

@Switching on/off indicator/robor by keystroke:  31 Jul 2016, 19:08

re.Romanov Capital 'this can be done from within an indicator or cBot easily.' Can you please explain how?

I need to store data at specific times and it would be wonderful to just click a chart then have my Bot write to my database at that exact moment.

@Max Historical Equity:  06 Jul 2016, 04:33

PS - I use your Memory manager BOT and it is excellent !  Thank you for sharing it. ;)

@Max Historical Equity:  06 Jul 2016, 04:28

I have been wrestling with the same sort of problems, but in the end I think I found a workable solution. I wanted to be able to run extensive Optimisation cycles then analyse ALL the results, not just the top 20. So I use mySQL to keep very comprehensive records, then analyse it all externally, using my own Delphi creation. ;)

I can also re-create all the Equity Charts I want now, which makes it much easier to see what happened.

First I tried adding code into OnStop(), that wrote details of the BackTests out to mySQL, which works up to a point, BUT does not have access to trade.Equity.

Now I have added code into OnPositionsClosed() that does the trick, by being able to get the Account.Balance and Account.Equity for each trade as it happens.

    Incidentally Account.Equity is the same as (Account.Balance + Account.UnrealizedNetProfit), not that it helps in this case though.

For your specific case, ie. seeking the max historical equity?, then you could just keep a running total from within OnPositionsClosed()

ie. something like this: [ first create a couple of global Vars, such as MaxEquity & MinEquity, also initialize them in OnStart() ie. MaxEquity = Account.Balance etc ]

         private void OnPositionsClosed(PositionClosedEventArgs args) 


              if (Account.Equity > MaxEquity)

              { MaxEquity = Account.Equity }

              if (Account.Equity < MinEquity)

              { MinEquity = Account.Equity }


I think that ought to work ?  ;)                   

my own working example collects everything: [ sample here, or at least the key parts of it ]

        /// <summary>
        /// OnPositionsClosed - called after every Order is closed
        /// </summary>
        /// <param name="args"></param>
        private void OnPositionsClosed(PositionClosedEventArgs args)
            if (IsBacktesting)
                // mysql query to report backtest Trade HISTORY
                string query = "INSERT INTO backtest_history (uniqueid, finished, Balance, Equity, balunreal, Trades, BotVer) VALUES ('" + strUniqueBacktestID + "','" + Server.Time.ToUniversalTime() + "','" + Math.Round(Account.Balance, 2).ToString("0000000.00") + "','" + Math.Round(Account.Equity, 2).ToString("0000000.00") + "','" + Math.Round((Account.Balance + Account.UnrealizedNetProfit), 2).ToString("0000000.00") + "','" + History.Count.ToString() + "','" + BotVer.ToString() + "')";

                // add copy to Log file for easy viewing
                Print("OnClosed: " + query);

                //create command and assign the query and connection from the constructor
                MySqlCommand cmd = new MySqlCommand(query, mySQLconnection);
                //Execute command
                // cleanup mySQLconnection

I hope this helps? One limitation is that I have to dump the history of losing sequences, since I see no way to filter them.

But using OnStop I can have

                if ((NetProfit > 0) && (Account.Equity > 0))
                    foreach (HistoricalTrade trade in History)

BUT no access to the all important trade.Equity figure .. maybe Spotware will add it to the History collection sometime in the future ?

@Cannot edit cBots in Visual Studio:  29 May 2016, 20:26

The VSExtension.vsix file structure, as well as how to edit it, is explained here and it works!


There is also a working copy kindly provided on their site, if you search for it.

@cAlgo Visual Studio extension:  29 May 2016, 20:10

Marvellous, that worked perfectly !  Thank you so very much. ;)

re. The vsix is simply a zipped file

@Need your bot coded?:  27 May 2016, 14:50

No offence but it sounds like you want us to give you ideas, for Free, then pay you to try to write them?

Perhaps if you offered some sort of Samples of your work it might be more believable, but you have not shared or uploaded anything at all.

I believe there is also a 'Protocol' for would be 'Consultants', some sort of Registration?

Good luck, reply if you want to chat, I have what I think are good ideas, but they are not Free. ;)

@re. Back testing times seem to be wrong, it also seems to ignores OnStart:  27 May 2016, 14:43

ChasBrownTH said:

How very bizarre, but neither of these 'errors' happens with a blank New Robot.

Therefore it has to be something 'odd' or 'broken' in my Robot, OOooooops ! 

I shall review every line, but what on earth could cause the Log file to get truncated and Server.Time to get mangled?

My apologies to Spotware for reporting a non existent error, and my thanks to them for helping me find 'the error of my ways'. ;)

Mea Culpa, so time for me to go and find my hair shirt I think, plus the flail! ;)

@re. Back testing times seem to be wrong, it also seems to ignores OnStart:  27 May 2016, 14:01

I apologize if this was covered already, but I tried to search and found nothing relevant.

If I put 

     Print("Hello World"); 

in OnStart it shows up in the Log file when forward trading, as it should. 

But the same Print statement does nothing in Back-testing, which is pretty odd? In fact the whole back testing Log file seems to start 'late' and ignore some early events that ought to be published in there.

I added "Hello World" to check what was happening, because some of my variables also do not work in Back-testing.

Also in back tests the Server.TIme gets set to the last day of the test period, not the date and time of the actual past event. Is there a way to get the time of the past event, for example at each Tick ? Back testing sees the correct time of Trades, but nothing else seems to work, making further time related actions impossible, although they work in 'Forward' time.

For example I have tried using:

    Print("TimeIs: ", MarketSeries.OpenTime.Last(0));

to get the time of a past Bar, but it does not work.

Try it yourself:

    OnTick { Print("ServerTime is: ", Server.Time.ToString()); } just produces 'nonsense' not related to the past event, but generally just the last date of the test period, which is quite useless since we know that already.

Am I doing something stupid or just plain wrong? I admit am still a bit of a newcomer to cAlgo and also C#,

Is there a 'fixable' reason why Back-testing seems to ignore OnStart and Server.TIme is wrong? 

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.

No uploaded.

Warning! Executing cBots downloaded from this section may result in loss of funds. Use them at your own risk.

No uploaded.