Tuesday, 16 January 2018

An Algo Creation in Progress

To create an algo, I reverse engineer it to get the results profile I want. The results below show an algo for the DAX that trades 3 minute bars but can only enter during the first 2 hours of the session. I have identified this time as one that has opportunities. I then looked at the metrics of the results I wanted. This is how far I have gotten so far. There are 3 years of data in the results.


The next step can be to just do a Monte Carlo analysis to test for robustness as well as to test the algo with different periodicity data. Or, I can add rules to reduce risk or drawdown by eyeballing a chart. The risk is curve fitting. I rather accept risk than do anything that curve fits. My goal is to ensure robustness and there are a number of things that can be done to check for robustness.

I've been getting quite a few emails regarding algos. People are beginning to understand that algo trading is a lot easier than discretionary trading for most people because instead of the decision making process using discretion, you are using a tested algorithm whose past results you know and which give you expectations (but not a guarantee) of future possible profitability. See the disclaimer. Adding a number of algos into a portfolio is designed to further add robustness and smooth out the equity curve.

Saturday, 13 January 2018

Different Ways of Trading an Algo

Today I am posting the results of a different type of algo. This algo is one that I use on many different markets. It was created by me using momentum and trend indicators. No genetic creativity but purely observation and test based logic.



As you can see, the algo has a little less than 3 years of data in its test results. The reason for this is that, after testing, I discovered that the algo works best by using that shorter amount of data to optimize and then trade it for a month before a new re optimization. In the Periodic Returns Report  you can see the Out of Sample profitability for January so far.

This algo is optimized every month and uses that almost years of data for that reoptimization. During that month the algo trades fully automatically. This means that my expectation is that the algo will trade more consistently than the historical statistics show, particularly that the drawdown is expected to be much less.

Its important that proper testing is done. Its not just a matter of pressing the OPTIMIZATION button and taking the most profitable result. The internal results of the optimization, such as symmetry, distribution of trades, average trade, ratio of draw down to profit are critical. I've posted links in this blog to the books that I recommend if you're interested in this way of trading. I'll be writing more on this theme.


Saturday, 6 January 2018

Fully Auto Algos

There are lots of ways of using algos. The benefit is that after creating a fully tested algo you have not only a fully tested and walked forward strategy but you have a trading plan built into the process as well.

The strategy below is a very good example. It is an algo based on the ES and uses DAILY RTH data. It only trades at the open so is very easy to follow.


This strategy was created over 5 years ago by using genetic programming technology. The out of sample profitability for the last 5 years or so is:


I can trade this algo in different ways, with futures and let it run fully auto or with options and choose from different strategies such as credit spreads or butterflies. The algo takes away the difficult decision making process. Its robustness having been profitable for more than 5 years may change if the market changes from being so unidirectional. However, the data used to create the algo goes back to the year 2000.

Algo trading is an important part of my trading arsenal and complements my discretionary and option trading. It does take work to find and test the right algos.

Tuesday, 12 December 2017

What are "THEY" Doing?

Reading this blog and if you've done any of my training or mentoring sessions there's one prominent thought that I have tried to ingrain in everyone when they are trading.  Always ask yourself: "What are THEY Doing". The "THEY" of course is the balance of the market. This is the nett order flow. Its also sometimes questioned as "who's in charge".

This is the very basis of trading. Everything I do, every mark on my charts, every thought in my head is designed to answer that question. Once I have that answer I know, on the probabilities but not absolutely, what should happen next. But I have to keep on asking myself that question as every tick unfolds so I know when to get out if I'm in or when to get in if I'm out.


The above is a Crude chart of 3333 contracts. The reds are the deltas of sells and the greens are the deltas of buys and the width describes the relative volume traded at that price.

This chart has no bells and whistles, no zimmer frame, nothing to take your attention away from what THEY are doing. Trading the right edge of the chart requires a lot of practice and observation. Adding a couple of indicators helps in the early stages but perhaps they become a hindrance as time goes on. The jury is still out on that.

But rest assured, the only thing that counts in trading is knowing what THEY are doing!

Tuesday, 5 December 2017

Lets Not Forget Discretionary Trading

I thought it would be a good time before the end of the year to show my updated discretionary trading workspace.

