Dave McLachlanHi, I’m Dave McLachlan. ¬†Welcome to the site.

I have both formal training and a huge passion for trading and investment methods that work.  I enjoy trading, and figuring things out, and a lot of my work has been made available to you for free.  Some content is for members only.

You can access the:

Free Trading & Investment courses

Free Amibroker & Trading Systems Course

Regular Free Market Research & Ideas

Free Market Updates using Classical Technical Analysis

Free Price Charts for Currencies, Commodities and ASX200 stocks

You can also see the Principles I live and trade by.

Happy trending!

First Time Here?   |   Terms of Use

January 24, 2010   Posted in: Articles On Building Wealth  6 Comments

Trading System: How to Code the Three Billion Dollar Trading System

Line1

Beginners Course  |  Intermediate Course  |  Amibroker Course Home

Last week we looked at a really cool trading system, which was traded by such market royalty as Linda Raschke and Tony Crabel.

While we looked at the results of that system last week, a few people asked how to code it. ¬†I wasn’t particularly attached to the code, and it was a good opportunity to give a few new lessons in Amibroker Formula Language that we hadn’t covered before, so here is a video on how to code the “Three Billion Dollar Trading System”.

You’ll see how I include a bit of slippage in the price – and the results of not doing so as well. ¬†You see how we make sure we buy at our trigger level – something that might¬†normally be done with a “buy stop” in the real world.

And we look at a few ways to plot the things we want on our chart.

Check it out!

The main tools we use are:

  • Average True Range (ATR) to determine the smallest range of the last 7 days
  • Ref, to refer to previous days
  • BuyPrice and SellPrice, to ensure we are buying and selling at the trigger level we want.

Hope you enjoyed, and happy trending ūüôā

– Dave McLachlan

Beginners Course  |  Intermediate Course  |  Amibroker Course Home

FREE Trading System Video Lessons:

  1. 7 Free Trading Systems and Their Returns From The Last 13 Years
  2. Seven Full Trading Systems Revisited, With Completely New Data
  3. Trading System: How to Create A Buy and Hold Trading System
  4. Trading System: How to Code ‚ÄúSell In May And Go Away‚ÄĚ
  5. Trading System: How to Code a Moving Average Channel That Made 23% p.a
  6. Trading System: How to Code Highest Highs As Used In 52 Week Highs Or Turtle Trading System
  7. Trading System: How to Code a Bollinger Band Breakout Trading System
  8. Trading System: How to Code a Moving Average Crossover That Returned 28% per annum
  9. Trading System: How to Refer to Previous Signals For MAup Trading System
  10. Trading System: How to Code the Leap Of Faith (Gaps) Trading System That Returned 24% p.a.
  11. Trading System: How to Code a Short Selling System (Plus Results)
  12. Trading System: Meb Faber Trading System Using Different Timeframes
  13. Trading System: How to Code the Three Billion Dollar Trading System

March 6, 2016  Tags: , , , , ,   Posted in: Amibroker Trading System  8 Comments

The Technical View – Short Term Up Trends Confirmed, Where is Future Resistance?

This excerpt is for educational purposes only and is not to be interpreted as trading or investment advice.  See Terms Of Use here.

This week we look at the world Indices, like the All Ordinaries, Shanghai Composite, S&P 500, FTSE 100 and the Nifty 50.

Almost in unison, world markets have confirmed their short term up-trends, with the pattern we described in the last few videos.  They are all also heading into their overhead resistance, projected from Trend Lines that have lasted over a year.

We look at where markets might consolidate, where the resistance is, and what it would take for a larger move.

Just secretly, I have a feeling this move will turn into an up move that could last the year.

Check it out!

All Ordinaries

2016_03_All Ordinaries Technical Analysis

Nifty 50

2016_03_NSEI Technical Analysis

S&P 500

2016_03_SP500 Technical Analysis

I hope you have enjoyed this post.  Please leave a comment below!

Happy Trending,

– Dave McLachlan

More videos from the Technical View:

  1. The Technical View – Short Term Up Trends Confirmed, Where is Future Resistance?
  2. The Technical View – The Lines in the Sand on World Indices that Determine Market Moves
  3. The Technical View – “Short Squeeze”: How to Know When It’s A New Bull Move
  4. The Technical View – Current Markets Resemble 2008, But Where Are We In The Cycle?
  5. The Technical View – Current Support and Resistance Levels on World Markets

March 6, 2016  Tags: , , , , , , , ,   Posted in: The Technical View  No Comments

