Shorter term mean reversion system for ETFs

Discussions about the testing and simulation of mechanical trading systems using historical data and other methods. Trading Blox Customers should post Trading Blox specific questions in the Customer Support forum.
Post Reply
sluggo
Roundtable Knight
Roundtable Knight
Posts: 2987
Joined: Fri Jun 11, 2004 2:50 pm

Shorter term mean reversion system for ETFs

Post by sluggo »

The system is in the Jan 2009 issue of Stocks and Commodities magazine. The (article) is on their website today; I don't know whether they'll keep it on the site forever, or take it down and urge you to buy a reprint for $9.95.

The idea is: buy dips if the long term trend is up; sell rallies if the long term trend is down. If the long term trend isn't up, don't go long. If the long term trend isn't down, don't go short. The system's positions are aligned with the long term trend, but opposite the shorter term trend.

As I interpret the article, you need intraday data to trade the system. In particular, you need to know today's Low before you can decide whether or not to trade at today's Close. I have perverted / simplified the rules a bit, getting rid of the requirement for intraday data. In my perversion, you run the system code at night, after the close, using EOD data. Then you enter the order before the open the next morning, and you're done. Turn off the computer, leave the house, go out for breakfast, play golf, volunteer at the church, go to your fulltime job, whatever. Beware, the test results in the article assume intraday data; my perversion might give different test results. Don't trade it until you've tested it!

Here's the system, explained in English but not coded for a computer. "Lowest(Low, 6)" is shorthand for "The lowest Low price of the last 6 days" and "Highest(High, 6)" is shorthand for "The highest High price of the last 6 days".

Code: Select all

