Week 3: Testing Arb Trader in a Live Trading Account

My test with a time-based strategy on AUD/NZD, EUR/CHF and Eurodollars continued the week of March 26th.  Other time constraints over the weekend prevented me from posting the results as soon as the week closed out.  There are still a couple of major outstanding issues.  The first and biggest was that I was notified by Interactive Brokers that I was placing too many order modification requests relative to the number of orders that were actually getting executed.  The software had not been optimized to not place an order modification if the limit prices from the previous period had not changed.  I needed to make a modification to the software to accommodate this as IB was threatening to lock down my account if I did not take any action. 

The next issue that I encountered was the fact that IB does not store the “Order Reference” field of an order for hsitorical puposes.  The Order Reference field is an order attribute which can be used to place any text String.  I have been make use of this field to differentiate orders that were place by the 60-minute vs. 5-minute strategies.  This field then shows up in Trader Workstation (TWS), in the execution reports.  Unfortunately these are only stored for one week.  And the historical queries available on the Account Management website for whatever reason do not provide this field, so long store short, I was not able to reconcile trades for the first day of the week (Sunday March 26th).

The other glaring issue is that TWS is throwing back “Duplicate Order ID” errors in some cases when the software places the limit entry orders.  I’ve added some debugging statements, but everything looks like it should be working correctly, so this one may take a bit longer to figure out.

On to this past week’s results


AUD/NZD

This week I began trading a version of the AUD/NZD strategy based on 5-minute bars similar to the EUR/CHF strategy that I am currently testing.  Results for the week weren’t great, but I’ll continue trading for a few weeks before pulling the plug if things don’t improve. Once again, the backtests are overly optimistic.  The 60 minute version of the strategy had a rough week in both live and paper trading, but backtests showed a slight profit.

AUD/NZD – 5 minute  – week of 3/26/12

Backtest Paper Trading Live Trading
# of Trades 33 16 18
Winning Trades 90.9% 93.8% 83.3%
Avg. Trade (ticks) -0.32 -1.09 -1.54
Total Profit/Loss (Ticks) -10.6 -17.5 -27.8

AUD/NZD – 60 minute – week of 3/26/12

Backtest Paper Trading Live Trading
# of Trades 19 10 10
Winning Trades 84.2% 70.0% 70.0%
Avg. Trade (ticks) 0.71 -2.9 -3.48
Total Profit/Loss (Ticks) 13.5 -29.0 -34.8

AUD/NZD –60 minute – Total (since 3/11/12)

Backtest Paper Trading Live Trading
# of Trades 52 43 42
Winning Trades 84.6% 79.1% 80.9%
Avg. Trade (ticks) 1.36 -0.40 -0.39
Total Profit/Loss (Ticks) 70.8 -17.2 -16.4

EUR/CHF

The EUR/CHF strategy had modest gains for the week, but still hasn’t made up for the first bad week that the strategy encountered.

EUR/CHF – 5 minute – week of 3/26/12

Backtest Paper Trading Live Trading
# of Trades 72 21 28
Winning Trades 88.9% 85.7% 100%
Avg. Trade (ticks) 0.22 -0.33 0.325
Total Profit/Loss (Ticks) 13.6 -6.9 9.1

EUR/CHF – 5 minute – Total (since 3/11/12)

Backtest Paper Trading Live Trading
# of Trades 127 29 37
Winning Trades 92.1% 89.6% 100%
Avg. Trade (ticks) 0.36 -0.09 0.28
Total Profit/Loss (Ticks) 45.9 -2.6 10.5

EUR/CHF – 60 minute – week of 3/26/12

Backtest Paper Trading Live Trading
# of Trades 28 14 16
Winning Trades 89.3% 78.5% 75.0%
Avg. Trade (ticks) 1.09 0.47 0.31
Total Profit/Loss (Ticks) 30.4 6.6 4

EUR/CHF – 60 minute – Total (since 3/11/12)

Backtest Paper Trading Live Trading
# of Trades 59 42 49
Winning Trades 86.4% 85.7% 85.7%
Avg. Trade (ticks) -0.50 -0.81 -0.58
Total Profit/Loss (Ticks) -29.5 -34.1 -28.6

Eurodollars

The Eurodollar version of the strategy had another poor showing this week, losing –8.0 ticks, and is down –20 ticks total in the last 3 weeks. Based on these results I will be discontinuing testing of this variant of the strategy.

Eurodollars Live trading

Week of 3/26/12 Total Since 3/11/12
# of Trades 10 30
Winning Trades 50% 56%
Avg. Trade (ticks) -0.80 -0.66
Total Profit/Loss (Ticks) -8.0 -20

 
Twitter: @LimitUpTrading
Twitter: @RobTerp

Week 2: Testing the Arb Trader Application in a Live Account

