Inside Bar Momentum Backtesting

Robopip has posted a new mechanical system called the Inside Bar Momentum Strategy.

I use cTrader for trading and cAlgo for automation. I like the fresh modern interface of cTrader and I like that automation is done with C# a language I am intimate with as a professional developer.

I decided to create a Robot (equivalent of an MT4 EA) for the new system and thought it might help to post back testing results here for anyone who might be interested.

cAlgo has a back testing tool built in so I will be running all tests as follows:

Account Size: GBP10K
Trade Risk: 1% of current balance
Data Range: 1st Jan 2014 - 31st Dec 2016 (3 years)
Data Type: Tick data from server so as accurate as possible

For each test I will post screenshots of the Equity Curve and the Trade Stats and attach an Excel export of the trade history.

Baseline Test for USDJPY H4

Equity Curve

Trade Stats (42.4 KB)

Baseline Test for AUDJPY H4

Equity Curve

Trade Stats (39.7 KB)

Baseline Test for NZDJPY h4

Equity Curve

Trade Stats (35.1 KB)

Baseline Test for GBPUSD H4

Equity Curve

Trade Stats (49.7 KB)

Baseline Test for EURJPY H4

Equity Curve

Trade Stats (41.7 KB)

Baseline Test for GBPJPY h4

Equity Curve

Trade Stats (42.8 KB)

Baseline Test for EURUSD h4

Equity Curve

Trade Stats (47.1 KB)

So I have established a baseline for a number of JPY pairs, because the initial feedback in comments was that the system likes these and I have added EURUSD because apparently it is the most traded pair and GBPUSD because I like this pair and trade it fairly frequently.

It seems to me that the system in it’s raw form like this generates some big wins (more on some pairs than others) and a lot of small losses. On some of the pairs the losses outweigh the wins to the point the you probably wouldn’t want to trade this system with them at all.

For the next set of tests I am going to build in a trailing stop to see if we can reduce the cases where the trades almost made it to the TP target then turned around. Felix noted this in comments too so seems like a good place to start optimising.

I already have a base trade manager class that I can inherit from so shouldn’t take me long to hook this up and implement a simple rule that moves the stop loss to break even when the trade is in profit by the same number of pips as the stop loss is set to.

Stay tuned for the next sequence of test results…

This may be slightly off topic, but I noticed you’re a C# developer and using cAlgo (went over your blog), have you considered automating the UI?

I haven’t considered it up to now. It wouldn’t be difficult there are a number of automation frameworks that could be used. I have used some of them to implement automated acceptance testing in projects I have worked on.

From some probing I have done with WPF spying tools I don’t think automation would help with automating trading systems, the charts appear to be rendered using low level GDI api calls.

Did you have something specific in mind?

Automating the platform would mean being able to write your own script to schedule the backtesting and optimization of strategies (periodically rebalance your portfolio, rather than manually having to set up backtests). Since cAlgo does not expose a command line interface, that’s the only way I can think of aside from code injection.

I looked into it in the past and was not able to come up with a workable solution as the UI automation would freeze quite often. I ended up just building my own testing platform instead.

Sorry about the delay in posting next set of results. I started a new contract recently and it has kept me busy.

This next sequence adds a break even rule.

The base trade manager I use allows me to enable a break even rule either as a percentage of the stop loss or a fixed number of pips.

In the following sequence of results I have used 50% of the stop loss.