Three Trading Systems (Wk 11) – All Filters On, New Buys

This excerpt is for educational purposes only and is not to be interpreted as trading or investment advice.  See Terms Of Use here.

These trading systems have varying degrees of Index Filter, which have all been switched back on this week.

The All Ordinaries has shot upwards, leaving most of them behind as they scramble to take up new positions.  Many positions were sold out as the market fell away over the last five months.

In the mean time I’m continuing to work on trading systems and improving my game.

Below is the Equity Curve of a very short term trading system I found and coded. ¬†It took 1800 trades over the last 3 years, which would cost you around $36,000 in brokerage, but also returned about 60% p.a. ¬†Obviously, with results like that, I’d want to test it more thoroughly as I might have made a mistake. ¬†This, of course, is all part of the fun ūüôā

NewShortTermTradingSystem

Current Comparative Returns

2016_03_06_Comparative

Leap of Faith Trading System

Starting Value: $50k,  Current Portfolio Value (since November 2015):  $48,846.69

2016_03_06_LOF

Dow/Gann Trading System

Starting Value: $50k,  Current Portfolio Value (since November 2015):  $48,498.62

2016_03_06_DG

Moving Average Channel Trading System

Starting Value: $50k,  Current Portfolio Value (since November 2015):  $47,367.66

2016_03_06_MAC

I hope you’ve enjoyed this post. ¬†Have a great week ūüôā

Happy trending,

– Dave McLachlan

More¬†Posts and Videos in the “Three Trading System” series:

  1. Three Trading Systems (Wk 11) – All Filters On, New Buys
  2. Three Trading Systems (Wk 10) – Leap of Faith System Index Filter Switches On
  3. Three Trading Systems (Wk 9) – When There’s Nothing Doing, Do Nothing
  4. Three Trading Systems (Wk8) – Two Additions, Dry Powder and “No Psychics”
  5. Three Trading Systems (Wk7) – Lessons, Ideas, Tests, Drawdowns
  6. Three Trading Systems (Wk 6) – Thank you, Drawdowns, and Trading System Talk
  7. Three Trading Systems Series Week 5 – Can I Ask You a Question?
  8. Three Trading Systems Week 4 – Buys, Sells and YTD Returns
  9. Three Trading Systems Week 3 – Current Trades and YTD Returns
  10. Three Trading Systems Week 2 – Current Trades and YTD Returns
  11. Three Current Trading Systems – Buys and Sells and YTD Returns

March 6, 2016  Tags: , , ,   Posted in: Trading Diary  2 Comments

Amibroker Advanced: How to Compare Equity Curves

Line1

Beginners Course  |  Intermediate Course  |  Amibroker Course Home

This lesson is certainly more advanced than the ones we started with, but that also means you get to take your Amibroker Formula Language to a new level.

You might have seen a comparison of Trading System Equity Curves in a glossy brochure for a mutual fund (or Managed Fund, in Australia), or from a Trading System vendor. ¬†This is how you do it in Amibroker, and once you’ve set it up, it’s very easy to access or modify it in the future.

We use a few functions we’ve done lessons for previously, like AddToComposite, Plot, and Foreign. ¬†We go over them again here, but all the links for those are below too.

Check it out!

As you will see we take five steps:

  1. Create your trading system, as per normal
  2. Get access to the BackTester “object”, so we can extract information from it
  3. Extract the Equity Curve info from the BackTester object
  4. Send that to a new, separate ticker, using AddToComposite
  5. Bring any of the tickers you create into one graph using Foreign, and Plot

Hope you enjoyed, and happy trending ūüôā

– Dave McLachlan

Beginners Course  |  Intermediate Course  |  Amibroker Course Home

Videos in the FREE Amibroker Course:

  1. Amibroker: How To Import A Watchlist With A CSV File
  2. Amibroker: How To Backtest A Single Stock Or Index
  3. Amibroker: How To Backtest a Portfolio or Group of Stocks
  4. Amibroker: How To Optimize A Trading System
  5. Amibroker: How To Scan The Market For Buy And Sell Signals
  6. Amibroker: How To Use Explore To Find And Filter Stocks
  7. Amibroker: How To Add Position Sizing Using AFL
  8. Amibroker: How to Add An Index Filter To Your Trading System Using AFL
  9. Amibroker: How To Plot Your Trading System On A Chart (incl. Buy/Sell Arrows)
  10. Amibroker: How to Use the If, Then Else Function (IIF)
  11. Amibroker: How to Code the ATR Trailing Stop (Chandelier) using ApplyStop
  12. Amibroker: How to Plot ApplyStop on a Chart
  13. Amibroker: How to Code Van Tharp Position Sizing (Fixed Fractional)
  14. Amibroker: How to “Scale In” to Positions (1) – Buying Once a Month
  15. Amibroker: How to “Scale In” to Positions (2) – Pyramiding Three Times
  16. Amibroker: How to Use “Cross”, When One Thing Crosses Another
  17. Amibroker Advanced: How to Compare Equity Curves