I have continued to test a time-based strategy on AUD/NZD, EUR/CHF and Eurodollars in my live trading account using minimal position sizes as well as testing in Interactive brokers paper trading account.  I did have one glitch in the configuration of my software this week, where one night from 00:00 – 05:30 PDT, the system was not configured to take any positions.  This is typically the system’s busiest time, so there were a number of opportunities that were missed.

As mentioned in a previous post, I have stopped tracking the Eurodollar strategy in the backtests as well as the paper trade account as the results did not in any way line up with what I was seeing in the live account.

I’ve also begun tracking a variation on the EUR/CHF strategy that uses 5-minute bars (the original version uses 60-minute bars).  Results for both variations appear in the tables below.  I will begin testing the AUD/NZD strategy this week using 5-minute bars as well.  Results are below and include commissions.


AUD/NZD

The AUD/NZD strategy had a very good week, picking up nearly 92 ticks (after commissions), on 17 trades.  Results from the backtests continue to be overly optimistic, as judged by the 57.3 ticks picked up in the backtest this week vs. the 18.4 ticks picked up in live trading.  I will likely track the backtests a couple of more weeks and if things are still looking unrealistic, then drop the backtest results from the blog posts.

AUD/NZD week of 3/18/12

Backtest Paper Trading Live Trading
# of Trades 18 19 17
Winning Trades 88.9% 84.2% 88.3%
Avg. Trade (ticks) 6.17 4.95 5.40
Total Profit/Loss (Ticks) 111.10 94.00 91.90

AUD/NZD Total (since 3/11/12)

Backtest Paper Trading Live Trading
# of Trades 33 33 32
Winning Trades 84.8% 81.8% 84.4%
Avg. Trade (ticks) 1.74 0.36 0.58
Total Profit/Loss (Ticks) 57.30 11.80 18.40

EUR/CHF

Results for the EUR/CHF strategy also looked a lot better this week, with the strategy closing 16 trades this week, all for a profit, although over the last 2 weeks the strategy is still down after a few big losses the previous week.  The backtest results here seemed to track quite a bit better (at least for this week), while the overall backtest results are actually lagging behind live trading results.

The variation of this strategy which uses 5 minute bars didn’t begin trading until the week was half over, which would partially explain the huge difference in the number of trades in the backtest vs. in live and paper trading.

EUR/CHF – 60 Minute – week of 3/18/12

Backtest Paper Trading Live Trading
# of Trades 18 14 17
Winning Trades 88.9% 100% 100%
Avg. Trade (ticks) 0.72 1.51 1.23
Total Profit/Loss (Ticks) 13 21.1 20.8

EUR/CHF – 60 Minute – total (since 3/11/12)

Backtest Paper Trading Live Trading
# of Trades 31 28 33
Winning Trades 83.9% 89.3% 90.9%
Avg. Trade (ticks) -1.93 -1.45 -1.02
Total Profit/Loss (Ticks) -59.9 -40.7 -33.6

EUR/CHF – 5 minute – week of 3/18/12

Backtest Paper Trading Live Trading
# of Trades 55 8 9
Winning Trades 96.4% 100% 100%
Avg. Trade (ticks) 0.54 0.54 0.18
Total Profit/Loss (Ticks) 29.9 4.3 1.4

Eurodollars

The Eurodollar version of the strategy had another poor showing this week, losing –8.7 ticks, and is down –12 ticks total in the last 2 weeks.

Eurodollars Live trading

Week of 3/18/12 Total Since 3/11/12
# of Trades 9 20
Winning Trades 50% 60%
Avg. Trade (ticks) -0.97 -0.60
Total Profit/Loss (Ticks) -8.7 -12

For the next week I plan on adding a variation to the AUD/NZD strategy that uses 5-minute bars similar to 5-minute EUR/CHF strategy that I have begun testing this week.  I am also planning on testing an initial version of a pair trading strategy that I have been working on over the last few weeks.

I will also need to begin to look at position sizing and also stop loss orders, as the system at the moment enters with a limit order and exits with a profit-target limit order or a time-based stop, but does not have any stop loss orders.  The next steps will be to determine the maximum adverse excursion for the various instruments, place stop loss orders accordingly and then adjust position sizes based on the stop loss amount.

Twitter: @LimitUpTrading
Twitter: @RobTerp

Live automated trading of a time-based mean-reversion strategy

Last week I wrote that I had completed testing of my Arb Trader software in Interactive Brokers “Paper “Trading” account, and that I would begin testing in a live account this week.  Live testing worked out well this week and I have learned a couple of things that I will need to incorporate into my software.  The biggest issue I ran into was that IB rejects all currency orders destined for IdealPro from 14:00 PDT – 14:10 PDT.  The strategy that I am currently trading either submits orders every hour, on the hour or modifies an existing order at the top of the hour.  However, the order submitted at 14:00 is promptly rejected by IB.  The software will need to compensate for this by holding the order for 10 minutes before submitting it.

