Oct. 20, 2021
As a follow-up to my last post, here are some additional observations. To put this in context, the last post presented a 12.16-year trading strategy simulation on a pure rebalancing play using the 100 stocks in QQQ, a weighted by market capitalization ETF. The strategy generated a 19.01% CAGR over the period, turning 100k into 830k or 1 Mil into 10.0 Mil with a 20.6% CAGR. Something better than most long-term market averages. The above-mentioned post also gave where to get a free copy of the program.
Oct. 9, 2021
Recently on QuantConnect.com, a trading strategy dealing with the QQQ ETF was published. You can find it HERE, where you can clone it and then test it for yourself if you want to.
The strategy caught my interest since all it did was rebalance QQQ on a weekly basis. It represented an opportunity to study the trade mechanics of a pure-play rebalancing in motion, something I wanted to revisit for some time.
QQQ is composed of the top 100 NASDAQ stocks by market cap. What could be the interest when you could just have bought QQQ and held on over the same time interval? Higher returns? Lower drawdowns? Something to do?
Aug. 12, 2021
This HTML file can be very helpful to anyone designing automated short-term stock trading strategies. It has deep implications. It deals with correcting for long-term portfolio return degradation, on how to fix it, and even how to reverse it.
It builds on mathematical equations used in describing the outcome of our trading portfolios and shows how easy it is to improve on these designs with simple trade triggering techniques. As if saying that your trading procedures can be greatly improved just by requesting more and letting long-term compounding do its job.
Aug. 2, 2021
There is math and gaming in building a long-term automated stock trading strategy. Some of it is quite elementary and ignoring it could be unwise. The math sets limits, boundaries, and constraints on what you can or could do in trading stocks over the short to long term.
I use math to describe the game and see its limits, and when programming trading procedures, try to enhance strengths and alleviate weaknesses within the confines of limited capital, limited time, limited know-how, and limited resources.
July 18, 2021
The big word in the title is "automated". The process should start with your honed discretionary trading system using your trading rules, market know-how, and trade logic which you simply automated.
There is a lot of software out there to help you do that, not only simulate your strategy but also trade live. Why do it? Who would have guessed? Evidently, for the money. It is there, available any day of the week. Doing it right, getting close enough to your long-term goals should be more than enough and relatively easy to achieve.
June 6, 2021
Another continuation to the last few articles found on my website dealing with the freely available In & Out stock trading strategy. This one is about gaining a better understanding of its trade mechanics. Without it, how could you determine what is really going on, and maybe more importantly, how could you "control" what it does? Or even better, what it will do going forward?
Forward, that is the keyword, that is where the money is. There is no real money to be made on a simulation over past market data. A simulation can only serve as a kind of feasibility study sampled out of the gazillions other choices that could be made. Why is this trading strategy profitable? How could you make it even more so going forward? Those are questions in need of answers.
May 1, 2021
Of the published automated stock trading strategies, you are presented with a diamond in the rough once in a while. You either ignore it or recognize it as such and try to find out if indeed it will have some real value after being cut and polished. It is a choice you have to make. You will still have to work to extract that gem and then enhance its value. To your credit, this is a very simple strategy.
April 1, 2021
This is a follow-up to my last article Basic Stock Portfolio Math. Trying to provide a different look at the inner workings of the In & Out stock trading strategy which is freely available on QuantConnect where you can modify it at will. The intent is to show how this strategy is making its money. It should prove interesting. The strategy is composed of only a few parts: a stock selection process, a trend definition section, and a trade execution method. Nothing very complicated.
March 9, 2021
The following HTML file deals with some of the basic math of a long-term stock trading portfolio. It reduces the problem to two numbers, one of which is a simple counter. Because trading over the years can imply a lot of trades, we have to look at the problem in terms of averages. What will the average net profit per trade tend to when you have a large number of trades? It is a basic question that appears difficult to solve, and yet, it can be greatly simplified. That you trade automated or by hand, the equations presented will still hold. The final outcome of a trading strategy is the result of simple math, simple equations, nothing complicated.
Feb. 19, 2021
Designing a successful stock trading strategy has about the same objectives as developing your own money printing machine. That you trade on a discretionary basis or use some elaborate trading program to execute your trades does not guarantee you to win at this game but you can easily put the odds in your favor of doing so.
In reality, the problem is very simple: you buy some stock (whatever the reason) and resell it later at a profit. You do it often. That is it. That is all the game. You do not need much to understand the mechanics until you do more than a few hundred trades. Then, you get to realize that the “game” is a little bit more “complicated”.
Feb. 6, 2021
You design an automated stock trading strategy and will use historical data for your simulations. Right off the bat, all the stock prices you will use are part of recorded history, and therefore, what kind of “discovery” are you going to make should be the question?
All the data is already there in plain sight. All you have to do is access it. Somehow, for some, it is as if the price of AAPL over the last 20 years has eluded them? As if they had never seen it before, or did not know what it did or what it stood for? AAPL and its related data is there, and that up to yesterday. Period. We can immediately see the hindsight problem this can create.
Jan. 24, 2021
Is there something in @Vladimir's In & Out strategy (version 1.5)? What I see is that there is money in there. But, you have to determine that for yourself. What follows is not intended to convince you, you have to do your own homework.
Is there an edge that could persist going forward? Is it of any consequence what this strategy did over its simulated past? Is this strategy overfitted or not? In all simplicity: is it worth it? There is so much that could be said about this strategy.
Jan. 12, 2021
The following post is in reference to a question asked on overfitting in a QuantConnect forum.
Any stock trading strategy designer should have views on this subject since somehow it gets in the way if not at the heart of any such strategy that it be live or simulated. I find overfitting indirectly related to the law of diminishing returns. Meaning that going forward, your trading strategy will produce less over time. However, it can also be viewed in light of another problem, and that is to think that the market will strictly follow our often misconceived and poorly designed trading strategies. It should be forcefully noted that the market has no such obligation.
Nov. 16, 2020
Following Quantopian's shutdown, some of Quantopian's members moved the In & Out strategy to QuantConnect. I moved there too and started reading the documentation. Also started analyzing this adapted strategy and doing some simulations of my own. The following is my first post on QuantConnect relating to this freely cloneable strategy.
Nov. 1, 2020
I was about to answer a question in a Quantopian forum when they opted to shut down their community website. Here is that post anyway. It is trying to answer: could someone use stocks based on highest relative strength above a market average proxy? The strategy's code was given in the thread titled: New Strategy — “In & Out” where anyone could make a copy of it and then modify it at will.
I had this prepared answer, so figured it would do no harm to provide it anyway before everything was erased. I will definitely miss Quantopian participants and would like to express my thanks to all for their comments and contributions over the past few years.
Oct 17, 2020
The previous post showed the outcome for long-term portfolios where returns were randomly generated. Even under randomness, it resulted in return degradation making the game not worth playing. Adding some alpha would make a portfolio profitable. And, if you added more alpha, the long-term CAGR could increase even more.
All simulations were unique. A new random return series would be generated for each and every one of the tests (over 300). We could anticipate that most tests would come out close to some average, whatever that average might be. This was illustrated in the charts, figures, and equations in the previous post.
Oct. 10, 2020
The previous notebook put some emphasis on having an edge to overpower built-in long-term return degradation. There are many ways of doing this. The payoff matrix equations can have gazillions of solutions. They all depend on how you deal with the ongoing inventory matrix H. Trading implies doing a lot of trades, and doing so brings along with it the Law of large numbers.
Oct. 8, 2020
Posted a Jupyter notebook on Quantopian. Here is a link to its HTML equivalent. (Sorry for the Quantopian links, the community website has shut down)
In the notebook, random return series were generated using a normal distribution with a 3% standard deviation over 1, 2, 5, 10, and 20 years to show the impact of trading over the long term. Such a strategy will breakdown over time. In the beginning, it might not be that visible, but as the time interval increases, it becomes more and more apparent since return degradation is technically built-in.
Sept. 16, 2020
The automation of a stock trading strategy appears at first glance as a simple process. You program what you think you might have done on a discretionary basis, except your computer can do it much faster and more often. You try to transfer to a program your acquired knowledge, understanding, logic, and trading methods by first simulating the outcome of your procedures over past market data.
Sept. 10, 2020
The following was posted in a Quantopian Forum expressing
my point of view on the highlighted stock trading strategy.
No one seems to be much concerned by the stock selection process used when it has a major role to play over the long term. First, let's set “long term” as 15 years or more. I would prefer 20-30+ years, but we do not have that much data available.
Sept. 1, 2020
A lot of emphasis was put on a payoff matrix equation (see my last article) to represent a long-term rebalancing stock portfolio. From it, we could estimate the number of trades the rebalancing might generate over the life of the portfolio. However, that was still only half of the solution. What was also needed was an estimate on the profitability of such a trading strategy. That part of the equation is more complicated and has a lot more than just one solution, even though, it too has a simple formulation.
Aug. 17, 2020
You start a stock portfolio with the intention of using scheduled rebalancing, meaning that the stocks in your portfolio are readjusted to a fixed weight on a yearly, monthly, or weekly basis. This portfolio management decision is simple, however, it does have ramifications.
An equal weight is easy to determine, it can be made proportional to the number of stocks j in the portfolio w = 1 / j. It does not say which stocks will be in your portfolio, only that the actual number of stocks will tend to j or less: → ≤ j. Fixing the number of stocks to be traded will also set the initial bet size which will depend on the available initial trading capital.
Aug. 4, 2020
The following was posted in a Quantopian forum on a trading strategy I greatly modified in order to have it follow its payoff matrix equation directives. It is also the fifth walk-forward performed on this trend-following trading strategy over the past 3.5 months. The strategy used a leveraged adaptive exponential betting allocation function to increase its long-term performance.
July 13, 2020
The following was posted in a Quantopian forum dealing with “Quality Companies in an Uptrend”. The original strategy template is available free for anyone to copy and use as they see fit. The trading strategy itself is fairly basic: it selects a set of the highest momentum stocks from top quality companies that are estimated to be in an uptrend. The assumption is made that such a trend would continue forward. The portfolio is rebalanced at the end of each month. Thereby, continuously chasing the higher momentum stocks. Nothing unreasonable about that proposition.
June 29, 2020
The way you design your stock trading strategy can force it to react in very specific ways. Pointing toward the need to gain a long-term portfolio management perspective since the primary objective of any strategy designer should be to structure these automated trading strategies so that they can, not only survive but also generate above-average returns over 20+ years. If you cannot achieve that, it is very simple: you failed. All you might have to help you is your skills, some math, and the analysis of past history.
June 25, 2020
The more you look at the stock market game, the more you realize you need to play for the long term even when you are making short-term trades. Also, the more you trade over the short term, the more those trades will be faced with random-like outcomes, and the more trades you will need to reach your long-term goals whatever they are. As if there was a contradiction in purpose and means to achieve those goals. Nonetheless, most often, it remains quantifiable. The presented equations will govern it all for some planned and preset strategies.
June 22, 2020
My last article: Stock Trading Game - Gambling It Out was making the point that stock prices could be considered as having the number of up and down days close to the equivalent of a coin toss. There was no need to look at thousands of stocks to validate this hypothesis. Even a small sample over an extended period of time would be more than sufficient to make that point. Nonetheless, some 21 years of data (5,473 trading days) was used to assess the general direction of the daily price movements and their long-term outcomes.
June 10, 2020
You want to win the stock trading game, even with all its uncertainty. However, it should not be just winning it. It should also be with a higher purpose. Maybe, something like building up your own retirement fund or help someone else build theirs. One thing you should want, no matter what you do in managing that stock portfolio is to make sure you will win and make it so you outperform the expected long-term averages.
Outperforming the long-term averages is the only reason for you to undertake such a tasking endeavor yourself. Otherwise, simply buy a market average surrogate (such as SPY or some equivalent), or find someone that could do better than you which would have been more productive moneywise and with a lot less work.
June 4, 2020
A stock trading strategy can often be simplified to its most basic components, and there are not that many of them. In fact, maybe just two. Those trading strategies cannot be considered that complicated either if whatever their outcomes, they will end up as being the result of two numbers, namely: the number of trades executed over the life of the portfolio and the average net profit per trade. Due to the continuous trading, it transforms the expected portfolio profit problem into a long-term statistically driven and dynamic inventory management problem under uncertainty.
May 30, 2020
In this third installment, I would like to concentrate on the second part of the equation presented in my previous post. It is also where you can find an explanation for a trading strategy's overall return.
But first, a point to be made again, if your stock trading strategy is not built to last, what is it good for? Why build something and see it blow up in your face after a number of years? Wasn't your goal to build your retirement fund or someone else's, or build a legacy fund for some reason or other, and that it would, at the very least, have a positive ending value?
May 24, 2020
My last article (The Inner Workings Of A Stock Trading Program - Part I) stated that a single line of code was dictating the long-term behavior of a stock trading strategy. And that this scheduled rebalancing was sufficient to explain the number of trades that would be carried out over the life of this portfolio. In that article, the first part of the presented equation provided this estimate of the number of trades that would be performed over the years.
Other important observations could be directly extracted from the same equation. Having a portfolio's payoff matrix equation to explain an automated trading strategy implied that the outcome did, in fact, answer to mathematical functions. And that it is these mathematical functions that are driving the show.
May 22, 2020
My last article admitted that the trading strategy used was effectively trading on market noise. Even under those conditions, it could win and win big. It is surprising that, after such a statement, system designers were not in an uproar and making all those points that could be made to rebuke the claims. The article went even further by providing a portfolio payoff matrix equation which enabled making long-term estimates of the portfolio's future value.
May 18, 2020
My last series of articles (The Portfolio Rebalancing Gambit, I, II, III) was about a trading strategy that dealt with its long-term payoff matrix as if playing a game where some randomness appeared to prevail, and a lot of it did. Even in that kind of trading environment, the strategy was doing more than quite well.
A stock trading strategy operates quite differently than a long-term investment strategy. The latter is awaiting capital appreciation from reasonable investments for periods of 20-30+ years. Doing so, almost assuring itself of winning simply by holding most of the stock positions for long periods of time. As an example, see Berkshire Hathaway.
May 6, 2020
In my previous article, the point was made that you could win the game relatively easily simply by prescheduling your future trading activity based on your portfolio's initial set up. The portfolio value equation was put on the table with a reachable long-term objective giving a purpose to the whole process. You did it for your own retirement account or as some legacy fund you might want to leave behind or build a generational fund with philanthropic views. Those are things for you to decide. All I can do is help you design your long-term portfolio for whatever reason you may have.
I will build scenarios based on the portfolio payoff matrix equation presented in the prior two articles of this series (see related articles below). The purpose is to show the range of what you can do based on your own portfolio settings and long-term objectives and also show where's the money. I hope that with the examples provided you will be able to build your own and know what to expect based on your numbers.
May 3, 2020
Whatever your automated stock trading strategy, it needs a purpose, an objective. You need to plan for where you want to go and how you will get there. From my previous article, you can estimate how many trades will be executed without even writing a single line of code knowing you will be scheduling a periodic rebalancing procedure over your portfolio's life cycle.
This article continues in the same direction as the preceding ones (see related articles below), going from the endpoints and designing a trading strategy backward from the perspective of its long-term objectives. And then, redesign the trading strategy for going forward. All in the process of trying to answer the question:
What does my trading strategy have to do to reach its long-term objectives?
April 30, 2020
Often, we ignore the very structure we have given our automated stock trading strategies. We code them to behave in a certain way for as long as they will be executed. For example, in most Python programs showcased on Quantopian, we can find variants of the following line of code:
schedule_function(rebalance, date_rules.month_start(), time_rules.market_open())
It instructs the program to rebalance its portfolio the first trading day of each month as the market opens. That single line of code will execute, on its preset schedule, no matter what. Other programming languages would use a different syntax and wording to accomplish the same task.
April 24, 2020
We often design stock trading strategy simulations by first programming them on some economic notion and then observe the outcome. As if the trading procedures, over the long term, would resolve the appreciation problem all by themselves, when a more global view should be taken. The where you want to go and how far will it take you?
Most of it could be determined beforehand. More planning and a better outlook as to what you really want to do.
April 20, 2020
We design stock trading strategies simply to make money. The more the better. But it all has to be done within constraints of available capital and minimizing overall risks. Trading has a number of differences when compared to long-term investing in many regards. A trade, almost by definition, is seen as a short duration thing that can come out profitable or not. While in the long-term setting of investing, durability, appreciation and overall trends gain more importance. Short-term fluctuations are practically ignored while trading might live by them.
But whatever the trading strategy, it has some basic math to explain what it does. Not sophisticated math mind, as will be demonstrated here, but inherent structures nonetheless that are dependent on the how the trading is done. Most of the text that follows is about averages, and we can use these averages due to the large numbers that will be used. In all cases designing diversified portfolios with hundreds of stocks and thousands of other possibilities.
April 16, 2020
Usually, in designing automated stock trading portfolios, all the attention is put on the program's code. The trading procedures, the decision making, the gathering of relevant information that needs to be analyzed, interpreted, and acted upon. Often, our initial capital is a limiting factor just as our ability to extract a decent long-turn return.
Here, I will go about it in reverse. From the final objective, it will be to break down the trading strategy into what needs to be done to achieve these long-term returns. Something like starting from the end results and asking the question: how did we get here? Or more to the point: how could I get there? The “I” here is you.
April 13, 2020
The following is a post made on a Quantopian forum related to my recent articles on the subject of a portfolio's doubling time (see related files below).
I like the notion of doubling times for a portfolio. It indicates, on average, how much time was required for the portfolio to double in value. It is all a matter of the strategy's CAGR, its compounding rate.
April 9, 2020
I thought it might be an appropriate time to make a walk-forward test on the strategy presented in my January 8th article: Financing Your Stock Trading Strategy which showed a 16.9-year simulation with an ending date of 1919-11-29. It would make this new simulation a walk-forward, out-of-sample, test where the strategy would not have seen the last 3-month of market data.
March 31, 2020
My previous article dealt with The Making Of A Stock Trading Strategy's mathematical backdrop. Designing automated trading strategies having for objective to prosper over the long term. There are a multitude of ways of doing so. A trading portfolio, even with its short-term vision, needs to view its final outcome in light of a long-term compounded return. This is where a portfolio's average doubling time takes some importance.
March 28, 2020
The making of an automated stock trading strategy is relatively simple. It is made of 3 distinct processes: selecting some stocks on some reasonable quantifiable assumptions, determining the logical trading rules and procedures that will be applied, and executing them. The trading process can be enclosed in a single do-while loop and be executed until reaching the end of the program, that it be up to a past or future date.
March 16, 2020
We can represent stock trading systems with equations and not necessarily know that much about their future market returns, except general expectations and/or educated guesses. However, with these equations we can determine what is needed, over the long term, to trade and win.
Jan. 24, 2020
This is a follow-up to my last article, an attempt to answer the question: can you do more?
Two of the most important traits of any stock trading strategy should be its durability and its scalability. The first so that the strategy does not blow up in your face during the entire trading interval, and the second so that a portfolio can grow big.
Jan. 8, 2020
In my previous article was shown 17 simulation results of a stock trading strategy as found on the Quantopian website. On that basic template, I added optional functions in order to increase and control performance.
This intermediary step is part of my analysis of the strategy's worthiness since I am still exploring its capabilities: limits, strengths, and weaknesses. I present 12 new simulations using 160 stocks.
Jan. 2, 2020
This article refers to the first trading strategy displayed and cloneable on this Quantopian website forum. The strategy makes a ranked selection of 20 stocks based on some fundamental data and equally rebalances its portfolio weights on a monthly basis. It uses a SPY 140-day return to determine its trend and will switch to bonds as downside protection.
Dec. 29, 2019
Portfolio rebalancing has been around for ages, that it be a Sharpe ratio, Markowitz rebalancing, equal weighing of securities held, or on something else, most were done at pre-scheduled time periods. This made them program time-dependent. And as such, almost independent of whatever the market was doing at the time. If you opted to rebalance at the start or end of the month, it was an arbitrary program choice which carried with it its own set of trading circumstances.
Oct. 19, 2019 NEW BOOK RELEASED
My latest book available on Amazon: The Future Belongs To The Builders Of Mega Funds is on the construction of - you guessed it - mega funds.
We have entered this age of super corporations, those with valuations exceeding 1 trillion dollars. The future will bring many more of these online. In their wake, it will create super conglomerates, super banks, and super investment funds the size of which has never been seen before.
Oct. 6, 2019
The following simulation results were posted in a Quantopian forum as a follow-up my last post (A Markowitz Attempt) in which I returned to the $10M initial capital scenario. I wanted the program and its subsequent tearsheet analysis to finish since at times some are too big to complete in the allowed time.
Sept. 29, 2019
This is a peculiar trading strategy. The original author probably wanted it to be based on some Markowitz portfolio management principle, but it is not. Nonetheless, over part of its trading interval, it does make as much money doing nothing as it does trading.
Sept. 26, 2019
This new HTML file puts a few questions on the table. Even if the title sound obscure, its understanding is relatively simple. Mostly, it says that stock prices are not normally distributed and therefore why apply that kind of math to the problem if it is not that representative?
Sept. 25, 2019
This HTML file deals with stopping times. It is a notion related to stochastic processes where we try to determine where and when certain values will be hit like a price target for instance.
The note argues that it is not the first stopping time that should be the main interest, but the last one where you might have no means to determine when and at what level it might be reached if at all. Yet, getting closer to that last stopping time might have more merit since it should tend to increase profits.
Sept. 20, 2019
This HTML file deals with stock portfolio strategy design problems associated with automated trading. We know that over the long term, most professional portfolio managers do not outperform market averages. However, using simple tools, one could do better than average.
Sept. 16, 2019
The following HTML file deals with stock selection problems associated with automated processes. In particular, often the mere fact of selecting stocks on some economic rationale is sufficient to reduce the immense set of potential portfolios to a unique and totally deterministic one. This, that we look backward or forward in time.
Sept. 11, 2019
The following HTML file combines two recent posts made in a Quantopian forum. It deals with the structure of a stock trading strategy and the steps that can be taken to enhance its performance over the long term. It should be viewed as a continuation of my Reengineering For More series of articles.
Aug. 30, 2019
When designing automated stock trading strategies it is mainly to outperform other available methods of portfolio management including other automated strategies. You can go to outperform over the short term where you will find a lot of what should be considered market noise (unpredictability or volatility or randomness or whatever you want to call it). Or, go for the longer term where the prevailing long-term market trend will be more visible.
Aug. 24, 2019
We can design our stock trading strategies to do whatever we want. However, most often it just turns out to be whatever we can. These strategies could be based on about anything as long as they remain relevant to our intended objectives. Also, they actually have to be feasible in the real world and be able to survive over the long term.
What is the use of a stock trading strategy that will blow up in your face
at some time in its near future and completely destroy your portfolio?
How about if it is not even designed to outperform market averages?
Aug. 22, 2019
A recent post made in a Quantopian forum. (Sorry for the Quantopian links, the community website has shut down)
The trading strategy described in my article: Reengineering For More was designed to be controllable. We could be more aggressive by adding more pressure to its controlling functions, or slow it down at will if we considered it too much or felt it was going to fast. It is part of the advantage of having controllable portfolio level functions rather than having adaptive or fixed trading parameters. It remains a compromise between individual preferences and maximizing long-term objectives.
Aug. 21, 2019
Improving overall portfolio performance over the long term might not be that hard to do. However, you will need a long-term vision of things to do so.
We all know the future compounding value formula: Cap. ∙ (1 + r)^t.
Say you want your long-term portfolio performance to produce twice as much as it could and wonder how much more return, or effort, would be needed to accomplish the task.
Aug. 18, 2019
Posted in a Quantopian forum recently as a follow-up to my article Reengineering for More which presented a remarkable trading strategy with outsized performance levels.
The described trading strategy used the CVXOPT optimizer.
First, let it be said. It is extremely difficult to extract some decent alpha using an optimizer.
The optimizer can only give you what it sees and you have no control how it will trade.
July 22, 2019
This is a follow-up to my last Quantopian post.
A more elaborate and detailed explanation for the equation used can be found in my third article of a series:
This is, I think, the 7th strategy I have enhanced or repurposed in Quantopian forums using parts of the equation given in that article. Another dozen or so simulations have been chronicled on my website over the years based on the same general equation.
July 19, 2019
This week there was this interesting notebook presented in a Quantopian forum. It is worth reading first so that what follows could be better understood. It is based on a free paper on momentum with volatility timing (link provided in the first post).
What I observed was that there was something in there that could apply to any wannabe market-neutral trading strategy. However, it still depended on the premises made about the market in general.
July 11, 2019
In a Quantopian forum, someone cited a Will Rogers' quote as a put down to the fact I was suggesting people buy stocks that are going up and drop those that are going down. This old Will Rogers quote goes like this:
Don't gamble; take all your savings and buy some good stock and hold it till it goes up, then sell it. If it don't go up, don't buy it.
To which I replied.
Will Rogers was right. It was and still is excellent advice. I used that same quote on my website years ago, but I read it differently. And I think Mr. Buffett also adheres closely to that same pun.
July 8, 2019
Answering a question in a Quantopian forum about the variables used in the presented equation in my last article.
Those variable names expressed averaged out functions: dampers, boosters, accelerators, amplifiers, and controllers. As their names imply, they are made to increase or decrease the impact of the controlling functions as the strategy moves along. Each playing their part somewhere in the program with the meaning you would give to those names.
July 7, 2019
I have absolutely no obligation to post anything on Quantopian forums, it is just like for anyone else. However, if I post something, I stand ready to explain and discuss within my own understanding and IP disclosure limits what a trading strategy does and for what reasons it does it.
July 6, 2019
The chart below shows the value of having some alpha over the long term. It can easily be reconstructed using the formula: Init. Cap. ∙ (1+ E[rm] + α)t, where rm is the long-term expected historical market return and alpha the added performance over and above this average market return.
July 6, 2019
Over the past 2 years, I have covered a lot of the inner workings of my trading methodology on my website and in posts on the Quantopian website forums. I find the methodology relatively simple and hope that from what has been presented, anyone could reengineer their own strategies to make them fly. This way everyone would be responsible for whatever they do.
July 6, 2019
Here is another follow-up post on Quantopian dealing with the same trading strategy as discussed before.
I stated previously in A Cloud & AI Strategy thread, that if you wanted more you could add a little bit more leverage, and since the leveraging is compounding, it would have a direct impact on the overall performance. Evidently, it would also have an impact on the portfolio metrics.
July 6, 2019
As a follow-up to the last Quantopian post, I added the following:
Of note, the mentioned trading strategy started scalable by design. I could push on its pressure points in order to increase the number of trades and the average net profit per trade. These were modulated. Most of it was done by leveraging and adding protective measures for when the equity line decreased by either reducing positions sizes or going short.
June 28, 2019
The following was posted on the Quantopian website.
I got interested in Stefan's trading strategy after seeing the “Cumulative Return on Logarithmic Scale” in a tearsheet. It showed alpha generation. This is represented by the steady widening of the spread between the algo and its benchmark.
I understand that this is a niche trading strategy specifically oriented on cloud and AI computing. Nonetheless, we should look at the stock market with a long-term perspective. And forecasting that we will need more from our machines should be considered as an understatement. With the advent of G5, this trend will accelerate and enable all new kinds of devices (IoT) requiring even more storage and services. Therefore, such a niche market should continue to prosper over the years.
June 23, 2019
The following Quantopian post was to comment on the following: “There is such a thing as skill, but my read is that proving it might take a lifetime.” To which I agreed and added:
That kind of study has been done. It turns out it would take some 38 years for a professional money manager to show skill prevailed over luck at the 95% level based on sufficient data (10 years and more). No one is waiting or forward-testing for that long. And even if they did, they would again be faced with the right edge of their portfolio chart: uncertainty, all over again.
May 26, 2019
The following was posted on a Quantopian forum where I sometimes participate.
We should separate the problem into two parts. One for selecting over historical data and one where the data is forthcoming (some future data). These two will turn out to be quite different problems. Simulating the future should be viewed as either a walk-forward or some form of paper trading. Both of which do not produce any money and therefore are just other forms of simulations. You could paper trade for years if you wanted to. But, in the end, you would still find yourself at the right edge of a price chart with an unknown future.
May 10, 2019
The following is an extract from my latest book (Reengineering Your Stock Portfolio) where I try to answer some probable and unasked questions related to the presented trading strategy. See my recent articles describing this strategy in more details.
To give an inkling of the strategy's capabilities, and to put it in some kind of context, the following equity chart (figure 8.16 from the book) shows some portfolio metrics for this remarkable trading script over its 14-year simulation period.
May 6, 2019
The trading strategy described in my latest book (Reengineering Your Stock Portfolio) has some singular long-term properties. It started with a trading strategy (published on Quantopian) which was modified, step by step, to enrich its final outcome. Instead of trying to optimize alpha-factors or some of its parameters, equations and administrative procedures were used to direct and control this innovative strategy's trading behavior.
April 30, 2019 NEW BOOK RELEASED
Reengineering Your Stock Portfolio starts with a friend with whom I often discuss my trading strategies saying: why not write a book on this one? A few days later, I sat down and started writing without needing a plan knowing where I wanted to go and what I needed to do.
My take was, go ahead, simply do it. Modify the original program found on the web as need be and document what you see. At times, I even had a simulation running in the background while I was writing on the coming test result knowing they would be positive. I would then take snapshots of the results I found interesting and document what I saw.
March 17, 2019
I am writing a new book. I do not have a title yet. Nonetheless, it is filled with simulations, charts, and graphics. For those that have read: Beyond The Efficient Frontier, you should find it fascinating and a must have since this is the application of what was presented in that book. For those not having the book, here is a summary.
Beyond The Efficient Frontier used an optimizer library (CVXOPT for Python) to make all its stock trading decisions. The book showed that a simple long-term trend was sufficient to extract long-term profits from the market. It would do this for thousands of portfolios having hundreds of stocks.
March 2, 2019
The trading strategy illustrated in my last article goes on a simple premise. If there is cash in the trading account, or, its equivalent, it stands ready to buy shares for its stock portfolio according to its CVXOPT optimizer recommendations. It would also do so if you increased available cash reserves by either selling some shares, adding extra funds, or using leverage.
When you look under the hood, you do not see why a trade is taken. All you see is that it was executed. The optimizer took care of it all. You had no control over the prices or the quantities to be traded either. What you knew however was that the optimizer had for function to optimize for the best outcome should it find actionable data.
Feb. 26, 2019
The trading strategy referenced in my last article was the followup to the series of articles: Trading Stocks Generate Its Own Problems Part I – VI (See related files below) where the CVXOPT optimizer was used on randomly generated price series to illustrate how even a small trend could be detected and capitalized on for the benefit of one's stock portfolio.
The series of articles cited above, as well as my last book: Beyond the Efficient Frontier, were centered around this optimizer and on the use of randomly generated prices with trends.
Feb. 18, 2019
The following was posted on a Quantopian forum. It deals with a stock trading strategy transformed to have a long-term game plan and objectives. It also treats of multi-strategy portfolio scenarios where allocation distribution might matter more than one might expect. An example of the originating trading strategy is linked to in the Quantopian forum.
Somewhere along the line, you will have to mix trading strategies together, meaning playing more than one at a time. And the overall result will depend on their sum. Each strategy will be allocated some initial capital and ran simultaneously with the others in the group. This group of strategies could be of any size and will constitute the entire portfolio.
Jan. 30, 2019
You already know you will be faced with a lot of uncertainty as not to call it randomness, stochastic behavior or outright chaos. If you flip a fair coin to determine the next move on another fair coin, you should not be surprised if you get it right only about half the time.
Then why, when you see that you are getting about half of it right while trading can't you see that the thing you are betting against might be quasi-random with close to 50:50 odds?
Jan. 28, 2019
Based on literature on designing stock trading strategies we should consider testing both an in-sample (IS) and an out-of-sample (OOS) trading interval before going live. Some even suggest another testing interval as an additional step after OOS to make sure that the trading strategy will not break down going forward.
But even that is not enough. As soon as a strategy will go live, its CAGR will start to decay. At the very least, trading strategies that are programmed to be linear will do so.
Jan. 24, 2019
Reducing the Trading Interval
As you reduce the average trade interval for the average trade, its potential average return is also reduced. But this can be compensated by the sheer number of trades that can be made with positive results. There are a lot more 1% moves on a daily basis than there are 10% moves. In the first case, you will find hundreds of them every trading day while in the second you could count them with both hands. Also, those 10+% moves appear more as outliers and are much more difficult to predict or anticipate. Whereas, a 1% move can be had, on a daily basis, on about a quarter of the listed stocks, meaning opportunities abound.
Jan. 20, 2019
The stock market is not homogeneous. Therefore, why even think of treating it as such? All sectors are not equal, then why invest in each one equally? All stocks are not equal, then again, why use equal weights? At any one time, you can not predict that 50% of stocks will be going up while the other 50% will be going down and know which will do what. So, why go 50% longs and 50% shorts?
Jan. 16, 2019
In Part I, it was shown that a trading strategy could be expressed as a simple equation. The outcome of that equation gave the sum of all winning and losing trades. You would have a number of losing trades and the rest would have an averaged profit making the strategy worthwhile or not.
Jan. 15, 2019
What does it take to win the stock trading game? It is not just a rhetorical question, but nonetheless, it does encapsulate a whole gambit of related questions from what is the game about to how to assure yourself you will, in fact, win the game.
First, the trading game is very very simple. You repeat the same one thing over and over again under uncertainty.
Dec. 30, 2018
The notion of overfitting and over-optimizing in automated stock trading strategies has been over-documented in the financial literature for quite some time. What I often see however are poorly designed trading strategies that should be better classified simply as misfitted and using worthless concepts or trading procedures for the job.
In a nutshell, an “automated” stock trading strategy says: this is how I see the structure of this trading environment. My program will do this and that, ..., and will win the game.
Dec. 20, 2018
No one seems to want to consider how much randomness there is in stock prices. The question should be why? It might be the most important question of all. Even if not, it would still be more than worthwhile to investigate how much there is. Depending on the answer, it could simply force us to rethink, remodel, or at least transform our trading strategies and the way we play the game.
The problem is: how should we define randomness in stock prices in the first place?
Dec. 8, 2018
What was demonstrated in my latest book (Beyond the Efficient Frontier) was that the market's average secular trend could be considered as sufficient to explain most of the general underlying long-term price movement in stock prices. To make the demonstration, price series were not decomposed into various factors, but simply reconstructed from scratch using an old stochastic model that has been in use for decades.
Nov. 14, 2018 NEW BOOK RELEASED
I was preparing a follow-up to the last two articles (see related files). But then, from simulation to simulation, the article grew and grew. So much so, that it is now a 160-page book filled with charts and equations. One would think that the whole thing would be complicated, but in reality, it took all that complexity and reduced it to a few guiding equations.
A new book is always exciting. Especially when you put so much into it. This one is special.
Oct. 7, 2018
This HTML file: The CAPM Revisited II is the continuation of my last article: The Capital Asset Pricing Model Revisited. This new file makes the case that the use of a trading strategy optimizer might force to consider not detrending price series since some of the information is lost in the process. It also makes the case that the alpha generation is important since it can make quite a difference in the end.
Oct. 2, 2018
The CAPM (Capital Asset Pricing Model) has been around since the 60's and is often found as a justification for the notion of the portfolio's efficient frontier. The following HTML file starts to question that argumentation. You usually see CAPM models showing a few securities in order to make the concept clear and easy to understand. You find them not only compelling but also reasonable as if a matter of fact it should not be any other way.
Sept. 24, 2018
My previous article concluded with it would be possible to design trading strategies that could “almost surely” win, in aggregate, almost all the time, given time. It was also said that simply adding back the removed trend line to the presented stochastic equation would be sufficient. I would like to substantiate it so that it is not just a claim or an opinion, but something that can be translated into facts.
Sept. 2, 2018
This article is intended to be a follow-up to the previous article: Factoring Sector Risk Returns. Oftentimes, we analyze some data and then find that there is a lot more to it than expected. The more you dig in, the more you find. Not in changing the data, but by understanding more of its intricacies and interrelationships.
August 30, 2018
Recently on Quantopian, one of the topics was: Common Factor Risk Snapshot. The provided notebook's intention was to give a quick snapshot of the performance of common risk factors over the past year.
The following chart (Cumulative Sector Factor Returns) is based on Maxwell Margenot's notebook which can be found HERE.
August 18, 2018
Recently, on a Quantopian thread, the debate touched over-fitting stock trading strategies. I tend to have a different point of view on this subject than most since I find the very definition of strategy over-fitting as something that describes very little of what is. It resulted in the following post which is replicated here.
The notion of over-fitting a trading strategy might technically turn out to be quite a misnomer. It might require to do so many compromises that its very notion becomes almost irrelevant.
August 8, 2018
Usually, we plan on having one portfolio playing a specific automated stock trading strategy. We find the best strategy we can and go from there. However, when looking at multiple trading strategies to be applied at the same time, the nature of the problem changes. You now have to take into account how these strategies will behave together. It is where you might have to game the strategies you have within your overall portfolio objectives and limitations.
August 2, 2018
Following my last article: The Math of the Stock Trading Game is Quite Simple, I thought it might be of interest to provide an example with numbers while keeping with the portfolio's payoff matrix equation as presented. You look at a problem long enough and you start to synthesize what it is all about. Not that you master it, but that you can somehow replicate its parts.
July 29, 2018
A stock trader deals in standardized pieces of paper representing his share of ownership which can easily be auctioned in a public marketplace. You buy some shares of some company (q∙p) to resell them later, hopefully, at a better price (q∙p+), thus making money. Every merchant on the planet sees the same kind of problem.
July 11, 2018
One of the major concerns in stock trading strategy design is future price uncertainty. Unsure of about everything as to what is to come. As if unable to make assured predictions on what might or might not happen next. If it was not like that, you would be sure and ready to play that game every day of the week. Call it fun and lucrative.
The more randomness there is in stock price series, the more difficult it is to consistently extract predictable profits. As if the predictions were mere coincidences or luck
June 17, 2018
Basic Portfolio Math part IV, made the point that the 505 listed stocks in the S&P500 price matrix were the same for everyone. Its past is recorded history and there is only one iteration of it. The possible combinations of selectable stocks for a portfolio is so huge that there is not enough computing power on this planet to make an exhaustive search for the best possible trading strategy within a million lifetimes, let alone over the next few minutes.
June 10, 2018
Part IV of this series considers what goes into building a stock portfolio for the long term. A look at the magnitude of the problem of finding the best portfolio mix possible to the acceptance of the best you can do which is designing a good trading system able to prosper for decades. In the end, it is the account balance that will really matter.
May 29, 2018
Recently, Quantopian released its white paper: Quantopian Risk Model where they discuss market-neutral and beta-neutral stock trading strategies. The purpose of the paper was to show what is required, at least for them, or more likely, what their contest participants should seek when designing market-neutral trading strategies. That is if they wanted to be part of the small and select group that might see their trading program receive a funding allocation and get a participation in the generated profits.
May 24, 2018
The stock market game is relatively simple. You buy some shares, hold them, or resell them later. You intend to invest in worthwhile companies for the duration of whatever holding period you see fit. The main objective remains, in either case, to make a profit. However, this profit should be looked at from a long-term perspective. If you trade, it is not just one trade that you should be concerned with.
March 1, 2018
Some of the stuff in portfolio management is so basic that we often forget how really basic it is. The building block of a portfolio is the position taken in some shares of a listed company as an investment or as a short-term speculative move. In both cases, the objective is to make a profit. We buy an asset and hold on to it, or resell it later on for a profit. Trading is simply doing the latter more often.
The problem is not with the understanding of the game, it comes from asking very basic questions, like what, when, and how much. An even more basic question is: why initiate that trade, at that time in the first place?
Portfolio management theory has had a lot of books written about it. However, few show how easy it can be to express the outcome of a large portfolio's total trading activity using a single mathematical expression.
I use a payoff matrix for simplicity and convenience. The outcome of a payoff matrix gives the total profit or loss of a stock trading strategy: Σ(H ∙ ΔP). It is a simple expression and it carries a big punch.
My last article: Trading a Buy & Hold Strategy. A Game You Can Play might have had a better subtitle as A Game You Can Win. Was made a demonstration that a well planned long-term stock trading strategy can be designed to survive and thrive for years and years. I had my preferred strategy (DEVX8) do its third walk forward, this time for almost a year. See article for details.
A Game You Can Play
Imagine, proposing to buy stocks in an upmarket. For over 6 years, my website has had a simple message: accumulate shares for the long-term and trade over the process. Using trading profits as a source of added capital to accumulate more shares. A kind of self-financing proposition. Over a dozen different stock trading strategies have demonstrated how it could be done.
October 18, 2017
You invest and trade in stocks not only to get richer but also to build up a retirement fund either, for yourself, your children or others, from which at some point in time you would want to extract cash for living expenses or whatever other purposes.
My last article (A Price Tag on Alpha - Part III), of a 3-part series, concluded with the realization that should one have a stock trading strategy that is generating some alpha, then he/she/they might be better off implementing it for themselves. Other benefits could be had. One I would like to address is the building of a retirement fund.
October 12, 2017
... Part III of III
This 3-part series: A Price Tag on Alpha is trying to answer the question: What would people pay for performance of over 25% on a yearly basis? Part I covered the basics and Part II left some questions unanswered especially concerning the price one should pay for this 15% alpha.
A 15% alpha starts to be interesting if, and, I would say only if, F0 (the initial capital) is large enough, and that the trading strategy is designed to maintain its CAGR for years. If not, the strategy is not worth as much.
October 8, 2017
... Part II of III
In A Price Tag on Alpha - Part I of this series, we barely covered alpha generation. All we did was put on the table an expression for the future value of the most expected portfolio outcome, this taken from the US stock market secular trend over durations of 20 and 30 years. We did provide a formula with the alpha considered but have not shown its long-term impact. Time to remedy that.
October 4, 2017
... Part I of III
The other day, someone in a Quantopian forum, probably referring to his stock trading strategy, asked the question: What would people pay for performance of over 25% on a yearly basis?
The answer evidently should be a lot as this might put someone at the very top of the 0.1% of portfolio managers. For instance, to give this some perspective, Mr. Buffett has maintained a 20% CAGR over the years. And, look at what he achieved for his shareholders and himself. Maintaining a 25% CAGR (compounded annual growth rate) would be nothing less than most impressive.
September 1, 2017
To a question asked by a Quantopian forum member wanting to clarify my use of the word alpha in a stock trading strategy, I replied with:
I use alpha as defined by Jensen in the late 60's. That is, as the premium return above market averages. Often also referred to as some added portfolio management skills.
A portfolio's expected return can have for expression: E[F(t)] = F(0)∙(1 + rm)t which represents some initial capital compounded over time. In the stock market, rm is given away, almost free.
August 14, 2017
After publishing my latest book: From Zero-Beta to Alpha Generation, Reshaping a Stock Trading Strategy, a few questioned the presented stock trading strategy as if it might be unrealistic. That we could not reach those kinds of numbers. When all this stock trading strategy did was follow the math of the game.
With everything provided in that book, I think anyone could rebuild something similar or better. The benefit: it would now be their own code. A strategy design they would understand well enough to maybe give them the confidence needed to apply it. Or find in it trading procedures that they could apply elsewhere.
August 1, 2017 NEW BOOK RELEASED
Just released my new book: From Zero-Beta to Alpha Generation, Reshaping a Stock Trading Strategy.
It chronicles the remodeling phases of a stock trading strategy found on the web.
From its beginnings where it could not really outperform market averages to making it the most powerful trading strategy to have in a portfolio of strategies. So powerful, in fact, that over the long term, it could carry the day for the entire group.
July 21, 2017
Recently, I got interested in zero-beta stock trading strategies after reading on Quantopian's preference for such strategies. I always found them to be less productive profit-wise than other methods that would correlate more closely with the market. I got to dig deeper and had to change my mind.
One of Quantopian's forum members put out a zero-beta trading strategy that I found interesting as having some potential for me to modify and improve. It took a few tests to appreciate the trading logic conveyed by this strategy and see how it behaved over time.
June 13, 2017
It might be hiding in plain sight. In my last article: No Alpha No Game it was stated it was a sufficient condition to have an upward bias in the price data to win a long-term stock market game.
Often times, people want to look at the game as if randomly set, meaning that the probability of going up is about the same as going down. As if playing a heads or tails game. A game known, for centuries, to be a zero-sum game and unbeatable except by luck; when, in fact, the stock market game might be something quite different.
June 9, 2017
My latest book: A Quest for Stock Profits If you want more, you will have to do more... mostly talked about an automated stock trading strategy that was described as gambling its way to the finish line over its 14.42-year journey.
Playing the stock market game has no rerun buttons. It also has no refunds. As a trader, you win, good, it is yours. You lose, well, you lost, next, please.
So, it would sound more than reasonable to make as sure as possible that over the long run you end up a winner. And, you can do this only with some alpha generation.
June 4, 2017
Obviously, to program until there are no bugs left. The important word: program, is just that, a program. An understanding of what you want to do is nonetheless required.
A software program that trades stocks live is playing with real money. It is as if it was not enough for you to lose money on your own, you had to program a machine to do it for you. A way of saying: there are prerequisites.
May 30, 2017
My latest book: A Quest for Stock Profits. If you want more, you will have to do more... makes the point that the original stock trading strategy, on which it is based, was simply gambling. And this automated gambling was somewhat camouflaged in code as if trying to persuade people that it was trading based on some fundamental market data.
When in fact, it was just playing market noise.
May 21, 2017 NEW BOOK OUT
My new book is out and available on Amazon:A Quest for Stock Profits.
if you want more, you will have to do more...
A Quest for Stock Profits describes a methodology that could be used by anyone. The same trading principles can apply going forward after having shown to have been reliable and profitable over an extended period of time.
May 6, 2016
I received the following short and direct question by email: "Is that algo for real? 40,000%?" It was referring to chart #11 in my last article: A Quest for Stock Profits – Part II
My reply was rather direct too:
Yes, and the trading procedures used are perfectly legitimate operations. They all survived within their coded limitations. There were no errors in the code, mathematical, logical or otherwise. No gimmick or deception. Just plain Python programming.
April 9, 2017
From what was presented in A Quest for Stock Profits – Part I, one might conclude that there was very little there of interest. Most of it almost ordinary. Nothing to make a fuss about. On the other hand, it might have been an appetizer, part one of a two-part series. There is definitely more to the story.
April 5, 2017
Over the last two weeks, I did some new tests using another trading strategy found on Quantopian. I only started modifying this strategy after someone made modifications to another version of the original program. The first time I looked at the original, I classified it as a throwaway. It could not even generate a speck of alpha.
A lot of time and work with nothing to show for it profit-wise. It ended not even beating the index over its 13-year trading interval. At least, it finished close to it which is a lot better than most. But, nonetheless, not enough.
February 28, 2017
You often hear academics and traders say: "all trading strategies fail over time". They don't provide proof but will provide examples to make their point. And usually, for the examples they present, I agree, those strategies should fail. It is as if their selected trading strategies were designed to fail in the first place, and therefore, no one should be surprised if eventually, they do fail.
There are exceptions, but I do not see them as such.
February 21, 2017
The stock market game is played under uncertainty. You are not totally certain of what the future may bring. However, if you take a long-term view of things, you could look for "stuff" that does make sense, and might most assuredly continue in the future.
I do expect, with a very high probability, that tomorrow there will be more people on the planet. I can not be certain on a day to day basis, but I do know I will be right almost every day of the year since it will require a huge disaster for that statement not to hold. And those "events" do not happen every day.
February 12th, 2017
This is part of my post-test analysis of the last three articles I wrote (see list below). All the tests were done on Quantopian servers using their data under the same conditions as everyone else. I used a slightly modified version of the program found on their site.
The original cloned program used (The SPY who loved WVF) showed a 22.43% portfolio CAGR over its 6-year test. And this, while using 3x leveraged ETFs. If you did the math to convert the thing to a no leverage scenario, the CAGR would drop. There were no leveraging fees in this ETF scenario since leveraging is included by design. But, this still made it a 3x leveraged portfolio.
February 7th, 2017
The previous article made the point that you could increase a stock portfolio's performance by slightly increasing a single variable. The given portfolio equation was:
A(t) = A(0) + (1+g)t ∙n∙u∙PT.
Based on this, in the previous test, g was raised by 1.5%. This time, it will be raised by 2.0%. And since g is part of a compounding factor, it should show its impact all over the strategy's timeline.
Once you have your trading strategy, meaning you have a long-term positive edge. There will remain one question. How can I do more of that?
February 6th, 2017
My last article showed impressive test results.
Yet, my book states that one could do even better. One could start with a trading strategy having some built-in edge as was presented in Part one. And build from there. The portfolio equation to be used would still be:
A(t) = A(0) + (1+g)t ∙n∙u∙PT.
Raising g will increase the total output. You do not need to push by much since there is a compounding effect in place.
As a demonstration of the phenomenon, I used the same trading strategy as presented in the previous article. Raised its g value by 1.5%. A minor modification, yet, the impact is noteworthy.
February 4th, 2017
The HTML file at the end of this article relates to my transformation of a cloned trading strategy as found on the Quantopian website. It was first declared as not worth pursuing. But I like to take such strategies and make them do more. A kind of demonstration of what you can find in my book holds.
The premise is simple. If the stuff presented in my book works. Then, almost as a foregone conclusion, based on those principles, I should be able to make such a trading strategy outperform. And the applied trading procedures would have a positive impact on the overall performance level. That is what this HTML file is all about. Making do with what was ordinary stuff, and making it great. You be the judge.
January 27th, 2017 NEW BOOK OUT
My new book: Building Your Stock Portfolio is out. It is available on Amazon.
Building Your Stock Portfolio has for sole purpose to help you make more money. It is about you building a long-term stock portfolio for whatever reason you might have, and making sure you reach your goals.
Is presented the making of a trading philosophy, a methodology which hopefully could become part of yours. My main objective is that you will not be copying what I do, but doing what will be right for you going forward.
January 20th, 2017
In a previous article was put forward the notion of a trading strategy's signature. It was defined as the output of a long-term automated stock trading strategy that traded a lot. The result of a program which executed what it was programmed to do over an extensive period of time.
If a stock trading strategy is designed to generate thousands upon tens of thousands of trades, it will asymptotically approach a kind of law of large numbers. Meaning that the numbers in n∙u∙PT will become more representative of the whole due to the sheer size of n.
January 19th, 2017
In my last article, A Stock Trading Strategy Signature, I presented a model for a trading strategy, an equation. It is derived from the payoff matrix, another expression used to resume a portfolio's entire trading activity over its lifetime. This model has interesting properties.
It too resumes, in just three numbers, the total outcome of any stock trading strategy:
January 16th, 2017
This is the continuation of Playing the Stock Market Game: Time is All
Repeatedly applying an automated trading strategy to a bunch of stocks in a backtest will produce the same answer every time. It is the output of a program. A recipe, a set of trading rules, procedures, coded instructions and software routines.
Since the output of a trading strategy can be expressed as a time function: A(t) = A0 + n∙u∙PT, then, A0 + n∙u∙PT is its unique signature. Leaving us with 3 portfolio metrics of consequence.
January 7th, 2017
People don't see how easy it could be to do more. If only they gave it more time. The ultimate objective is to outperform long-term averages, and making sure you do. So, here is a back to the basics.
You give yourself the job to go from point A to point B. Nobody is forcing you on this, that is to play this game. You already know your point A, that is where you are right now; with all your resources, know-how, and expertise. You know where you want to go. The only thing left is to determine the path to get there. And here Google Earth or a GPS won't help you.
December 29th, 2016
My previous article (The WOW Factor) might appear at first glance as an exaggeration of some kind. For one thing, it is not a hoax or a data manipulation of some kind. It is just an aggressive trading program. It only needed deep pockets. The simulation was part of the development cycle where one tests for up and down limits. A lot of it is doable under more restrained methods. These added methods would have for sole purpose to reduce the strategy's volatility and drawdowns. They would still generate high returns, lower than what was shown, but still relatively quite high compared to market averages.
December 18th, 2016
In my previous post, it was said I would not trade in that fashion. For one, I do not have that kind of capital available. And two, I may be too chicken. I prefer a smoother ride. But, that does not mean that this particular trading strategy is wrong, or that we can not extract useful trading procedures from it. Even downplayed the strategy could make quite an impact.
The strategy did give more than an indication of where upper trading limits might reside. And based on the strategy's code, it could do even more. I was exploring to find where these limits were, and even at the presented level, the program had not reached them yet.
December 16th, 2016
I will start with the conclusion since it is intended to raise eyebrows and it can be given in one screenshot. The chart below comes from modifications to a program found in the Quantopian Lectures. To achieve such results, I modified the parts of the code that dealt with n, u, and PT since they are the only portfolio metrics of significance. For more explanations on the portfolio payoff: n*u*PT, please refer to recent articles.
December 7th, 2016
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.
November 25th, 2016
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: the number of trades done, the trading unit used, and average profit percent for trade. Three portfolio metrics that are given by any simulated or live stock trading strategy whatever its portfolio composition. One could view n * u * PT as a trading strategy's signature.
November 18th, 2016
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.
November 16th, 2016
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).
November 14th, 2016
For those that have followed this series of articles 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.
November 11, 2016
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.
November 11, 2016
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.
November 8, 2016
In A Stock Trading System – Part I, was made the case that 3 stock portfolio metrics were sufficient and of major concern when making the analysis of a stock portfolio's end results.
Having only 3 metrics to describe the output of a portfolio management system, it then falls on those three metrics to explain what is going on.
November 6, 2016
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.
November 2, 2016
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.
October 22, 2016
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 backward, but most certainly constructively, allowing for a multi-asset, multi-period view of the stock portfolio management problem.
October 13, 2016
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 an 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.
October 10, 2016
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.
October 3, 2016
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 in 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.
September 25, 2016
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.
September 15, 2016
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.
September 13, 2016
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.
September 8, 2016
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.
September 6, 2016
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.
August 27, 2016 Updated
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.
August 19, 2016
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:
August 16, 2016
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.
August 5, 2016 Modified August 6, see bottom section
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.
August 3, 2016
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.
July 28, 2016
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.
July 23, 2016
An interesting recent article that appeared in MarketWatch had for 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."
We read this, understand and accept the numbers, but we just pass on with some comment approaching: so what! We have seen this before. But rarely put numbers to it. $1,000 at 10.35% for 30 years give: $19,194. That's it!
July 11, 2016
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.
June 27, 2016
Here is an aspect of trading that I have not seen often discussed in stock trading strategy design. It starts with the concept of line segmentation, or the slicing of stock price time series, and deals with what might be considered stochastic stopping times.
Most aspects of it have been covered before in financial literature, but maybe not in this fashion. Hoping to provide a slightly different perspective.
June 22, 2016 Also available in PDF
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.
June 20, 2016 Also available in PDF
(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 higher prices (see the 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.
(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.
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.
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 most 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.
April 29, 2016
In a LinkedIn forum I participate from time to time there was this statement: Why it's not possible to teach most people to be successful (primarily related to automated trading). To see the thread follow the link above.
I somewhat disagreed with the initial appraisal. I did have a different take on it.
That thread initially implied that there is this 1% that made it (trading profitably that is) when even that was not demonstrated. The other 99%, were considered "rookies", from whatever profession they might have come from who had somehow to also learn the ropes somewhere.
April 20, 2016
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.
April 13, 2016
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?
April 8, 2016
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.
March 9, 2016
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 the probability of getting head on the next flip of a coin.
March 4, 2016
Will a game with 51:49 odds still show some randomness? YES, definitely, and a lot of it, 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.
February 8, 2016
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.
January 30, 2016
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.
All of it was being done live and recorded as I went along.
January 26, 2016
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.
January 22, 2016
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 dataset. The same stock list as tested in Delayed Gratification. This way I would also be able to make some strategy comparisons.
January 19, 2016
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:
"The indicator oscillates around zero and registers extreme ratings when prices are trending. Values above 100 indicate a bullish trend, and less than -100 indicate bearish trending. This ChartScript colors the bullish bars blue and the bearish bars red. Congestion bars are black."
Book released this January 1st, 2016. My first book made available on Amazon. Never thought I would ever do this. But, there it is.
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.
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.
October 24, 2015
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%.
October 23, 2015
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.
So, I went back to the DEVX6 program (June 2014 edition) and started looking at what I could do to improve the trading in general.
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.
August 24, 2015
(see part 1) The evolution of a portfolio is determined by its ongoing inventory composition. It can be written as a time function:
A(t) = A(0)*f(n, q, Δp, I, D, t).
The information set (I) can be independent of everything. It's just one's way of looking at things and reaching trading decisions or not (D).
August 23, 2015
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.
July 26, 2015
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.
July 23, 2015
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.
July 3, 2015
One of the hardest parts of 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.
June 16, 2015
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 than the stock selection that could be made.
June 1, 2015
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.
April 27, 2015
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 since they could benefit indirectly by doing so?
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.
Trading Short-Term or Not? That is the question.
Whatever automated trading methods you might have used in the past, use now, or will use in the future, it has for unique purpose to make you money. It's not important that the code you use be well structured and nice or which software you will use. What's important however is the ultimate outcome of the trading strategy. One should understand what it really does and how it behaves under favorable and unfavorable conditions.
Recently, I made the remark somewhere that if my DEVX V6 random trading strategy simulation was performed again it would achieve almost 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.
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.
November 6, 2014 New paper: 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.
I view the offering of my best performing trading strategies as my way to help people, more than I ever could alone. It is all explained in my latest paper: A Donor Within.
August 11th, 2014
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 enhance 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.
August 3, 2014
What follows is an experiment in strategy design.
Scenario: from one stock, over an 8 month period of the past year; I predetermined trade entry and exit points by date. Therefore, this experiment is entirely fabricated. Nonetheless, there was something to learn from the process.
Using one stock (AXP), I hardcoded trade dates and produced the following for summary performance report:
July 28, 2014
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 in 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.
July 20, 2014
As a summary, up to now, 4 long-term trading strategies have been analyzed. All four started as nonproductive, meaning that they could not even beat the Buy & Hold over the long term (read 20+ years). The trading strategies original versions have been in public view on the legacy Wealth-Lab site from 8 to 12 years. Each strategy was modified to gain a long-term perspective with for backdrop the accumulation of shares.
June 24, 2014
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.
June 18, 2014
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. Will buy below and sell above. 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.
June 8, 2014
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.
June 3, 2014
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 reasons 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.
April 30th, 2014
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.
April 22, 2014
This article starts with the conclusion of a few lines drawn on a piece of paper, a simple representation of 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.
March 24, 2014
This is a follow-up 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.
February 19, 2014
Last weekend I had to answer a question: < I have read all your posts but I am little unclear about the following where you said: " it does show the value of accumulating shares of a rising stock and letting the market pay for it. " >.
My answer might be of interest to some. I thought the easiest way to answer this question was to illustrate the point with a few charts.
December 9, 2013
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.
October 22, 2013
Everyone seems to agree with 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 whatever the selected time frame.
August 18, 2013
When looking for a trading strategy, one usually starts 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.
August 14, 2013
However you want to look at your trading methods, some very basic math applies. For sure... It is not, and cannot be: those math things don't apply to me, I've got "my proprietary trading system" of play that circumvents all that. Sure...
Some seem to look at the stock market game as if the same as a casino and play accordingly.
August 1, 2013
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.
June 5, 2013
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 almost the same trading script.
June 5, 2013
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 the data could possibly have been known to these programs outside their initial testing intervals.
April 28, 2013
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.
The following chart shows a randomly generated price series.
April 27, 2013
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.
March 30, 2013
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 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 transformed 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.
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.
January 19, 2013
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.
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 whatever 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.
December 5, 2012
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.
September 30, 2012
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.
September 8, 2012
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.
August 19, 2012
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).
August 6, 2012
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.
July 30, 2012
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.
In one of its simplest forms, portfolio performance could be expressed as:
July 8, 2012
After the conclusion of my previous note: Changing the Game II, it was time to put the finishing touches on the Excel file.
July 4, 2012
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.
June 25, 2012
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 the payoff matrix used to simulate a portfolio of 10 stocks over 250 trading days (about a 1-year trading interval).
June 1, 2012
After dumping the Ichimoku script and starting to transform a Bollinger Band trading system found on the old Wealth-Lab 4 website, it was obvious that this new system had more potential. At least, it could keep 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.
May 6, 2012
Developing a Trading Philosophy
Usually, developers start by programming trading strategies based on some particular idea or concept they might have on market or price behavior. The objective is simply to design a better trading strategy. They will backtest over past market data to see if the trading procedures do generate profits or not. And from there will start an iterative process to improve the structural design of their new preferred trading strategy.
April 20, 2012
Over the past few months, I've been mostly involved in backtesting various concepts to see if they could enhance my trading methodology. The process is still on-going. But meanwhile, I thought it might be interesting to respond to a post on the LinkedIn group: Automated Treading Strategies, where the question was: why not show your methods live on Covestor or Collective2? This way anyone would see your so-called “over”-performance results, and if your trading methods have any value.
March 4, 2012
All I have written on this website is dedicated to a single equation which translates a single concept. This equation has evolved over the years but not in what it represents or its governing trading philosophy. The concept remained the same throughout: trade over a long-term share accumulation program. And in its latest iteration, serving as an explanation for the process, its payoff matrix representation looks like this:
January 31, 2012
Recently, in a LinkedIn forum, I presented my latest research note: Optimal Portfolio V. The object was to show that designing holding functions that can increase exponentially in time had for secondary effect to increase portfolio profitability at an exponential rate as well. Using a stock accumulative process to which was added a trading component could produce exponential alpha that went way beyond the Buy & Hold strategy.
April 23, 2012
Conquering Compounding Power
Recently doing some tests on some scripts that are still available on the old Wealth-Lab 4 website, I noticed that I could select almost any script and push its performance level higher. And that raised the question: why? You should not be able to do this. All scripts are like trading philosophies, a modus operandi, a kind of recipe trying to print money. These trading strategies are not just some set of random buy and sell orders.
January 4, 2012
Programming trading strategies is a succession of transforming an idea or ideas into procedures that when applied performs better than the previous iterations.
I am always looking for the best performer. I also know that I can always do better. But there are some basics. First, I know that whatever effort I deploy I must at least beat the long-term Buy & Hold strategy. If I can not do that, then why do all the work?
November 11, 2011
In my previous notes, I tried to make the case that by adopting administrative procedures, a portfolio manager could achieve an exponential Jensen ratio. All he/she had to do was to re-invest the portfolio's profits as they came in. Not that difficult a task! About the same as re-investing the dividends as they came in. Nothing fancy, I would even say boring, but a task that needs to be done nonetheless.
October 26, 2011
I tried to show in my previous article that by adopting a profit re-investment policy it was not only possible but a simple way to achieve an exponential Jensen ratio. The conclusion was that skill matters, and it grows with age. It's part of the very nature of an exponential time function. So the question becomes: why aren't most investors adopting such a winning strategy? Or better yet: are there ways to improve on this exponential Jensen ratio?
October 18, 2011
Since last April, I have done numerous trading simulations looking for which of several trading methods I would like to adopt. Its a search not only for the best performer but also for the one I'll be most comfortable with; and which would become my trading platform for the coming years.
October 15, 2011
This article is dedicated to Ian who asked very pertinent questions concerning my trading methods on LinkedIn's forum: Automated Trading Strategies. But I did not have simple answers. I was aiming for a short reply, but it morphed almost into almost a thesis. I am sure he will recognize from the maze below answers to his questions.
October 7, 2011
My back-testing methods usually start the same. I locate a script for one reason or other, try it on a few stocks, then look at the script to explain what I saw on the generated charts and analyze the trading decision making.
In this case, I started yesterday with the: “One Minute Bollinger Band System” chartscript listed on the old Wealth-Lab 4 website. This script is presented as Technique 16 in the book: “Trade Like a Hedge Fund”. (Note: The Wealth-Lab 4 website has been shut down).
September 28, 2011
Trading over Accumulation Procedures
First, a Side Note:
All my writing is to show that by slightly changing one’s point of view, one can design automated trading systems that not only outperform the Buy & Hold but will leave it far behind performance wise. The first point being made is probably that the Buy & Hold and short to mid-term trading are not mutually exclusive; combined they can do wonders.
September 14, 2011
Trading on What?
For the short term trader, trading on what basis becomes a major concern. Fundamental data is of little help analyzing short-term market activity. Technical data is good at saying what was, but has little short-term predictive powers. Statistics seems to become the only source of filtered data that can bring an edge, but there again, all you will find will describe past price action.
September, 08, 201
Not everyone needs to do back-testing and therefore to some, it is not a worthwhile endeavor. There are thousands of ways to play the stock market game and a lot of them do not require back-testing at all.
For instance, I am sure Mr. Buffett does not do any kind of back-testing nor does his staff has any time for it.
August 27, 2011
The most concise mathematical formulation for profits generated from trading stocks that I have encountered is provided by Schachermayer's payoff matrix:
Profits = ∑ (H . * ∆S) Schachermayer's Payoff Matrix
where H is the holding matrix (the number of shares held in each stock over time) and ∆S the matrix of price differentials from period to period.
July 26, 2011
I have been in the implementation phase for over 6 months now. A lot of backtesting has been done; always improving on the trading model and pushing performance higher and higher. From the first implementation where the compounded annual growth rate (CAGR) was around 50% to the latest iterations where the CAGR exceeds 100%, it has been a long journey.
July 6, 2011
This site is dedicated to a single concept and that is: it is not only possible to beat the Buy & Hold strategy; it can be done easily and by a wide margin. Doing so requires changing slightly the point of view of the stock trading process and is summarized in the graphic below:
May 27, 2011
I am always looking for reasonable explanations for my trading scripts. What makes them work, what are the principles at play, and what is the main reason for their high or low performance? Are the improvements really real, operate at the portfolio level, or are they just curve-fitting on a single stock? These are all legitimate questions and if I can’t provide a reasonable answer, a common sense answer, then it should be back to the drawing board.
May 19, 2011
What is Alpha Power? Alpha Power is a trading methodology developed and refined over the years to become a total portfolio management solution. It was designed to meet several key objectives: 1- to greatly outperform the Buy & Hold strategy, 2- to accumulate shares over time while doing so, 3- to trade market swings over its accumulative functions, 4- to accept other features that can boost performance.
May 8, 2011
Implementation Phase. At Last! Over three and a half years in the making; always sidetracked by the need to prove to myself that the methods that were used were worthwhile by setting the mathematical framework where they would have to survive. Had I not achieved to demonstrate mathematically that it was feasible to achieve some alpha trading stocks, I would have had to stop searching.
September 12, 2009
This article is a follow-up to the position sizing article. It is available HERE.
What preceded on position sizing was the general mathematical framework where an optimal trading strategy was simply summarized as a share-holding matrix:, where the initial quantity held in inventory could grow at the portfolio's delayed average exponential rateThis "optimal" trading strategy is not unique; it depends on each stock's appreciation rate and as such will be different for each subset of stocks selected as a portfolio.
May 14, 2009
The Buy & Hold strategy will build equity V(t) at an expected rate of return that will be close to the expected average secular market return:
At least, that is what you should expect. It is, for instance, the whole idea behind index funds. However, the Buy & Hold, as is, is quite inefficient.
November 27, 2008
My lastest trading formula. Over the past few weeks, I have been working on ways to mathematically express some of the performance behavior of my underlying trading philosophy in an attempt to better understand the whole process. My trading methodology uses partial excess equity build-up to acquire more shares on the way up and consequently slightly leverages the portfolio. See my Jensen Modified Sharpe paper for a more elaborate exposé.
July 8, 2009
Another way of considering the optimal portfolio problem is as in Schachermayer1 where he represents a trading strategy H(∙) as a matrix of size T x d:
H(∙) is the matrix of the quantities held in each stock (1,...,d) over the investment interval with a final time horizon T. Each Ht in this matrix is a time series.
August 4, 2009
Before proceeding with this next section, I would like to make a few comments. This is not intended for commercial publication; for me, it is just a way of keeping a public record of what I think has an intrinsic value (the formula for the Jensen modified Sharpe ratio - equation (16) in my first paper). I write first for myself and sequentially, meaning from the top down and when I miss something or other will go back to include what, I think, is missing to make the current passage more understandable.
May 11, 2011
I wanted to set one of the controls settings, described in my Jensen Modified Sharpe paper, to the desired profit level. From the paper, it is said that you can preset the sum of profits generated. It is not said that you will reach them. The governing equation is dependant on the size and nature of the price fluctuations and that cannot be guaranteed.