'''' Rule for Entering Long
IF (today's close was greater than the 200 day SMA of the closes) AND
   (position is OUT) THEN
	Buy to enter Long tomorrow at Lowest(Low, 6) on a "Close Only, Limit" order
END

'''' Rule for Entering Short
IF (today's close was less than the 200 day SMA of the closes) AND
   (position is OUT) THEN
	Sell to enter Short tomorrow at Highest(High, 6) on a "Close Only, Limit" order
END

'''' Rule for Exiting Long
IF (position is LONG) THEN
	Sell to exit Long tomorrow at Highest(High, 6) on a "Close Only, Limit" order
END

'''' Rule for Exiting Short
IF (position is SHORT) THEN
	Buy to cover Short tomorrow at Lowest(Low, 6) on a "Close Only, Limit" order
END
You might have noticed that there is no stoploss. You might also have noticed that you could get trapped in a losing trade for a very long time. If you're long, but the market falls steadily, never making a new 7-day High, you'll never exit. That could be a BIG loss.
mankind
Senior Member
Senior Member
Posts: 41
Joined: Fri Mar 09, 2007 9:37 pm

Post by mankind »

For yourself or others that may decide to delve into testing intraday strategies with ETF's my initial findings were eye opening. The setup I chose was esignal for data, qcollector for distribution and TB as well as Ninjatrader for testing. Esignal does not split intraday data, QC does not split the data, ninjatrader has adjustment fields for both splits and dividends, which in my case as well as tech support @ NT did not work. Can it be possible that company can offer a state of the art trading platform that allows there daytrading customers to build systems ready for auto trading, with unadjusted intraday data. After all, the prepackaged indicators that they provide are primarily tied to prices.

In the end I found that manually adjusting the data was the only solution, very tedious and prone to errors. If anyone needs help with
this process just let me know.
AFJ Garner
Roundtable Knight
Roundtable Knight
Posts: 2071
Joined: Fri Apr 25, 2003 3:33 pm
Location: London
Contact:

Post by AFJ Garner »

I only rarely look at Ed Seykota's Trading Tribe site, so I am probably rather behind and most people may already have seen and followed this link:

http://www.mscapmgmt.com/grab/home.htm

I have not looked through Mark Sleeman's generously shared research at all thoroughly yet but I thought those who have not yet come across it might appreciate the link.
sluggo
Roundtable Knight
Roundtable Knight
Posts: 2987
Joined: Fri Jun 11, 2004 2:50 pm

Post by sluggo »

It appears Mr. Sleeman has a dislike (or an unawareness) of the past tense
In 1987 the wild markets ignite my interest in futures trading. I spend the next decade testing, trading and refining my methodology. In 1997 I become a professional futures trader.

He created one mechanical system called GRAB that embodied "my vision of how the Pros trade: ... wait patiently for bargains, then pounce. Then wait for the subsequent rally, and sell."

He tried very hard but he couldn't find values for the system's two user-adjustable parameters that gave a profitable and satisfying equity curve.

What is an appropriate "conclusion" to draw from his experiences? Some possibilities might include
  1. GRAB is a bad (i.e. unprofitable) system
  2. We don't really know whether GRAB is bad or good, we only know that Mr. Sleeman couldn't find good parameters for it, using one portfolio, and one set of assumed frictional costs, and one testing period
  3. GRAB is unprofitable AND the entire category of all possible trading systems that buy bargains and sell subsequent rallies, would also prove to be unprofitable if you tested each of them
  4. "In futures trading, profits do not come easily, because they require the trader to absolutely stick to a system that is sometimes very difficult to follow."
LeapFrog
Roundtable Knight
Roundtable Knight
Posts: 695
Joined: Mon May 17, 2004 4:18 pm
Location: Boston, MA

Re: Shorter term mean reversion system for ETFs

Post by LeapFrog »

sluggo wrote:The system is in the Jan 2009 issue of Stocks and Commodities magazine. The (article) is on their website today; I don't know whether they'll keep it on the site forever, or take it down and urge you to buy a reprint for $9.95.
I used to subscribe to this rag some years ago. I stopped and they kept sending it to me for some more years. As a novice trader I found all that math and hieroglyphics very appealing - so sophisticated looking it must have value. And I'm sure it does have educative value. Their published "systems" though seem more like exercises rather than any sort of serious offerings as tradable systems. Maybe one day they'll stumble on a ripper and I'll eat my words.
AFJ Garner
Roundtable Knight
Roundtable Knight
Posts: 2071
Joined: Fri Apr 25, 2003 3:33 pm
Location: London
Contact:

Post by AFJ Garner »

sluggo wrote:It appears Mr. Sleeman has a dislike (or an unawareness) of the past tense
Mr Sleeman is from the Colonies and so I think one must be charitable and make allowances for his grammar.

:lol:
rhc
Roundtable Knight
Roundtable Knight
Posts: 464
Joined: Tue Nov 18, 2008 8:46 pm
Location: Oz

Post by rhc »

Since, Mr Sleeman's study appeared on the Trading tribe site I would guess that he wrote it in the present tense to conform with the prefered TT requirement to 'speak' in the present tense.

OR if you prefer,

Since, Mr Sleeman's study appears on the Trading tribe site I will guess that he writes it in the present tense to conform with the prefered TT requirement to 'speak' in the present tense.

From the TT website;
SVO-p
SVO-p is a syntax: S-ubject, V-erb, O-bject, -present tense. Putting your thoughts in SVO-p may help straighten out your thinking. The form requires definition of who is acting, what they are doing and to whom. It requires placing the thought in the now. SVO-p is particularly consistent with trend-following.
AFJ Garner
Roundtable Knight
Roundtable Knight
Posts: 2071
Joined: Fri Apr 25, 2003 3:33 pm
Location: London
Contact:

Post by AFJ Garner »

sluggo wrote:He tried very hard but he couldn't find values for the system's two user-adjustable parameters that gave a profitable and satisfying equity curve.
What is an appropriate "conclusion" to draw from his experiences?
Well, yes indeed.

I have had a chance to read Mr Sleeman’s research more thoroughly and to programme a version of the system from Stocks and Commodities quoted by Sluggo above. I added a stop, used a DMA crossover as a filter and messed around with risk management.

I set out below the GUI and a test run. The parameters shown on the GUI are those used in the test run. I tested the system on a portfolio of 110 different futures contacts and assumed a low all in slippage and commission of $5 per contract. I switched the Global Parameter “Earn Interestâ€
Attachments
DipsRallies.JPG
DipsRallies.JPG (63.8 KiB) Viewed 6252 times
Test.JPG
Test.JPG (72.23 KiB) Viewed 6252 times
Post Reply