• Skip to main content
  • Skip to primary sidebar
  • Skip to footer

Decoding Markets

  • Top Posts
  • Courses
  • Resources
    • Books
  • Free Class
  • Blog
You are here: Home / Amibroker / Shorting The US Ten Year With ATR – A Simple System That Shows A Profitable Edge

August 3, 2017 By Joe Marwood 1 Comment

Shorting The US Ten Year With ATR – A Simple System That Shows A Profitable Edge

After a period of some thirty years of increasing bond prices, and with the Federal Reserve committed to a policy of gradually increasing interest rates, the time for long-based trading strategies on US treasuries could well be coming to an end.

Many, including former Fed chairman Alan Greenspan, have called the bond market a bubble ready to pop. With this in mind, this article presents a simple trading strategy that shorts the US ten year note using the ATR (average true range) indicator.

Treasuries have been in a bull market since the 1980s
Treasuries have been in a bull market since the 1980s

Trading System Rules

The rules behind this trading strategy are straightforward.

We are going to short the US ten year note futures contract after an up day and when the short-term ATR(2) is 20% higher than the medium-term ATR(12).

Thus, we are attempting to short the futures contract after a modest uptick in volatility.

We will hold the position for one full day and then close our position on the next open.

There is not necessarily a fundamental reason for this strategy but it is shown to work reasonably well in backtesting.

The precise rules are as follows:

• IF ATR(2) > (ATR(12)*1.2) AND Close > Open THEN go short on the next open;

• Cover after one full day – on next open;

Trade Example

Following is an example of the kind of trade setup we are looking for:

trade example in the us ten year
Trade Example

On the 18th April 2017, ATR(2) (green) was 0.732 and ATR(12) (orange) was 0.598. So ATR(2) was more than 20% above ATR(12). We also had an up close on that day.

We therefore go short on the next bar open (red arrow).

We hold the trade for one full day then exit on the next day open (green arrow) giving us a profit of $340 from one contract (after deducting $20 in transaction costs).

Backtest Settings

To backtest this system I will be using Amibroker software and futures data from Norgate for the ticker symbol TY2__CCB.

All trades will be placed on the next day open and position size will be set at one contract with no compounding.

Starting capital will be $50,000 and transactions costs will be set at $10 per trade.

No stop loss will be used at this stage as we are using a time-based stop of one day.

In Sample Results

Running this system on the ten year note futures contract between 1 January 2000 and 1 January 2014 we recorded the following results and equity curve:

Net Profit: $11,157.94
CAR: 1.45
MDD: -5.72%
CAR/MDD: 0.25
# Trades: 196
Win Rate: 51.53%
Average P/L Per Trade: 3.57%
Profit Factor: 1.34
Sharpe Ratio: 1.24

In sample equity curve
In sample equity curve

Out Of Sample Results

One method to validate a trading system is to step it forward and test it on unseen data similar to what would be experienced in real trading.

Moving this system forward and running on an out-of-sample period between 1 January 2014 and 1 July 2017 we recorded the following:

Net Profit: $3801.10
CAR: 2.12
MDD: -2.37%
CAR/MDD: 0.90
# Trades: 49
Win Rate: 63.27%
Average P/L Per Trade: 4.86%
Profit Factor: 1.61
Sharpe Ratio: 2.16

Out of sample equity curve.
Out of sample equity curve.

Observations So Far

The system shown so far has produced good risk-adjusted returns in the in-sample and out-of-sample test. In fact, the system was able to perform better in the out-of-sample than the in-sample.

Particular attention should be made to the profit per trade and the Sharpe ratio. Although the annualised return is low this can be substantially improved by increasing the number of contracts.

The number of trades is quite small and we would ideally want a larger sample size. The system is still very basic and could easily be enhanced with more features.

Walk Forward Optimisation

The system was also run via a walk forward optimisation whereby the the slow ATR and percentage multiplier was optimised and walked forward in steps of 1 year in sample with 3 months out-of-sample.

The following results and equity curve were produced:

Net Profit: $14,410.81
CAR: 1.55%
MDD: -5.65%
CAR/MDD: 0.27
# Trades: 149
Win Rate: 59.73%
Average P/L Per Trade: 6.06%
Profit Factor: 1.58
Sharpe Ratio: 1.97

Walk forward equity curve.
Walk forward equity curve.

Final Thoughts

The trading system we have discussed shows some interesting characteristics and potential for trading.

Short systems are always valuable to traders because they can help smooth drawdowns when combined with long only models.

As always, there are still issues to be aware of. The trade sample is fairly small and there is a higher risk of curve fitting with single issue trading systems.

However, this is balanced by the positive walk forward results and the fact our system has produced profitable results during poor market conditions. i.e. the system has made money trading against the prevailing trend.

