Skip to main content

Trend trading 1500 tickers

In my previous post I showed a Python script that gets all the ticker symbols from Yahoo and Google that has references to. The reason for me to get lists of those tickers is that Plus500 provides a wide range of CFDs that follow these ticker symbols. The plus500 platform is pretty basic, to say the least, so I do not want to use it for analysis, but just for execution. Using their platform is however an easy way to trade of of signals that are generated by algorithms that take daily price data from about 1500 symbols provided by Yahoo an Google finance. My idea was to backtest some trend- / swingtrading strategies on all the different sets of price data from all the different symbols. Then rank them based on sharpe ratio and winratio and then only trade the highest ranking ones.

The basic idea is simple. I only want to trade in the direction of the trend and only when there is a "strong" trend. I want to exit trades when the trend is done or stalling. Recognizing trends can be done in many ways. To keep things simple so that I can always manually verify signals I choose to implement an algo with 3 Simple Moving Averages. I believe this is a pretty common way for traders to look at the market. All I wanted to add to this is to have a market screening app that gives my signals when trade opportunities present themselves. I will then look at the opportunities and decide to act upon them or not. So there will be no automated trading here.

The rules for the screening are:

  • if price is above the long term moving average, we will only look for long trades
  • then if the short term moving average crosses up over the midterm moving average, we will buy on the next day open.
  • and when the short term moving average crosses down over the midterm moving average, we will exit the long position on the next day open.

And in reverse:

  • if price is below the long term moving average, we will only trade short (which is easy to do with Plus500's CFDs)
  • then if the short term moving average crosses down over the midterm moving average, we will sell on the next day open.
  • and when the short term moving average crosses up again over the midterm moving average, we will exit the long position on the next day open.
I backtested this strategy with the most commonly used movingaverages, like the 200 and 150 day moving average for the long term, 20 and 50 for the mid term and a range from 3 day to 14 day for the short term moving average. It took a couple of hours to run through all the backtests, but then I ended up with a list of tickers with combination of moving averages and a ranking based on how well the performance was in the past 2 years.

Then I filtered this list to show only combinations that had a substantial amount of trades and a sharpe of above 2.
Here are my results for the Yahoo tickerlist.
M1, m2 and m3 are the short, mid and long term simple moving averages, that gave optimum results, but I noticed that all the commonly used combinations of MAs gave more or less the same results. The screening therefore merely filters out which tickers have been doing well with this algo for the past 2 years. The idea is that many of them will continue to perform with this algo the coming year; many but not all. We will need to create a new ranking every month or every quarter to adjust to the markets. And if we implement proper money management we might have an edge be profitable trading this way.

Where to go from here? Well, I will still need to backtest on the Google Finance tickers data sets and combine the results into one ranking list. Then I will have to create a signal service, that will get and analyse the data everyday and sends me an email with trading entry suggestions. I will then paper trade on plus500 and share the results.

If all goes well I intend to trade this way on a live account at and on a "normal" brokerage account trading options.

Popular posts from this blog

How to install Google Drive Sync on Ubuntu 16.04 and higher

Google drive is one of the many handy tools Google offers. It is a file synchronization tool that allows you to backup, store and share and access files in the cloud. I use it to collaborate on files with others or to sync movies that I can then easily publish on Youtube.

Unfortunately there is no native Google drive software for Linux Desktops. Luckily there is a way to have a proper sync setup on Ubuntu 16.04 and higher that uses the Google drive API and some Gui tools. Let me show you how I have this installed on my Ubuntu Desktop.

First I install the Grive2 commandline tool:

sudo add-apt-repository ppa:nilarimogard/webupd8
sudo apt-get update
sudo apt-get install grive

No need to set it up right now. Instead let's first install grive-tools. This is a package that is only available up to Ununtu Vivid, but I have found that is works just the same on Ubuntu 16.04
Run the following from a terminal:

sudo su -c "nano /etc/apt/sources.list.d/thefanclub*.list"
deb http://ppa.lau…

How to back test a manually traded strategy using TradingView

Trading is hard. It takes a lot of practice. One way to practice and build skill and confidence is to back test a system over and over again. In this video I show you how I do this using online charts at Tradingview.

Tools of the trade

In this article I will tell you about the possible tools you have at your disposal for trading. Whether you are building a fence, or building a trading strategy, you need tools to get the work done. In the previous articles we already looked at the question of why, how, what and where to trade. Now it is time to get some tools and setup an infrastructure for trading. We basically need three types of tools.