Deadline June

Between individual currency pairs, that stat would be quite variable.

Across the basket of currencies it should be quite good, but it's difficult to calculate the drawdown.

I could just merge the PnL for all currencies. That's the brute force approach.

Otherwise either (1) I could take the maximum drawdown by any one currency pair.

or (2) I could take the average maximum drawdown for all currency pairs.

Or (3) i could use the sum total of maximum drawdowns for the basket.

I think (2) would be an underestimate but (3) would be an overestimate.
 
Last edited:
Almost.

It'll run the backtest on the portfolio but will only give me limited stats on the combined results. e.g. max drawdown is actually the average max drawdown of all instruments, not of basket.
 
Uh oh. May I suggest Amibroker, it will do complete portfolio analysis, including allowing you to specify a maximum number of open positions (e.g. ten markets, take no more than five positions).

I used to backtest with ProRealTime but the fundamental flaw (and this is true of many software packages) is that there is no portfolio analysis.
 
I might have to check it out. One fundamental problem with software packages that I've looked into is that they won't let you write systems using multiple instruments or multiple time frames. Does amibroker allow that?

The other functionality I like is the ability to optimise the time frame.

Actually I am meant to import all the PnL into my own app which will do the portfolio analysis but at the moment I'm stuck with it on some database issue and haven't given it the time it requires.
 
Adamus

The Multiple time frame issue is resolvable but the solution is 'hairy'.

You use the lowest timeframe and then create 'synthetic' bars for the higher timeframes. You would probably (depending on language) then also need to create new indicators etc based on these synthetic bars, not the real ones.

I have done this & I have code for Tradestation that you might be able to pull apart if you want.

DT
 
I might have to check it out. One fundamental problem with software packages that I've looked into is that they won't let you write systems using multiple instruments or multiple time frames. Does amibroker allow that?

The other functionality I like is the ability to optimise the time frame.

Actually I am meant to import all the PnL into my own app which will do the portfolio analysis but at the moment I'm stuck with it on some database issue and haven't given it the time it requires.

You can refer to different timeframes in Amibroker -

http://www.amibroker.com/docs/MTFIndicators.html

You could trade off 5 min bars using a 1hr moving average, for example.