As I mentioned the previous week, the strategy will be trading the AUD/NZD and EUR/CHF currency crossrates as well as Eurodollar futures.

Results for the week ending 3/17/12.  Each of the instrument results in backtests, paper trading, and live trading appear in the tables below.  All results illustrated include commission and slippage.

AUD/NZD

Backtest Paper Trading Live Trading.
# of Trades 15 14 15
Winning Trades 80% 78.7% 80%
Avg Trade (ticks) -3.6 -5.9 -4.9
Total Profit/Loss (Ticks) -53.8 -82.2 -73.5

EUR/CHF

Backtest Paper Trading Live Trading.
# of Trades 13 14 16
Winning Trades 76.9% 78.6% 81.2%
Avg Trade (ticks) -5.6 -4.4 -3.4
Total Profit/Loss (Ticks) -72.9 -61.8 -54.4

 

Eurodollars

Backtest Paper Trading Live Trading.
# of Trades 37 26 11
Winning Trades 94.6% 84.6% 63.6%
Avg Trade (ticks) 0.7 0.4 -0.3
Total Profit/Loss (Ticks) 25.4 10.2 -3.3

 

As can be seen, the strategy had a rough week for AUD/NZD and EUR/CHF, even by the backtest standards, which in the past have proven to be overly optimistic compared to results in both the paper-trading and live accounts.  The other interesting thing to note is that the strategy performed slightly better in live trading than the paper trading account for the 2 currencies.

The Eurodollar results however are a different story.  Both the backtest and paper-trading results prove to be much better than the live account.  Probably the biggest reason for this is that the strategy will tend to sit on both the bid and the ask waiting to be filled.  Since Eurodollare futures tend to move glacially slow, there is no decent way to simulate when a bid or offer the strategy has placed may be hit, and as such the backtests and paper account are a bit over zealous on providing fills for the strategy.

Due to the unrealistic fills, I will discontinue tracking Eurodollar futures in backtests as well as discontinue trading it in the paper-trade account, since the results provided by both methods are nowhere close to the actual results I’m seeing.

I will be going live again with the system beginning Sunday afternoon and will provide a new update at the end of the week with the strategy results.

 

twitter: @LimitUpTrading
twitter: @RobTerp

Testing of AUD/NZD Automated Trading Strategy

I had completed coding within the Arb Trader automated trading software for a time based mean-reversion strategy on AUD/NZD.  After further backtesting of the strategy I had decided to extend it to EUR/CHF and Eurodollar futures as well.  The Arb Trader app is far from complete at this point, but it is far enough along that a minimum set of features are available to enable trading of this strategy.

Testing was conducted in Interactive Brokers (IB) “Paper Trading” account, which has live market data, but fills are simulated in a demo account.  I have heard complaints from the IB mailing lists that the Paper Trading account does not provide realistic fills on trades for limit and market orders, so I decided to only use this account for making sure that the trading application was functioning properly, and then to move on to trading in a live account with small position sizes to verify the results of the strategy.

The software ran for the past week without any issues in the paper trade account, and the results vs. historical backtest over the same week appear below. The results do NOT include commisions, which for IB is 0.4 ticks per round turn for the first $1,000,000,000 in trades for the month.

 

AUD/NZD results

Paper Trade Acct. Backtest Results
Trades 18 15
% Winning Trades 67% 67%
Avg. Trade P/L(Ticks) 0.8 3.0
Total P/L (Ticks) 14.0 45.1

 

EUR/CHF results

Paper Trade Acct. Backtest Results
Trades 12 14
% Winning Trades 83% 93%
Avg. Trade P/L (Ticks) 1.2 2.2
Total P/L (Ticks) 14.5 30.1

 

I enabled Eurodollar trading at the very end of the week so I will not include results for that contract.  As suspected, the backtests appear to be overly optimistic.  Beginning this past Sunday I have begun running the strategy in my live account with minimal position sizes, while also running in the Paper Account so I can compare how realistic the fills are in the Paper Account.

Below is a screenshot of the trading software running with IB’s Trader Workstation (TWS).

The automated trading software, is the white window, while TWS are the 2 dark windows.  You can see in TWS all the trades that the Arb Trader software has placed, as well as see one of the orders for 35,000 AUD/NZD at the top of the order book on the bid side in the small, dark window in the bottom right half of the image.

 

Aud-Nzd Screenshot

 

I’m planning on posting the results after this week closes out on actual trades vs. paper trades vs. backtests as I continue running the strategy in a test mode.

 

Twitter: @RobTerp
Twitter: @LimitUpTrading