Stock Trading: You Think, and The Machine Works

Usually, when changing an automated stock trading strategy, it implies making changes to the trade selection process and trading rules resulting in changes to a portfolio's trading history. But, each time doing this brings changes to trading procedures, and these changes tend more and more to over-fitting the data.

The very process intended to improve a trading strategy might be moving it further and further away from reality. Often, even making it less valuable. Some go as far as actually destroying any chance a strategy might have had of ending with a profit.

Boost Your Stock Trading Performance

My last series of articles started with setting up the mathematical backdrop to a stock trading methodology made to last. Putting a stock portfolio payoff matrix at the center of it all as the bean counter for any trading strategy: A(t) = A(0) + Σ(H.*ΔP). This time function was then reduced to: A(t) = A(0) + n * u * PT.

Three numbers of interest: number of trades done, trading unit used, and average profit percent for trade. Three portfolio metrics given by any simulated, or live, stock trading portfolio whatever its composition. One could view n * u * PT as a trading strategy's signature.

The Buy & Weak Hold

The previous article: Controlling a Stock Trading Strategy was to show you could control a trading strategy to do more than it had before by using mathematical functions that could impact its 3 most important portfolio metrics: n, u, and PT, namely the number of trades, the trading unit used, and the profit margin.

Controlling a Stock Trading Strategy

It was said in: The Deviation X Strategy, that it was controllable. When saying something like that, I like to provide some kind of evidence that what was said holds.