The key, the so-called holy grail, the magic or whatever you want to call it is looking at what orderflow is doing at support and resistance areas.

This is now and always. Nothing has changed in what we look for although the tools we use have been updated considerably with the technology.

I now manually trade only for an hour or two a day. Its usually the DAX when I'm in the European time zone but can be the ES and CL or 6E in other time zones.

I still use Market Profile, Volume Profile as well as the indicators you see on the chart below to find the areas where orderflow will reverse or breakout. The arrows around the bars on the NinjaTrader chart reveal what is happening inside that bar.

I keep it simple. No complications. The context is king and I make a trade when the orderflow is interpreted as favourable in each particular context. This is understanding what is PROBABLE when certain things happen and understanding that the action will happen X% of the time. When it is clear that the action will not happen then I exit. If the market moves against me but I was too early and the trade is still probable, I will double down at certain distances from my original entry. I will then cut if the trade is invalidated. I do this because mathematically it works for me.


The bottom indicator is the Squeeze. It helps identify breakouts with momentum after a pullback or sideways action. But its the orderflow that's the trigger.



Thursday, 30 November 2017

The Traps in Algo Trading

Creating an algo has a lot of traps. Its a skill, or rather an art, that needs to be learned. There's a lot to do but the end result is worth the effort.

Let me try and list of some of my main "gotchas" that kills the algo even before you start creating it..
  1. "Bad" periodicity that doesn't catch the rhythm of what I want to trade or provides too much noise.
  2. Bad quality data
  3. Too much or too little data. Was the market in 2003 the same as it is now? Or I'm only using 3 months of data on 3 minute time frame so am I curve fiting or catching the right rythm?
  4. Then we have that whole list of biases that impacts our build. Many of them are set out in Aronson's book.
  5. I don't structure the math of the required output correctly. An axample might be that my average trade is so small that the slippage will make live trading a losing proposition. Or the risk reward is wrong. The metrics of your backtesting report is very important.
  6. If I don't do a proper ROBUSTNESS set of tests I'm in a fool's paradise. I say "a set" because there are a lot of them.
  7. And the biggy: What's happening inside the bar. All the trading plarforms make an assumption about what happens within that High, Low, Open and Close.  These assumptions impact the assumed fill or stop loss. Within a 3 or even m Tore, a 30 minute bar, a lot can happen within that bar that is inconsistent with the assumptions that NinjaTrader, MultiCharts or whoever have to make. This impacts results so being able to test what happens inside the bar is important.
All these issues and more can be dealt with in the build and test process but I have to be vigilant that I am keeping to the processes I have created to build algos. Then I put them in portfolios to mitigate any one algo that is at the end of life, but have another on ready to replace it in the portfolio.

Tuesday, 21 November 2017

The Math of Algo Trading

Changing focus from discretionary trading to algo trading requires a lot of work in order to maintain and increase earnings. However, I have a lot of help from the algos to do this.

A discretionary trader may have a daily profit target of, say, $1,000 trading the ES. This may be 6 trades a day of about $45 average trade per contract. In order to duplicate or exceed this $1,000 he would need to make a number of calculations. Below is the stats to an ES algo I am creating to day trade the ES using 3 minute data. It covers a 2 year period, closing trades at the end of the RTH session, slippage and commish of $28 R/T included.



The important things to look at is the average earnings per day, number of trades, how long a trade lasts and how often the algo is in a trade and drawdown. Algos will not usually trade as often as I expect so I need quite a few of them.

The traders risk tolerance per trade then also needs to be defined.

Lets say that the available capital of our hypothetical trader is $50,000.

From all this information the trader would put together a portfolio of at least 3 algos but hopefully 6 algos or more. Looking at the frequency that each algo trades, the goal will be to maximize the use of that $50,000 so that margin is always being used. With the portfolio trader functionality available in many of the trading platforms, the number of open positions can be controlled. Even if more signals are given, the portfolio trading capabilities can stop new signals if the stipulated margin or risk has been reached until positions have been closed by the algo in its normal course of business.

In this way, we can have algos working almost 24 x 5 using the same capital while limiting risk and smoothing the equity curve due to the diversification of using a portfolio of algos.