I can't recommend Amibroker highly enough.. for $290 it's a stunning piece of kit, and you will be blown away by its speed (conservatively, it's at least 50 times quicker than ProRealTime).

If you plan to trade a mechanical system on different markets, you simply HAVE to do proper analysis.. if you don't, you will lack the confidence you need to persist with the strategy during drawdown - this is by far the hardest aspect of system trading. The system almost becomes secondary.. the psychology is of utmost importance.

Amibroker language is C++ which you're probably familiar with anyway. Switching will take you a month or two, but you'll be glad you did..
 
I can't recommend Amibroker highly enough.. for $290 it's a stunning piece of kit, and you will be blown away by its speed (conservatively, it's at least 50 times quicker than ProRealTime).

That's a strong recommendation. I shall bear it in mind. From a point of view of satisfaction though, I would rather see the NinjaTrader lot put out a stable release. However it's just gone "Release Candidate 1" and there are still immense problems with it, especially connecting to IB.

What broker do you connect up to for live quotes and historical data? I think you mentioned this already.

I am also attracted by the little I know of NeoTicker, but I haven't gone so far down this road yet because I spend all my spare time keeping NinjaTrader running.
 
Adamus

The Multiple time frame issue is resolvable but the solution is 'hairy'.

You use the lowest timeframe and then create 'synthetic' bars for the higher timeframes. You would probably (depending on language) then also need to create new indicators etc based on these synthetic bars, not the real ones.

I have done this & I have code for Tradestation that you might be able to pull apart if you want.

DT

Thanks but no thanks. That sounds like a recipe for madness. Hairy indeed. I've actually only got a couple of ideas in the pipeline that I need this multiple timeframe capability for so realistically speaking I should just forget about them anyway and stick to the more run-of-the-mill stuff.
 
Checklist for good systems, v.4

System Building Checklist v4

* tailor entries and exits to envisioned trade lengths, frequency, hit rate etc and don't faff with bells and whistles if your basic system is a turd
* Is unoptimised system profitable both long only and short only?
* Is unoptimised system profitable over 10 years?
* Is unoptimised system profitable on unseen periods long enough to be more than chance?
* Is the profit spread out across the period, i.e. is there a nice equity curve?
* Is max drawdown less than 50% of total profit?
* Is longest drawdown less than 18 months?
* Does it work unoptimised across all major pairs?
* Are there any stupidly profitable trades, i.e. >5 x bigger profit than avg?
* Are there any stupidly long trades, i.e. >5 x longer than avg duration?
* Are there any massive losses?
* CAGR divided by drawdown should be greater than 0.8

Thanks meanreversion for the last point - I can't get this until I've imported my PnL into my risk analysis app. Strangely I was able to optimise on it, but not display or even find it out in any way unless I log it to file myself, thanks to some NinjaTrader quirkiness.

Meanwhile, I need to start a list of common mistakes to check for when the backtesting results look too good to be true. I've currently got the Holy Grail again and I can't see why. Possibly a backtest on blind data will show the problem, or running it for a day in simulation. Otherwise it's always slightly difficult looking for something I don't want to find.
 
Checklist to tarnish a Holy Grail, v.1

Checklist of Stupid Mistakes giving Improbably Profitable Backtest Results

* check number of trades - not enough trades. e.g. 1 trade in whole period, always looks really profitable
* short test period with a big trend makes trades in one direction massively profitable
* exit at small target on same bar - always looks good
* forgotten about slippage and commission? That HFT system probably won't work unless you have Goldman Sachs' trading platform.
* if it's a backtest across a basket of instruments, one massively profitable instrument can make the whole basket look good - which reminds me: if one instrument in a basket is massively profitable, the weighting is probably out by a factor of 10.
 
Last edited:
Keep forgetting this one:

Compound Annual Growth Rate (CAGR) Formula
Interest rate at which a given present value would "grow" to a given future value in a given amount of time. The formula is

CAGR = (FV/PV)1/n - 1

where FV is the future value, PV is the present value, and n is the number of years.

re trading so far: up on the week, down on the month, up on the quarter, down on the year. Does that say anything?
 
If you backtest in Amibroker, it gives you the correct CAGR for your system. For example, let's say your system makes 20% in year 1 and again in year 2. In total you are up 44% (1.2^2), but Amibroker returns CAGR as +20% (which is correct).

Some systems simply divide final return by number of years and return 44/2 = +22% per year, which is obviously incorrect.

Just as an aside..
 
I hate working in percent and at the moment I don't have to. If I find I don't have enough capital for my 2nd and 3rd systems and need some more, I'm going to have to put the PnL in percent - based on an initial capital the size of which is defined in different ways by different trading philosophies.

I guess my seat-of-my-pants initial capital per system is the max historical drawdown * 1.xx %

However I know you can squeeze it down lower than that following the MM strategies in Vince's Mathematics of Money Management.

PS thinking on the hoof again. I can reduce my leverage in forex right down to a lot size of $25K if I want, so I shouldn't need any more capital to trade all 3 systems on all 22 currencies.

PPS Expanded my current basket from 11 to 22 currencies, using the crosses that have available backdata on FXCM and IB. I'm currently very nicely surprised at the low slippage on the market orders I'm getting in the crosses.
 
Yesterday was a massacre, about 8 out of 10 trades were losses.

The NZD/USD stepped off a cliff and hit my stop half way down - the resulting slippage: 35 pips. I didn't factor that amount of slippage into my calculations.

That's the second big slippage I've had. The first was last month in GBP/USD for the same amount.

Funny that I'm trading crosses like GBP/AUD but I get the monster slippage in the dollar-based pairs. No doubt it will come - hopefully it won't be even more monstrous in the crosses. Imagine getting filled 70 pips below your stop without even a gap to show for it on the chart.

There might have been more trades but a series of powercuts in the North London area severely limited my up-time.

NinjaTrader 7 beta release candidate 1 was at its worst. It cost me about 5 hours trying to get it up and running and of course the issue's not reproducible by their support team.

I'm looking at Amibroker now.
 
sponge

My memory is like a sponge. Not a nice bathroom sponge that you would envisage, but more like a Victoria sponge that goes crumbly at the edges and is only good for soaking up tea.

MFE = Max favourable excursion
MAE = Max adverse excursion
ETD = End-of-trade drawdown
 
Pass me the axe

Stupid newbie error. IB closes the NZD pairs from 13:00 NY time so they say - although I'm sure I traded it at 15:00. Whatever, that was why I suffered such immense slippage - my stop wasn't executed until IB re-opened the NZD/USD pair at 17:15.

I don't think I can trade that.
 
Top