The DEVX8 stock trading strategy has nine controls that can be viewed as sliders or knobs. Each having its purpose. Only six are shown on a chart (see chart #1 below: Control Setting, top left, second line).

The Deviation X Strategy

For those that have followed this series of article over the last two months starting with the Payoff Matrix, it is time to show how all of it can be applied in a trading strategy now that the mathematical background has been provided.

The last time I did a portfolio level simulation using the DEVX strategy was last November, not quite a year, but close enough. The one last shown was dated October, using a prior version (DEVX6 dated June 21, 2014) which was more aggressive.

A Stock Trading System – Part IV

In the previous 3 parts of this series was presented the output of any stock trading strategy using just 3 portfolio metrics: n*u*PT. The number of trades done, the bet size, and the profit margin, as if dealing with an inventory management problem. Only 3 numbers, two of which you can fix yourself, and the other, you can control to some extent.

A Stock Trading System – Part III of IV

In A Stock Trading System – Part I, and Part II have analyzed some of the workings of the 3 metrics: n*u*PT, which summed up a portfolio's trading history. Part II, ended with a question. It was not: can more be done? But, will you do more?

Each stock trading strategy has its own "signature". It depends on the portfolio's stock composition and how trading is performed over time. In the end, at bean counting time, all you did trading will be explained by these 3 numbers: n*u*PT.

A Stock Trading System – Part I

In my last article: A Tradable Plan – Part I, it was expressed that only 3 numbers, three portfolio metrics are sufficient to summarize all the trading activity and trading history of any stock portfolio over any duration.

Those numbers were: n, the number of trades, u, the trading unit used (bet size), and PT, the average percent profit per trade, profit margin, edge, or, whatever you might like to call it.

A Tradable Plan - Part I

This new HTML file is another step in this series of articles. Refer to preceding articles starting with the Payoff Matrix to gain a better understanding of what is being put forward in this two part installment.

Any automated stock trading strategy can be resumed by 3 of its performance metrics. Namely, the number of trades, average bet size, and net profit margin per trade (n, u, PT). Everything else is of lesser consequence, part of features, preferences, or descriptive properties.

If those 3 numbers totally explain a strategy's final result, then that is where one should put his/her efforts when designing, or modifying a trading strategy.

Portfolio Core Position

This article shows what I consider the core of a trading strategy. Looks at the trading problem from a different angle than most. Starting from the end results metrics, then going back to design strategies that will affect these metrics over the entire trading interval. As if designing a strategy backwards, but most certainly constructively, allowing for a multi-asset, multi-period view of the stock portfolio management problem.

Extracting Tradable Information

The HTML file below starts to elaborate on trading methodology infrastructure. It is part of the background information needed to go forward. It uses a MACD trading strategy as example to set mathematical structure to trading procedures. It could have used something else, the whole point is not on the MACD, but trading strategies in general.

Prediction Dilemma

The HTML file below tries to elaborate on the predictability, not of stock price movements, but mostly on portfolio performance outcomes. It tries to do this using only two numbers, one of which is just a trade counter.

The objective being to show that those two numbers which characterize a trading strategy can add some understanding of a strategy's long term goals. As if giving the ability to make napkin estimates of where a portfolio might be some 20+ years down the line, thereby providing a reasonable guesstimate.

Stock Trading Decisions

The HTML file below deals with the perception of trading decisions within the context of building a long term stock portfolio. It is the continuation of a series of articles dealing with the underlying math behind a stock trading strategy.

Instead of looking for a trading strategy that tries to shift its portfolio weighs from period to period as in a Markowitz or Sharpe rebalancing scenario, the search is for long term repeatable procedures that can affect a portfolio's payoff matrix over its entire multi-period multi-asset trading interval. The main interest is not on a trade here and there, but on the possible thousands and thousands of trades over a portfolio's lifespan. All influenced by the trading functions put on the table.

Trade Detection

What I see most often are stock trading strategies that operate on the premise of finding some kind of anomaly or pattern that the developer hopes will repeat in the future. He tries to select the best methods he has to do the job. But, it still is limiting in the sense that one is not looking to increase the number of trades but simply to accept the strategy's generated number of trades. As if looking only at one way to increase end results. It's okay, but one should want more, and could do more.

Strategy Enhancers

The following article is part of a series. It deals with ways to enhance a stock trading strategy by incrementally increasing the number of trades to be executed over a long term trading interval as well as increasing the average profit per trade. Thereby, giving a higher performance at the portfolio level.

Strategy Design Defects

This article examines stock trading strategies with structural defects. Meaning strategies designed to fail, even before they start trading. It is not because someone has designed a stock trading program that it will make money. You need more than that. One thing is sure, might as well learn not to include in your own programs trading procedures that are almost assured to obliterate your long term portfolio performance. But then, anyone can design their trading strategies the way they want.

The Game Inside

Designing trading programs implies mathematical formulas. We all have a vision of what our trading programs should do. Presented in this article, as in the prior one (Payoff Matrix) are building blocks for what I want to do with Quantopian. As if putting on paper, preparing an overall plan on how I want to use its facilities. The process could help others.

The Payoff Matrix

The HTML file listed below is full of matrix formulas. You don't need math to understand the message. For me, putting an equal sign on something is a big statement. All one can do after is declare: not equal, and show why. It is not a matter of opinion anymore, it is a matter of proof.

The file looks at the trading problem from a payoff matrix perspective, which in itself can represent any trading strategy whatsoever. It concludes with any trading strategy could also be expressed as: the number of trades times the average profit per trade, leaving only two variables to consider when designing trading strategies.

Simple Stock Trading Strategy III

The chart below is a simplified model of the SMRS where I've idealized market swings based on the setup premises in the trading program. The strategy's source code is available on the Quantopian platform and referenced at the start of: Simple Stock Trading Strategy I. Further test results on some modifications to the program with their explanation can be found in: Simple Stock Trading Strategy II.

Simple Stock Trading II

Can a selection process of tradable stocks work in the future as it did in the past? We are always able to rank stuff, past data that is, since it is part of the information set available to us at the time. The objective is to find in the past data set something to activate decision surrogates to generate marketable trades in the future.

For one, I am looking for tools to help me answer the following graph:

Simple Stock Trading I

Since I've returned to Quantopian, I've been busy getting reacquainted with their trading software. What follows are my first attempts at participating in their forums, even if I should have waited. But, the occasion presented itself. Anthony Garner, like many others, graciously posted his trading strategy results and code for all to see. It is the first strategy I looked at. I found it the easy way to review Python syntax as in learning by example.

Big Bucks Will Travel

In a previous article, it was argued that it was not enough to generate profits over the long term, but rather, that it was necessary to generate positive alpha. By this, meaning that whatever stock trading strategy you might want to use, it had to ultimately outperform the averages. Otherwise, an index fund would have been a better choice. In fact, it's more like any set of investments that could at least beat market averages over the long term would prove to be a better choice.

Back to Quantopian

Over the past few days, I went back to the Quantopian website after some 3 years of absence to find that they had improved a lot, an impressive job, sufficient in fact to warrant not only a second look but enough to want to make it a strategy design platform. Sure, it will require that I re-familiarized myself with Python, its syntax and packages, but I think it will be worth it. I do like what they did, and it shows promise for what I want to do.

Generate Positive Alpha

A short term stock trader has a choice, and that is to participate, take a position, or not. It is always his/her prerogative. Participating, taking action, is a deliberate act, that it be discretionarily done or delegated to a trading script.

A trading program will do what it is programmed to do, nothing else, and therefore, it is about the same as if its designer had made those same trading decisions except much faster, without hesitation or second guessing. A program, or a discretionary trader for that matter, will issue buy and sell orders according to their respective preset trading rules. Neither will invent a new rule on the fly, both will want some evidence that their prospective rules has the potential to generate profits.

A CAGR Debate

An interesting recent article that appeared in MarketWatch had as introduction:

"Consider: The 30-year annualized return for the S&P 500 average was 10.35% through 2015, but the average investor in the U.S. market pocketed just 3.66%, according to an analysis of investors by researcher Dalbar Inc."

Trading Strategy Survival

Over the weekend I was confronted with the problem of stock trading strategy survivability as I was reading Prado's book on optimization of trading strategies. Since a lot of what you see in the financial literature puts emphasis on that most trading strategies fail, I had to show that at least my preferred strategy was not designed to do so.

Should the picture change that much if I change the stock under the microscope?

I picked FDX from the same 10-stock list I often use in testing trading procedures. If a stock can pass my preliminary tests, then I can go further with the exploratory analysis.

It is when you change the stock under study that you can better view common elements. And from there maybe extract further trading rules designed to help at the portfolio level and not just apply to a single stock.

The Revisited Stop Loss II(Part 2 of 3)

An Inquisitive Backtest

I opted to test the protective stop loss hypothesis starting with the notion of having a 10% trailing stop loss. The intention is to buy stocks on their way up and sell them later at a higher prices (see intro, part 1). To execute a trailing stop, you first need to buy some shares, so I also put in a 10% trailing buy order from a bottom.

The Revisited Stop Loss (Part 1 of 3)

What is it you want? The money, the entertainment, recognition, or maybe just something to talk about as if you were in the know of worldly events. Just in case it is the money, then you might appreciate what follows since it is all about your long term portfolio protection.

This is a 3-part series that elaborates on the use of stop losses in stock trading strategies. I think you will be able to benefit from my observations. To skip the text, examine the charts for what they have to say.

You Don't Win All The Time

Last month, after a week of designing on paper a trading system, I spent another three trying to formalize in code its trading procedures. At its core, I needed a special derivative function as I thought it might enable a different perspective on trading cycles. On paper it showed a huge profit potential.

On Portfolio Drawdowns

After reading the article: 180 years of market drawdowns, I thought I could add something to it. A different perspective, but nothing contradicting the author's point of view, on the contrary. I found his article interesting.

Portfolio drawdowns are relative, they are relative to the trading strategy used. But one thing is sure, a lot of trades will see some drawdown, more than people think. I opted to use one of my programs to illustrate the point doing a simple test on two stocks I have tested before (see DEVX8 related programs). I just wanted to verify some numbers.

The Value of a Stock Trading Strategy II (the analysis)

After doing the long term simulation described in my last article. It was time to open the black box and analyze what was inside. What follows is my analysis of the strategy presented in the previous article and I will reference it often. I want to extract what went wrong in that trading script to make it lose when without really trying it should easily have won the day, meaning that it could have ended positive, even if not by much.

The Value of a Stock Trading Strategy

Finding badly designed stock trading strategies is easy. I have hundreds of those on my machines. Took only a few minutes to locate one to illustrate my point. Didn't look at the code, technically, it was not required. But did perform a 20-year simulation on a small group of stocks. The same 10 stocks I used in recent months to explore a strategy's strengths, weaknesses, and limitations. The main reason for using that group was keeping the ability to compare strategies, and performance levels, while seeking the answer to the question: is strategy A better than strategy B?

Retail Stock Trading Environment

There are millions of traders, millions of trading methods, but a lot more investors. At the end of the day, all financial assets are accounted for, to the penny, and in someone's hands. In the US, that's about $99 Trillion dollars worth; this includes real estate, stocks and bonds. It's a big number. Some hold some of these assets for a short time, others up to multiple decades.

The short term retail trader is part of the minority, doesn't control anything.

Randomness in Stock Prices II

From the comments received over my last article on Randomness in Stock Prices, there appears to be some confusion for some in the terms used. I'll try to clarify my point of view.

Usually, the word random implies that you can not predict the next move better than by chance, otherwise it would not be random. You can assign odds, probabilities, to the outcome from observed statistics. For instance, in a random game like heads or tails, you can assign 0.50 as probability of getting head on the next flip of a coin.

Randomness in Stock Prices

Will a game with 51:49 odds still show some randomness? YES, definitely, and a lot. Even if it has a positive expected value. The same goes for a 52:48 game, there would still remain a lot of randomness. It might not matter much how the data might be distributed, it would still be mostly random-like.

Does the classification of a quasi-random game require a Gaussian distribution? NO, not at all. It could be any other type of distribution with or without fat tails.

A Stock Trading Strategy Experiment V

My take on my Stock Trading Strategy Experiment.

The whole Strategy Experiment had two surprises. The first one being that the MACDv03 program managed to outperform one of my preferred strategy: DEVX8. The second, how unexpected it was since it was not my primary objective.

My objective was to show that you could take an ordinary trading script and transform it into a portfolio builder. I considered the task a worthwhile experiment, hence the title. It is also why I opted to do it live, posting the results as I went along. A way of forcing me to look for better solutions and be more creative.

A Stock Trading Strategy Experiment IV

Time for some analysis. It took 2 days to design the first productive version of the program MACDv01. Another 3 to add the improvements that generated Strategy Experiment II (MACDv02). Made some minor improvements overnight which resulted in MACDv03, the one used in Strategy Experiment III, where I ran the program once on the 10-stock portfolio, and then reported the results.

A Stock Trading Strategy Experiment III

In Strategy Experiment II, I presented a stock trading strategy based on the MACD, a technical indicator often used in developing strategies. In Trading Strategy Experiment I was shown that such a minimalistic based trading strategy would not produce much over the long term. However, in Strategy Experiment II, it was shown that it could be transformed and used to produce interesting results at the portfolio level, and over the long haul.

A Stock Trading Strategy Experiment II

In my last article: A Stock Trading Strategy Experiment, I said it was time to do the portfolio level test. That I would take the same trading script, or slightly improved, that generated ABT's results and then use it on the other 9 candidates in the data set. The same stock list as tested in Delayed Gratification. This way I would also be able to make some strategy comparisons.

A Stock Trading Strategy Experiment

The objective is to design an end of day (EOD) stock trading strategy almost from scratch with for background an old trading script that did no trading at all. It was published in 2000, over 15 years ago, author's handle: Glitch. As given by the author:

Stock Trading Strategy Mechanics

It's a major transformation for me. I usually put out stuff that is clearly free, with no strings attached. But then, you observe that because it is given free, people attached no value to it. So, maybe now they will think it is worth something.

Stock Trading Randomness

A stock price series is the same for everyone. Everyone trading it wants to profit from it. Anyone wishing to trade it, implying short term, understandably, will have some kind of method to do so. Trading one stock or instrument at a time might not be enough. One has to have some perspective, a long term plan, not only to build up a portfolio, but also on how to manage it over time.

Delayed Gratification II

The article Delayed Gratification presented the 20-year test results of running the trading script DEVX6 (last modified June 2014, over 16 months ago) to which was now added 4 lines of code made to insert a conditional one-day time delay before salable shares might be sold. This pushed the 10-stock portfolio performance higher by $226M compared to the previous version of the program, and this on a 12-week walk forward test where the market average declined by -3%.

Delayed Gratification

In my previous article: A Case Study, commenting on the DEVX6 strategy, I said: "...those added lines ...could be used in the trading process itself since they were pretty good at isolating most of the trade clusters". It raised questions: why not use them? Can you get something extra using that information? Visually, those lines seem to be doing a decent job.

A Case Study

Over the last week or so, I've had some discussions on my trading methodology. One of which centered around a demonstration of what it could do. In reply to a friend's statement, I said: "my program would have done that too on that stock", which was to buy shares during the last price decline about a month and a half ago or so. I realized afterward that it was very easy to say.

Stock Trading Strategy Design I

Any stock trading strategy should be basic common sense. A stock portfolio does not grow instantaneously; it takes years to build it up and nurture. It is not enough to make a trade here in there without considering the size of the portfolio or the time span under which it will have to grow.

Building a Stock Portfolio

In building a stock portfolio, the account size alone will more likely dictate the trading/investment management style, its constraints, and conditions.

Also, it will depend on other things such as return objectives, acquired market knowledge, acceptable risks, available time, and temperament. I would say: "ultimately, the portfolio manager will be the focal point, the only decision maker whatever approach one might want to use" be it automated or discretionary.

Still More DEVX V6

In my previous article: More DEVX V6 was shown a simulation of the program over 10 stocks over durations of 10 and 20 years. The point was to show that this particular stock trading strategy would easily survive not only over its first 10-year trading interval, but also over a 20 year period, and this including one year of walk forward.

More DEVX V6

One of the hardest part in managing a stock portfolio is designing a workable and profitable long term trading strategy. It needs to be based on sound principles and provide a foundation as to how it will handle an unknown future. Trading automation presents an added dimension to the problem.

Connecting the Dots

There is sufficient data to start connecting the dots. What follows are explanations given to tests performed over the last few weeks to answer some questions on a LinkedIn forum. The last two tests have not been presented yet, but they will shortly. The point was to show that the trading method used mattered more that the stock selection that could be made.

Bringing Perspective to Stock Trading Strategies

A stock price series can be viewed as a stochastic, erratic, chaotic and random-like time function with shocks, gaps and fat tails. Mostly unpredictable. Accepting this has for direct consequence: one can't predict with any significant accuracy the price of any stock, be it today, tomorrow, next week, next year, or 20 years from now for that matter. Saying that a stock might be between $0.00, $10,000 or whatever with a 95% confidence level in some 20 years does not help at all.

Cheating by Spoofing.

Navinder Singh Sarao was caught cheating by spoofing. It took 5 years to finally prosecute him. 5 years during which time he continued to cheat. Could one say: regulatory agencies were sleeping at the wheel? For sure. Could one add that: brokers, exchanges and secondary parties that observed the misconduct were lending a blind eye as they could benefit indirectly by doing so?

Portfolio Math I

When designing stock trading systems it is a good idea to view the problem, not only with a vision of what a trading program could or should do, but also with an understanding of the environment in which this program will have to operate.

In a software trading program, which we can make it do whatever we want it to do, we only have logical decisions, calculations and statements in code to execute. No feelings, no moods, no hunches and no trader psychology even if these in some way could also be programmed in. But this won't stop anyone from just gambling, be it in a discretionary manner or by using a partially or totally automated solution.

DEVX V6 Revisited

Recently, I made the remark somewhere that if my DEVX V6 random trading strategy back test was done again it would achieve about the same results as the one done on November 2nd. It is always easy to make such a statement. But for me, when I express something like this, I need to show some proof or at least some evidence that it would be so. Expressing it, even if I know the end results before making such a test, it might not be considered sufficient by others.

A Unique Approach

In my last paper: A Donor Within, it is explained how an existing trading strategy was modified to reach a higher performance level. The section: One More Thing, starting on page 30, goes through the process.

First, the desired expectations were put on paper before any testing: increase position size by a factor of 10, and then improve on the compounded annual growth rate (CAGR) for the 30 stock portfolio over the last 25 years. Needed software procedures were determined, then the program modified and debugged on a single stock.

A Donor Within

Just sent my pledge to the Bill & Melinda Gates Foundation. I found it to be the best outcome for my years of research. Over the last few years, I've developed a series of better and improved trading strategies. My best strategies should be considered sophisticated, designed for long term appreciation, and should prove to be most profitable.

Winning by Default II

As a follow-up to Winning by Default, I wanted to show intermediary test results. The objective being to show the evolution of such a trading strategy from day one. There was no need to enhanced its performance level beyond the rudimentary settings as was done in Winning by Default. This is more a what if scenario analyzing a trading strategy's long term behavior and system metrics.

Winning by Default

In the same vein as in previous articles, I'd like to present the following charts from a portfolio simulation done over last weekend. It's huge and I am still analyzing the details involved with such a big portfolio. Its payoff matrix has for size: 13,000 rows (days) by 985 columns (stocks); that's 12,805,000 data entries for each of the matrices involved.

Nest Egg on Support

Or How to Build Your Retirement Fund

I would say all people would like to build a nice retirement account if they could. However, the process has always been considered difficult and often required professional help while most of the time they could just do it all on their own. What follows is all about a long term trading strategy that could simply help anyone take the first step in that direction. And if able, do even more.

Deviation X

Following my previous note, there was only one thing left to do and that was to perform all the mentioned long term tests. First, on the original program version as published on Wealth-Lab in July 2002. Then on one of my modified version of this trading script DEVX (version 3) and leave for the end improvements that could push performance results higher using general trading policies rather than trying to optimize parameters.

Swinging It

My next trading strategy to be analyzed is kind of another strange trading script, it buys and sells on about every price swing. It sets a no trade zone and will buy below and sell above it. Yet all entries are the result of random functions. It gives the illusion of perfect timing, when in fact, trades are coincidental, meaning not hitting the highs and the lows on purpose, but as a side effect and direct consequence of the methodology used.

Unorthodox Trading

Still in the process of re-evaluating my old trading strategies. This time the selected strategy is the BBB System (BullPower and BearPower Balance). It was designed in 2003 and its author also published it in Stocks & Commodities magazine (October issue). This means at least 10 years of out of sample (OOS) data. One can do a 10 year walk forward test on this one since it has been literally frozen in time.

Bizarre Trading Behaviors

About a week or so ago I started doing the inventory of my trading strategies, a project that has been delayed for over a year due mostly to procrastination and lack of time. It's a big project. I'll have to go through over 200 trading strategies of mine and document what each trading procedure does. Then determine their relative importance and the why they contributed to overall performance. Hopefully, this should translate into designing even better trading scripts or at least selecting the best of the crop.

This Crazy Game

In my previous note, I presented a chart displaying the evolution of the stochastic differential equation SDE based on the length of the trading interval Δt (from Δt → 0, to Δt → T (long term horizon). The SDE is an idealized and acceptable model to depict price action, and has been widely documented in academic papers for over 60 years. It's a simple regression line over the considered data.

The Drift

This article starts from the conclusion of a few lines drawn on a piece of paper, a simple representation for what I had in mind. I knew that the two drawn sigmoids were the answer to what I wanted to express. It's not that it was saying anything new, these curves have been out there for ages, it's just that much information could be extracted from those 2 curves.

Leveraging II

This is a followup to my previous article on leveraging, where additional explanations were required to make my point clear. The formula presented lets one "control" an acceptable leveraging factor without changing much to the long term output (as a matter of fact, less than 1%). And even there it will be to one's advantage.

Fix Fraction Position Sizing

My new paper deals with an equation designed to help you make more money by adding small improvements to your own trading strategies (should they not be present already). The equation (named red5) is a complete trading strategy in itself. It presets trading rules in order to generate long term positive alpha. I would suggest that your objective is to extract from red5 what you need and incorporate the lessons learned into your own trading methods.

Designing a Trading Machine VI

In Designing a Trading Machine V, and previous notes in this series, the point was made, hopefully, that accumulating shares over the long term while trading profitably over the process was another way of looking for some kind of trading edge. This edge had for vision: nΔP, with ΔP > T > 0; producing on average, a positive difference ΔP, a trade profit threshold T to be reached, and which was desirable to repeat many times (n), or else go for a larger ΔP on a small number of trades.

Trends?

Everyone seems to agree on the notion and existence of a "trend", but no one seems to agree on its definition. Some want a universal definition with no compromise; like in: this is "the" trend, period. Geez, it's evident, see, it starts here and stops there; it can plainly be seen by anyone of age on any chart of past stock price data what ever the selected time frame.

They want a one size fits all definition that a trend spans a microsecond, a week, a month, 100 years, anything in between or longer. Not only that, but this "trend" should apply to all classes of tradable assets at the same time in the same direction. Please...

The prior two sections: A Basic View and A Basic View II were simply a necessary introduction, just as this part is, to the reasoning needed to look at the trading/investing problem from the perspective of portfolio optimization under long term uncertainty.

When considering the graphic presented in the previous section, one soon realizes that it is stating the obvious: we know the past to the penny, we know the now for what it is, and the future remains almost a complete unknown. And yet, we can draw for future data almost a mirror image of the past data presented, even though none of those curves (for t > 0) could be predicted in advance.

A Basic View - Part II

Trend Distribution

When looking for a trading strategy, one usually start with a search for methods and indicators that can identify trends, then proceeds to find triggers as decision surrogates to execute entries and exits. Looking at past stock data, trends of all lengths can be found with ease even if one does not have a clear, precise or universal definition of what a trend is.

A Basic View

How ever you want to look at your trading methods, some very basic math apply. For sure... It is not, and can not be: those math things don't apply to me, I've got "my proprietary trading system" of play that circumvents all that. Sure...

Optimization Revisited

Optimization of a stock trading script over past data is the process of finding optimum procedures and parameter value sets which can produce the highest possible return over the testing interval. Robustness could be said of a system having wide ranges of values for each of the parameters in the set and still maintain high performance levels.

Old Routines II

As a follow-up to my previous article on the long term simulated IBM performance results, I've opted to provide more details on the origin and make-up of the underlying trading strategy. That article concluded with the results of a prior simulation done almost 2 years ago in July 2011 using about the same trading script.

Old Routines

Last week, while I was looking for some software routines, I started trying out some of my old programs to see if visually it would be easier to locate them. These programs had not been executed for over two years, and out of curiosity I also wondered how they would have done. It would be like a walk forward test and an out-of-sample test at the same time since none of data could possibly have been known to these programs outside their initial testing intervals.

On Randomness

When looking at stock price series, you often hear that such series are random or almost random in nature and if such was the case, then such series would have little predictability if any. However, some interesting observations could be made depending on the model used to mimic random stock prices.

On Cutting Losses

Over the past few weeks I've been posting in a LinkedIn forum on the subject of trends, randomness and designing out-performing trading strategies. It started as an attempt to answer the question: "Cut your losers and let your winners run". What I wanted to show was this type of market wisdom is not necessarily true.

Designing a Trading Machine V

From the observations made in Designing a Trading Machine IV,it was said to find and select some n(ΔP> T) on a daily basis (or any trading interval for that matter) where n was the number of profitable trades exceeding a certain threshold T.

Designing a Trading Machine IV

In Designing a Trading Machine III, I was making the point that ΔP > 0 was a sufficient condition to make a profit: P(out) – P(in) > 0. It says nothing about how the profit is made, but it does say that to have one, the relation must hold. This relation could be considered time, and size independent.

Designing a Trading Machine III

Designing a Trading Machine II ended with the presentation of a simulation test where the objective was to increase the number of profitable trades over the trading interval. The selected script was transform in order to increase its buying procedures and thereby increase its number of trades (some 40-fold over the original) for the 6 years trading interval.

Designing a Trading Machine II

Following the previous article: Designing a Trading Machine, it's time to start designing it. Some considerations or constraints will first be addressed, and from there start to give a structure to a trading strategy that will or should survive over the years.

Designing a Trading Machine.

I participate in a LinkedIn forum on automated trading strategies, here are some my observations over the past few days, starting with March 11th.

This forum is about automated trading strategies, and yet a lot of talk is on discretionary trading methods which by definition are not automated. In fact, if your trading method is not programmable, it is discretionary; and thereby can not be systematically back tested; otherwise going full circle it would be amenable to code.

An Experiment II

In my previous note:An Experiment, I chronicled the process of modifying the Livermore Market Key trading script after having issued a challenge to anyone wishing to show their system development skills. What follows is the continuation of that article starting with its ending.

An Experiment

In early June 2011, I had this great idea: take a known and publicly available trading strategy; offer a challenge to improve its performance level using what ever enhancements one could bring to the task. I figured it would be a simple way to showcase my own trading philosophy; if it was any good, it would easily show in the test results.

Winning the Game 1.1

To make the concepts in my trading methodology clearer and mainly to answer some recent criticism concerning the mathematical expressions used in my notes, short of maybe giving my programs away, I opted to revisit the foundations on which my methods rest and explain them in more detail.

Winning the Game

How can I win the stock market game? One asks this simple question and is bound to receive a million answers. Almost everyone has a piece of advice on this subject with lots of investment folklore, hot tips and unsubstantiated claims.

A Kind of Review

I have had this web page up for over 15 months now. Its prior version has been on since 2008, and during all this time I have promoted the concept of trading over a stock accumulation process as a methodology that has more than the potential to out-perform most trading methods out there.

Script Transform

I occasionally participate in the Automated Trading Strategies forum on LinkedIn. And over the past few weeks, I provided some comments which elaborate on the trading methods I use in my strategy design. The following observations are almost in chronological order.

Everyone has a trading method. However, what ever it is, it must do the job, it must deliver. Otherwise why spend so much time and effort to produce under-performers.

On Compounding

Designing a very profitable trading system is all about compounding. And if there is one thing that any trading method should strive for is to acquire, as much as possible, long term sustainable alpha points. Playing for a 40% return in one year has little value if it is lost the year after ($1.00 x 1.40 x (1 - 0.40) = $0.84).

The following graph shows $1,000 at various rates of return over 40 years:

A Changing Game

My latest paper: A Changing Game is out. It summarizes some of my latest articles on random trading over randomly generated stock prices made to mimic real stock prices including rare events or infrequent price gaps. An Excel file is provided for the more venturous. It contains a lot of lessons for those that want to look beyond what is there.

On Doubling Time

The stock market game is a compounding rate of return game. The main objective is to obtain a compounded annual rate of return as high as possible over the longest time interval within portfolio constraints of which the first is not to go bankrupt.

Changing the Game III

After the conclusion of my previous note: Changing the Game II, it was time to put the finishing touches to the Excel file.

This file is a working model designed to showcase some basic trading principles and methodology. It is not an end all, but it does show that accumulating shares and trading over this accumulative process can generate profits even if the entries and exits are taken at random.

Changing the Game II

In the previous chapter: Changing the Game, it was presented that even trading randomly over randomly generated stock prices could not only generate a positive outcome to the portfolio payoff matrix, but that this outcome could generate exponential growth.

To some, it is unthinkable that a trading strategy governed by randomly generated trades over randomly generated stock prices (including unpredictable gaps) could have profits on an exponential growth rate or even a positive growth rate for that matter. As was said in prior notes, the expected value of using heads or tails to determine some other heads or tails' bet is zero. Except if one or both coins are slightly biased.

Changing the Game

The Setup

In my last commentary: Randomly Trading, I presented the execution of a randomly generated trading strategy over randomly generated stock prices. The original intent was to answer someone on a LinkedIn forum on how to build a payoff matrix: Σ(H.*ΔP). So model 1 (very basic Excel file) was provided to show how to set up all 4 of the needed matrices: P, ΔP, H and H.*ΔP. Each matrix dealing with an aspect of a the payoff matrix used to simulate a portfolio of 10 stocks over 250 trading days (about a 1 year trading interval).

Leftover Bollinger Band

After dumping the Ichimoku script and starting to transform a Bollinger Band trading system found on the old Wealth-Lab 4 site, it was obvious that this new system had more potential. At least it could kept part of its identity.

It turned out that this “new” 2008 system was a variation of a 2002 Bollinger Band system designed by Mark Brown participating in one of the forums I visit on LinkedIn. At times, the world may be very small.

End of Ichimoku

The Ichimoku Kinko script was improved to such an extent that it has become an enviable script with desirable long term performance results. Over its almost 6 year test, it achieved a 47% CAGR while accumulating shares and cash in its account. It's average hit rate improved from some 35% to over 70%. 40 of the 43 stocks in the portfolio showed higher performance results. Of the 16 stocks showing losses in the original test, only 3 remained with total losses representing less than 1% of the generated portfolio profits. A very small price to pay for the added performance.

Growth Optimal Portfolio IX

Designing Trading Rules

If you want to implement an “enhanced” trading strategy H+ based on buying and selling functions and/or procedures, your primary objective as before is for your portfolio to exceed the Buy & Hold, performance wise.

Improving Ichimoku Kinko

After presenting the performance results of the original Ichimoku Kinko Yho script, it was time to start making some improvements, but first, there is a requirement of understanding what the script is doing exactly, and once this understood, proceed to the next phase.

The Ichimoku Kinko Yho charts 5 lines over past data resulting in a variation of a moving average cross-over system. It goes on the assumption that a lagging moving average projected in the future might have some forecasting value! The price 26 days ago is just that, the price 26 days ago.