FREE Trading System Video Lessons:

  1. 7 Free Trading Systems and Their Returns From The Last 13 Years
  2. Seven Full Trading Systems Revisited, With Completely New Data
  3. Trading System: How to Create A Buy and Hold Trading System
  4. Trading System: How to Code ‚ÄúSell In May And Go Away‚ÄĚ
  5. Trading System: How to Code a Moving Average Channel That Made 23% p.a
  6. Trading System: How to Code Highest Highs As Used In 52 Week Highs Or Turtle Trading System
  7. Trading System: How to Code a Bollinger Band Breakout Trading System
  8. Trading System: How to Code a Moving Average Crossover That Returned 28% per annum
  9. Trading System: How to Refer to Previous Signals For MAup Trading System
  10. Trading System: How to Code the Leap Of Faith (Gaps) Trading System That Returned 24% p.a.
  11. Trading System: How to Code a Short Selling System (Plus Results)
  12. Trading System: Meb Faber Trading System Using Different Timeframes
  13. Trading System: How to Code the Three Billion Dollar Trading System

FREE Amibroker Q & A Videos:

  1. Amibroker Q & A: How To Do A Monte Carlo Test? (on ALL versions)
  2. Amibroker Q & A: Visualising Monte Carlo Data with Histograms and Scatter Plots
  3. Amibroker Q & A: How to Create the 52 Week High/Low Index with AddToComposite
  4. Amibroker Q & A: How to Code Trend Pilot: Five Consecutive Days Above or Below a Moving Average
  5. Amibroker Q & A: Three “Hacks” To Improve Your Coding Skills
  6. Amibroker Q & A: How to Remove Excess Signals

March 6, 2016  Tags: , , , , , ,   Posted in: Amibroker Course  3 Comments

The Three Billion Dollar Day Trading System Revealed and Tested

Line1

Beginners Course  |  Intermediate Course  |  Amibroker Course Home

The idea that markets move from times of¬†volatility to times of calm is probably not new to you. ¬†But it’s this idea that a few traders used to create this day trading system that had the power to turn a $50,000 portfolio into three billion dollars.

It was used by a Market Wizard, by a Hedge Fund Manager, and had “In Sample” test results of 60 percent per year, with a maximum draw-down of just 4 percent. ¬†Needless to say, if you were looking at those test results, as Hedge Fund manager Tony Crabel no doubt did, you would be jumping for joy and singing hallelujah.

In this video, we look at the S&P 500 as the tradable, and how this day trading pattern reacts to it and has performed over the last 50 years.  Using Amibroker, we can see the pre-condition days, the entry days, and the buy price, all neatly overlaid on the chart.  Very cool.

Check it out!

The opening range breakout may not be new to you, however when the system was made public through Tony Crabel’s book, “Day Trading with Short Term Price Patterns and the Opening Range Breakout”, we would expect that the system might have lost¬†its edge.

While the edge did decline, I was surprised to see that in the last six years it has returned to profitability – even though it’s not as immensely great as it once was.

I’d love to know what you think about this, especially as the Reminiscences Trading System completely lost its edge when computers came in, in 2000. ¬†Leave a comment below!

Happy trending ūüôā

– Dave McLachlan

Beginners Course  |  Intermediate Course  |  Amibroker Course Home

More Market Research Videos:

  1. Stock Market Research: The REAL Effect of “Buy and Hold”
  2. This Simple Indicator SMASHES “Buy and Hold” Returns!
  3. More Stats on the Indicator that Beats Buy and Hold Returns
  4. New Mean Reversion Trading System (Stocks Over 50 day MA) Tested in Amibroker
  5. How This Random Entry Beat The Market (The Tom Basso Coin Flip Proven & Explained)
  6. Does the “Golden Cross” Outperform Buy and Hold? Market Timing, Real Results
  7. The Trading System from “Reminiscences of a Stock Operator”, Tested Over 116 Years
  8. The Three Billion Dollar Day Trading System Revealed and Tested

February 28, 2016  Tags: , , , , , , , , ,   Posted in: Stock Market Research  8 Comments