Thursday, December 15, 2005

Keywords

trading automation, automatic trading, systematic trading, expert-systems, software, long short, leveraged, trend following, stocks, ETFs, equity indexes trading, COSMOS portfolios.

Friday, July 22, 2005

tradingautomation an introduction

tradingautomation is a blog telling our experience with the development of software systems to ensure systematic trading and automated account management by expert systems while favouring protection and growth of capital. The system relies on trading rules, and covers mechanisms enabling to identify markets, sectors or securities’ trends, to determine long / short entry signals, to handle positions sizing and management including stop policies, to care for account and money management within agreed boundaries or safety limits (e.g. draw down, etc.).

Patrice is the author of a trading method and co-owner of the TEXSOL trading expert system (Trading Expert System Online). Funds managed are known under the generic reference of COSMOS (stands for Capital Oriented Systematic Management of Speculation and is a wink to Carl Sagan's astronomical book). The approach is directional (“long” or “short” with leverage). The method designed and the system implemented enable to create custom trading universes satisfying particular objectives (e.g. sector oriented, ETF based, etc) and to handle specific accounts / funds according to specified risk profiles. The authors have been using their monies and own accounts to prove extensive back testing results over several decades on the US and French markets. TEXSOL is really a state of the art platform pushing trading automation to its limits.

Deployment of the method and technology is very flexible and can be arranged at standard industry rates and conditions, i.e. 2% fees for funds under management, and 20% incentive fees on returns exceeding previous high watermarks. Authors and technology owners are open to any deals with accredited investors in US terms (net worth > 1M$), institutions and broker dealers.

A reference portfolio of 10M USD started on Dec 20th 2004 is updated weekly at Cosmos Portfolios and let you get an understanding of the system's operations.

Contact Patrice @

Introduction & Objectives

COSMOS introduction & Objectives:

  • Trend following method, i.e. no trend no return.
  • Selecting trendy sectors, e.g. (GSPME, GSPIS, GSPSEQP, GSPTEHW, GSPELEQ, GSPTS) to create trading universe(s)
  • Targeting major trends to generate large capital gains while ensuring efficient protection of the trading capital
  • Absolute return based on long / short leveraged positions
  • Advanced risk control and management
  • State of art trading automation versus most hedge funds managed by discretionary means

COSMOS Method Overview (1/3)

TExSOL® is a proprietary trading system:
  • Implements a proprietary trading method and is based on systematic and automated decisions optimising the risk / reward ratio and ensuring consistency over time
  • Derives from a mix of best known trading methods (Schwager market wizards http://www.turtletrader.com/schw.html, Elder, Weinstein, etc.), JPM's risk control techniques (V@r), all put together and back-tested over decades of daily data
  • Production version (final) since 04/10 running daily on real accounts and used throughout development stages by the authors on their own monies
  • Proposed as the backbone for the management of COSMOS products, i.e funds and managed accounts

COSMOS Method Overview (2/3)

TExSOL® basic checklist
  • When to avoid a market and when to trade it (know when to stay on the sidelines…resting in backseat can save money)
  • Either « Long » or« Short », one or the other at any given time, being directional as the tide lifts or rocks all boats
  • Makes use of a trend-following approach with formal leverage on cash (equation of leverage) and appropriate risk control
  • Reacting to the short term trend to improve risk / reward and to efficiently put money at work « oversold / accelerate» or trim exposure « overbought / decelerate »

COSMOS Method Overview (3/3)

TExSOL® basic checklist
  • Identifying trading opportunities by listing & ranking exhaustively possible trades fitting with the trend
  • Mastering money management, i.e. position sizing, risk and ratios at micro (positions & stops) or macro (portfolio) levels
  • Handling account globally in a reflexive way, considering COSMOS funds & accounts as a security in their own (i.e. trailing stop against the account equity curve)
  • Daily monitoring, reporting & analysis with an upload in Excel from the DB

To be or not to be in the Market

When to avoid a market ?
  • Erratic markets or range markets with little trend and more generally all non trending markets with a trend following method favouring big moves to small swings should be avoided as they lead to positions being whipsawed
When to trade a market ?
  • « Long » ? or « Short » ? with automated and systematic market, sector (GICS), & security trend analysis
  • « Leverage » ? « Timing » ? studying market internals (OT - Open Trades) enable to increase or tune the exposure (overbought / oversold locally) to limit dynamically draw-down and risk or to increase exposure whenever necessary

Two words on the Market Trend

Long and Short have little in common:

Long for the bulls:
  • Long capital gains are cumulative and unlimited
  • State signals (entry points) are valid for long periods based on the triptych (market/fund – GICS sector – security)
  • Handling positions for big gains requires a strong hand and to keep posture while tuning exposure during overbought / oversold episodes (Slow dynamic with stressing corrections)
Short for the bears:
  • Short capital gains are limited in nature and erosive
  • Opportunity signal (linked to volatility) with short term validity
  • Make use of successive falling windows acting as a means to re-initialise positions and potential gains
  • Take advantage of a fast dynamic which is reset and rearmed through pullbacks and successive windows

Money Management (1/2)

Position level:
  • Sizing in % of trading capital
  • Checking volumes and liquidity to avoid or limit slippage
  • Maximum loss accepted per line in % of trading capital
  • For which capital gains expectancy (notion of R multiple) ?
    -a priori (Expectancy / Risk t0) e.g. for selecting / marking potential open trades
    -a posterior (P&L / Risk) and reported in nR to assess closed trades and to further compile trading statistics (e.g. per sector)
  • Tightening stops (micro) on positions depending on their volatility (++) as a side effect of portfolio global risk (macro) control to keep HCDD & DD within defined boundaries

Money Management (2/2)

Portfolio level:

  • HCDD (i.e. Hard cash Draw Down) DD on the Cash, i.e. measure the risk on the trading capital @ open on positions (depending on stops) – initially negative but can turn positive while making money on stops levels
  • DD (i.e. Draw Down), i.e. cumulative risk on the total account value (trading capital plus unrealised capital gains - UGC) always positive
    –(DD = UCG – HCDD)
  • Optimise usage of leverage while matching HCDD and DD limits; leverage equation:
    –((Cash + UCG) - DD) * FE > (Market-Exposure - DD) (SRD)
    –((Cash + (UCG / 2)) - DD) * FE > (Market-Exposure - DD) (US)
  • Optimise market exposure based on market internals and locally overbought / oversold conditions (GC of Securities minimize P2T)

Portfolio @ micro & macro levels

A sum of stopped positions (micro vision)
  • Do not argue with a loss (ISL) - Cut losses short on the ISL
  • Never loose when you won (ZLS) – “Break even Stop”
  • Let your profit run but know when a position is ripe (TSL) – Trailing Stops L&S - based on an analysis of the dynamics of each position

The equity curve also reflects a security’s behaviour (macro vision)

  • COSMOS funds & accounts are analysed by the system as all other securities are, with similar means and objectives
  • Trailing stops on the value of the portfolio (TSV) are computed while fast motions and rapid changes of portfolio’s value are recorded, especially when the system is high net « short »
  • The system implements a complete politics of self analysis

Daily operations performed by the TEXSOL expert-system

A picture is worth a thousand words... This is a simplistic schema presenting a sequence of events that the system performs daily:
  1. Update from the data provider (Reuters) and storage of the primary data in the Metastock database (software from Equis)
  2. Texsol computes all Technical Anasysis required for further operations by the expert system
  3. Given data as Close of Business (COB) close positions which were closed on stops and moves stops for positions remaining in the portfolio
  4. Generate all potential open trades for the day and analyses the market internals (accelerate, decelerate)
  5. Rank potential open trades according to marks given to them by the strategy
  6. According to money management (risk control, leverage control) decides whether or not to open new positions.

COSMOS Products (1/2)

Stocks

COSMOS-US Tech
–Large unsorted TU with more than 1200 securities from 6 GICS sectors: GSPME, GSPIS, GSPSEQP, GSPTEHW, GSPELEQ, GSPTS and volume > 200k$ daily/security - Used for e*trade test account since 2/06/03.

COSMOS-FR (France)
–French trading universe with 320 securities (taken from all sectors and all French markets) securities selected on liquidity criteria which is key to the system’s success – little extension possible - Used for cortal & wargny test accounts since 20/06/03

COSMOS Products (2/2)

Indexes
COSMOS-NDX
–Extreme liquidity (1500*100*5000=750M$ on ND per person) and average volume on QQQQ > 4.000M$
Also benchmarked on
–DJI (since 1930), SPX (1950), IXIC (1980), NDX (1990),
–CAC (1969), STOXX50 (1990)
–N225 (1982)
–Indexes mix

ETFs & Trackers
COSMOS-ETF-US
–30 most liquid US ETFs (all>1M$, 22>5M$ average volume)
COSMOS-TRK3-FR
–3 most liquid FR Trackers

COSMOS-US Product Performances

COSMOS-US (Tech Stocks)

  • Large TU with more than 1200 securities from 6 GICS sectors: (GSPME, GSPIS, GSPSEQP, GSPTEHW, GSPELEQ, GSPTS) and volume > 200k$ daily/security
  • Yearly Return over 40% for the period 95-04
  • Total Return of 3000% for the period 95-04
  • Yearly Return over 25% for the period 90-04
  • Estimated long term (for periods longer than 15 years) Yearly Return over 25%
  • 729 trades over 15 years, 558 over 10 years
  • 4 negative years over 15 years (<>
  • Used for e*trade account since 03/06.

Results: COSMOS-US

The following upload from the .NET database in excel displays in a graphical form the results of TEXSOL trading the COSMOS-US universe (1200 securities from 6 GICS sectors) over 95-04, with various snapshot windows, the market exposure curve (red), the account equity curve (blue), the instant drawdown (black), equity curve and reflexive stops against our own account equity curve, market trend (bull=1, bear=-1, unknown=0) as the red curve in the lower window.

COSMOS-US: some trades

The following upload of the .NET database in excel displays some trades performed by the TEXSOL trading expert-system on the COSMOS-US trading universe, with the security name, number of securities Bought Long or Sold Short, open date & price (L/S), close date & price, realized capital gains (loss), and in % P&L, open rule used, close rule used including stop types, stop types, stop value, type of trade (L/S), nR multiple, ISL, margin.

COSMOS-US: YR% & P2T

The following charts give an overview of the results of the TEXSOL system trading the COSMOS US trading universe (1200 securities selected within 6 GICS sectors) over the period 90-04. The returns (yearly returns in % - YR%) and peak-to-through (P2T %) are reported in various forms.

COSMOS-US: Parametric Study 720 runs

The following charts give the results of a parametric study over 720 runs, reporting YR% (yearly returns %) versus Peak-to-Through (P2T%) for increasing trading durations (12, 24, 36, 48, 60 months) and shows how the TEXSOL trading expert system performances converge towards the expected probability, center of gravity of the distribution on 60months with YR%(40%) and P2Tmax(35%).

US returns over increasing time periods - monte-carlo runs (75M$) init

The following gives a summary of the returns made on US market by the TEXSOL system over increasing timescales up to 60 months for thousands of monte-carlo runs and illustrates that for timescales longer than 36months no negative returns (min) are observed. Average, max and min returns are displayed for each windows. Such tests run for over a week on a fast P4 with SQL server.

COSMOS-NDX Product Performances

COSMOS-NDX (Index trading)
  • Trading the QQQQ (liquidity: >4billion$ daily)
  • Yearly Return over 38% for the period 95-04
  • Total Return over 2300% for the period 95-04
  • Yearly Return of 25% for the period 90-04
  • Estimated long term (for periods longer than 15 years) Yearly Return over 25%
  • 625 trades over 15 years, 440 over 10 years (some grouped)
  • 4 negative years over 15 years (< 20%)

Results: COSMOS-NDX index


The following upload from the .NET database in excel displays in a graphical form the results of TEXSOL trading the NDX index over 95-04, with various snapshot windows, the market exposure curve (red), the account equity curve (blue), the instant drawdown (black), equity curve and reflexive stops against our own account equity curve, market trend (bull=1, bear=-1, unknown=0) as the red curve in the lower window.

Long / Short in & out on NDX 90-04


The following Metastock(R) screenshot gives a graphical example of Long / Short entry/exist signals as programmed with the TEXSOL expert-system. Current entry points are more sophisticated but the picture overall gives a feel as to how TEXSOL sees the market (green arrow are Long entries / Red arrows are Short entries), and the lower window displays the equity curve and Bull (1), Bear (-1), unkown market trend episodes.

COSMOS-NDX: YR% & P2T


The following charts give an overview of the results of the TEXSOL system trading the NDX index over the period 90-04. The returns (yearly returns in %) and peak-to-through (P2T) are reported in various forms.

COSMOS-ETF-US Product Performances

COSMOS-ETF-US (ETF trading)

  • Trading 32 US ETFs with MM20Vol > 1M$
  • Yearly Return over 46% for the period 95-04
  • Total Return over 4000% for the period 95-04
  • Yearly Return over 28% for the period 90-04
  • Estimated long term (for periods longer than 25 years) Yearly Return over 21%
  • 1137 trades over 25 years, 783 trades over 15 years, 586 over 10 years (some grouped)
  • 5 negative years over 15 years (< 35%)

Results: COSMOS-ETF-US


The following upload from the .NET database in excel displays in a graphical form the results of TEXSOL trading 32 US ETFs over 95-04, with various snapshot windows, the market exposure curve (red), the account equity curve (blue), the instant drawdown (black), equity curve and reflexive stops against our own account equity curve, market trend (bull=1, bear=-1, unknown=0) as the red curve in the lower window.

YR% & P2T – ETF-US 90-04


The following charts give an overview of the results of the TEXSOL system trading a set of 32 US ETFs (recomposed) over the period 90-04. The returns and peak-to-through are reported in various forms.

Operating the System

Daily operations include:
–Primary Data Base update (through Reuters)
–TA Data Base generation and update
–Managed accounts & Funds incremental running
–Upload of excel files for monitoring and reporting
–Email sending to accredited list of recipients
–Placing orders & monitoring status for managed accounts

Weekly operations:
–Primary Data Base tickers update

Fees Operating the System

Managed Account mode:
–Accredited Investor with account > 1M$
–Management fees 1,5% of NAV
–Incentive fees 20% from previous high-watermark
–Account is managed on behalf of the Client

Stream mode:
–Institutional offer for accounts > 5M$
–Management fees 1% of NAV
–Incentive fees 15% from previous high-watermark
–Institution chose a custodian and handles account
–Instructions sent daily by email, upload posted on http

Bibliography basics for the design of the TEXSOL trading expert system

To understand the basics behind the design of the TEXSOL trading expert system, we recommend the reading of the following books, papers and documents.

Acampora, Ralph J., "An explanation of Dow Theory", Smith Barney, Harris Upham & Co., No Date.
Achelis, Steven B. "Technical Analysis from A to Z", http://www.equis.com/free/taaz/index.html
Achelis, Steven B, 1985. "Technical Analysis from A to Z". Chicago, IL: Probus Publishing Company, 1995.
Appel, Gerald, Hitschler, Fred, 1980. "Stock Market Trading Systems". Homewood, IL: Dow Jones-Irwin.
Appel, Gerald, 1979. The Moving Average Convergence-Divergence Method. Great Neck, NY: Signalert.
Béchu Thierry, et Bertrand Eric, 1998. "L'analyse technique - Pratiques et methodes", Economica, 442p.
Brinson, Singer, et Beebower, 1991. Determinants of Portfolio Performance II: An Update, Financial Analysts Journal, 47, May-June, 1991, pp. 40-49.
Bishop, George W., Jr., 1960. "Charles Dow and the Dow Theory", Appleton, Century Crofts, Inc., New York.
Bishop, George W. Jr., 1967. "Charles H. Dow: Economist A Selection of his Writings on Business Cycles", Dow Jones & Company.
Blitzer, David et al., 2001. The Standard & Poor's Index Committee, 2001. "Standard & Poor's U.S. Indices: First-Quarter 2001 Update.
Bookstaber, Richard, 1985. "The Complete Investment Book". Glenview, Illinois: Scott, Foresman and Company.
Bos, Roger J., 2000. "An Overview of the Standard & Poor's 100 Index". http://www.spglobal.com/100index.pdf
Brynes, Campfield, Henry et Waldman, 1991. "Inspector: An Expert System for Monitoring Worldwide Trading Activities in Foreign Exchange." Innovative Applications of Artificial Intelligence 2. ed. Alain Rappaport and Reid Smith. AAAI Press. Melno Park, CA., pp. 15-21.
Byrnes, Campfield et Connor, 1989. "TARA: An Intelligent Assistant for Foreign Traders." Innovative Applications of Artificial Intelligence 1. ed. Alain Rappaport and Herbert Schoor. AAAI Press. Melno Park, CA., pp. 71-77.
Dobson, Edward D, 1984. "Understanding Fibonacci Numbers". Greenville, SC: Traders Press.
Edwards, Robert D. et Magee, John, 1992. "Technical Analysis of Stock Trends". Sixth Edition. Boston, MA: John Magee, Inc.,. (Distributed by New York Institute of Finance).
Elder, Alexander, ."Trading for a Living: Psychology, Trading Tactics, Money Management". John Wiley & Sons, ISBN 0-471-59224-2
French , Kenneth R. 1988. "Crash-Testing the Efficient Market Hypothesis," Macroeconomics Annual.
French , Kenneth R. and Fama, Eugene 1998. "Value versus Growth: The International Evidence," Journal of Finance.
Fung, William et Hsieh David A., 2001. The Risk in Hedge Fund Strategies: Theory and Evidence from Trend Followers. The Review of Financial Studies, Summer 2001, Vol. 14, n°2, pp. 313-341.
Gilbert, Jeremy, 1985. "Artificial Intelligence on Wall Street: An Overview and Critique of Applications in the Finance Industry", written for COSI 35, taught by Jordan Pollack, Brandeis University, Department of Computer Science.
Glassman, James K. et Hassett, Kevin A, 1999. "DOW 36,000", Times Business, 294p.
Hagstrom, Robert G., 1995. The Warren Buffet Way, Investment Strategies of the World’s Greatest Investor. John Wiley and Sons, 313 pp.
Harris, Lawrence, 1993. The winners and Losers of the Zero-Sum Game : The Origins of Trading Profits, Price Efficiency and Market Liquidity, Institute for Quantitative Research in Finance, Spring 93, Wesley Chapel, Florida, 32 pp.
Heaton, John et Lucas, Deborah, 1999. Stock Prices and Fundamentals, NBER/Macroeconomics Annual, MIT Press, Vol. 14, pp. 213-242.
Lebeau, Charles, et David Lucas, 1991. Technical Trader's Guide to Computer Analysis of the Futures Market. Homewood, IL: Business One Irwin.
Lefebvre, Francis, 2000. "Mémento Pratique, Compable 2000", Editions Francis Lefebvre, 1488p.
Lefèvre, Edwin, 1923. "Reminiscences of a stock operator", Georges H Doran publishers (repris par Wiley & sons), traduit par Eric Pichet et publié chez Publications Financières Internationales inc., 318p.
Murphy, John J, 1986. Technical Analysis of the Futures Markets. New York, NY: New York Institute of Finance.
Natenberg, Sheldon, 1988. Option Volatility and Pricing Strategies. Chicago, IL: Probus Publishing Company.
Nison, Steven, 1991. "Japanese Candlestick Charting Techniques". New York, NY: New York Institute of Finance.
Nison, Steven, 1994. "Beyond Candlesticks". New York, NY: Wiley, 1994.
Pring, Martin J, 1991. "Technical Analysis Explained". Third edition. New York, NY: McGraw-Hill, 1991.
Rhea, Robert. 1994. The Dow Theory, Fraser Pub Co; ISBN: 0870341103, 252p.
Rhodes, Richard , 2002. "Richard Rhodes' Trading Rules".
http://www.stockcharts.com/education/What/TradingStrategies/TradingRules.html
Ridley, Matt, 1993. "Frontiers of Finance." The Economist. October 9.
Schwager, Jack D. 1999. "Getting Started In Technical Analysis", John Wiley & sons, 331p.
Schwager, Jack D. 1993. "Stock Market Wizards: Interviews with America's Top Stock Traders".
Schwager, Jack D. 2001. "The New Market Wizards", ISBN 0-88730-667-5, 493p.
Siegel, Jeremy J., 1998. "Stocks for the Long Run". Irwin Professional Publishing, 1994.; 2nd ed., McGraw Hill.
Siegel, Jeremy J., 1992. "The Equity Premium Stock: Stock and Bond Returns Since 1802." Financial Analysts Journal (Jan./Feb. 1992).
Standard & Poor's, 2002. "Global Industry Classification Standard (GICS), An Overview for Standard & Poor's U.S. Indices". http://www.spglobal.com/GICSIndexDocument.PDF
Swenlin Carl, 2002. Decision Point Web Site.
Terna, Pietro, 1993.. "Randomness, Imitation or Reason Explain Agent's Behavior into an Artificial Stock Market". Lecture Notes in Artificial Intelligence, AI*IA Proceedings. Third Congress of the Italian Association for Artificial Intelligence, AI*IA `93. Torino, Italy. October 1993. ed. Pietro Torasso. Springer-Verlag, Berlin, pp. 96-101.
Tharp Van K., 2002. "Trade Your Way To Financial Freedom". ISBN 0-07-064762-3, McGraw-Hill, 343p.
Weinstein, Stan., 1988. "Secrets For Profiting in Bull and Bear Markets", McGraw Hill, 348p.
Wilder, J. Welles, 1978. "New Concepts in Technical Trading Systems". Greensboro, NC: Trend Research.

Thursday, July 21, 2005


Patrice's reading Carl Sagan's COSMOS.
More on my astronomical activities at Poyet's Celestial Hyperbook