If Alan Greenspan is right, the raging bull market in US treasuries could well be coming to an end and so a strategy like this may be a good one to keep an eye on.

Amibroker Code

Following is some Amibroker code for the strategy as shown above:

/* /* Disclaimer: Futures trading carries a high degree of risk.This code is provided for educational purposes only. Full disclaimer and risk warning applied. ©JBMARWOOD.COM.*/
SetFormulaName("ShortBonds");
SetOption("AllowSameBarExit", 0);
SetOption("MaxOpenPositions",1);
SetTradeDelays(1,1,1,1);
Buy = Sell = Short = Cover = 0;
BuyPrice = ShortPrice = O;
SellPrice = CoverPrice = O;
NumContracts = 1 ;
PositionSize = NumContracts * MarginDeposit;
ATRSlow = Optimize("ATRSLOW",12,2,40,2);
ATRMulti = Optimize("ATRMULTI",1.2,1.2,4,0.1);
Short = ATR(2)>(ATR(ATRSlow)*ATRMulti) AND C>O;
Cover = 0;
ApplyStop(stopTypeNBar,stopModeBars,1);
//////////////////////////////////////////End

Simulations: Amibroker
Data: Norgate 


Thank You For Reading

joe marwood profile pictureJoe Marwood is an independent trader and the founder of Decoding Markets. He worked as a professional futures trader and has a passion for investing and building mechanical trading strategies. If you are interested in more quantitative trading strategies, investing ideas and tutorials make sure to check out our program Marwood Research.


Disclaimer

This post expresses the opinions of the writer and is for information, entertainment purposes only. Joe Marwood is not a registered financial advisor or certified analyst. The reader agrees to assume all risk resulting from the application of any of the information provided. Past performance is not a reliable indicator of future returns and financial trading is full of risk. Margin trading can lead to losses more than in your account. Mistakes in backtesting and presenting of analysis regularly occur. Please read the Full disclaimer.

Filed Under: Amibroker, Ideas, Strategies/ Systems, Top Posts Tagged With: amibroker, trading systems

Recommended Educational Resources:


  • Discover New Trading Strategies
  • Learn Japanese Candlesticks (Free)
  • Mental Models For Trading (Free)
  • Indicators For Amibroker (Free)
  • Tools For Options Traders (Free)
  • Historical Data For 8000 Stocks (Free)

Reader Interactions

Comments

  1. Jay says

    August 4, 2017 at 11:30 pm

    Thanks for sharing this idea JB. Definitely an interesting one. I also appreciate what you’re saying about how it could be combined with a shorter-term system to diversify results and smooth out the equity curve. Thanks again!

    Reply

Leave a Reply Cancel reply

Your email address will not be published.

Primary Sidebar

Access Marwood Research image

Popular

Slide 1 Trading Desk

How To Build A Mean Reversion Trading Strategy

How to 10x Your Momentum Trading Strategy

How To 10x Your Momentum Returns

Apple DCA equity chart

How To Build A $2.5 Million Position In Apple Stock (With $500 A Month)

Double top pattern with adjustable parameters

Double Top Pattern – Backtest Rules & Results

easy-money-trading

The Easiest 100 Ticks I Ever Made (And Worst)

26 Stock Market Strategies That Beat Buy And Hold

Backtesting a finviz stock screen

Good Results From Backtesting A FINVIZ Stock Screen

xgti stock chart

Analysis Of US Stock Splits

Search

Recommended Resources

  • Discover New Trading Strategies
  • Learn Japanese Candlesticks (Free)
  • Mental Models For Trading (Free)
  • Indicators For Amibroker (Free)
  • Tools For Options Traders (Free)
  • Hist. Data For 8000 Stocks (Free)

Financial Disclaimer

Financial trading is risky and you can lose money. Joe Marwood is not a registered investment advisor and nothing on this site is to be regarded as personalized investment advice. Past performance is not indicative of future results. Data errors and mistakes do occur. Please see the full disclaimer.

Footer

About The Author

Joe Marwood is an independent trader and investor specialising in financial market analysis and trading systems. He worked as a professional futures trader for a trading firm in London and has a passion for building mechanical trading strategies. He has been in the market since 2008 and working with Amibroker since 2011.

Joe Marwood Profile PIc

Recent Posts

  • Performance Of Our Trading Systems In 2020
  • Trend Following With ETFs and Large Cap Stocks
  • Should You Trade This Earnings Pullback Strategy?
  • Simple Algo Trading With Alpaca And Streak
  • Is Value Investing Dead? Dissecting The Value Investing Narrative
  • How To Screen For Stocks With Norgate Data
  • Do Stocks Have A Floor?
  • What Trading Signals Work Best For Long-Term Investors?

Search

Privacy policy | Contact | Disclaimer | All Rights reserved. JB Marwood.