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.

Wednesday, 15 November 2017

This is Why I Trade Using Algos Now!

I've written in the past about how the markets have evolved to an algo impacted environment.

The fact that over 60% and perhaps 80% of the volumes of active markets are generated by algos says to me that there are a majority of volume is generated by people who think that nowadays, trading using an algo is more profitable than any other means of trading.

I've been using algos since the early days of SystemWriter,TradeStation and other software back in the 1980s. I embraced algos more as the markets became automated and orders could be input through a computer.

However, it is only recently that the technology has moved ahead to make algo trading a more viable way of trading than discretionary trading.


The chart above is a good day trading one of my DAX algos. I say "one of" because it is important to trade a PORTFOLIO OF ALGOS rather than a single algo. The strength in algo trading is the smoothing of an up-sloping equity curve due to the number of algos in the portfolio.

There is no way I would have made the trades in the above chart had I been trading manually. I don't even have to know what the logic behind the trades were. What I did have to do was to put the algo through a series of about 7 ROBUSTNESS tests before I went live. This doesn't mean that the algo makes money every day because it doesn't. There are plenty of losing days but due to the robustness testing I am confident that a llong losing period is improbable but see my disclaimer.

More posts on the "how to algo" coming.

Thursday, 9 November 2017

Discretionary or Algo: The Choice!

One of my blog readers said:


As a discretionary executor of a systematic pattern (heuristic execution of a high probability pattern)in several markets, I look at these posts with both curiousness and gratefulness.

Curious because, i do not share your inclination towards algos as you do. And grateful because you present things in a lovely, simple and undramatic fashion.

Since 2008, while I have expected discretionary trading to die...something to the contrary has happened - not just to me but 3 other folks that I know of. Our trading, has remained as straightforward as pre - 2008, while remaining completely discretionary.

While patterns have surely changed, it doesn't seem to be less profitable....just different.

What you say is quite interesting to read though, once again thank you for your efforts in making these posts public. They are very illuminating and thoughtful.


I tend to agree. The markets are very different but can still be traded profitably if you know how.



BUT, and there is a big "but", you need to be in front of your workstation for hours to catch the trade(s) that suddenly appear. Markets trade more in swings separated by quieter periods so if you are not there and focused you can miss the trade of the day. Also, covering more than one market at a time is more difficult.


However, there is a better reason for trading algo: capital utilization. If someone has trading capital of, say, $50,000 and is trading as a discretionary trader, they may trade, say, the ES and risk $1,500 a trade. The number of contracts would be related to the risk.


As an algo trader with $50,000, I don't have to sit there, I can trade 23 hours a day but more importantly, I can trade 6 markets each risking $1,500 per trade as the metrics of the portfolio I am trading show me that due to that diversification, my risk allows that. Out of the 6 or 7 markets I will probably only have 2 trades open at the same time. In fact, I can design my algos with that in mind.

Yesterday, my flobot traded the DAX like this:




As you can see, this is quite active trading using 18 minute bars with relatively tight stops.

Wednesday, 8 November 2017

How I Create Algos that Make Me Money!

The question to ask is: " Do algos make money"? Nothing else matters. Either algos make money or they are just another computer game!

This post will show the steps I take to create a profitable algo. Subsequent posts will go on to talk about taking a number of algos and making them into a portfolio as I have indicated in a previous post.

My starting point is to download data for use in one of the applications that can mine the data and create automated trading algorithms without me needing to be a programmer. These programs can take the granular data and create bar sizes through which it sorts to find the optimum bar sizes.

Next, I take my algo creation program and configure it to find the results I want. It's like reverse engineering an algo. I specify the profitability, draw down, percentage profitability, profit factor and a host of other metrics. The Program then mines the data and come up with a few thousand algos from which to choose.


The chart above shows the results of one such equity curve from a data mining effort. The chart breaks the result into 3 sections. 60% of the data was used to train the algo - to find what is profitable. The second section is the result of testing that algo against data that was NOT used in training it. Finally, the third part of the chart shows what would have happened if I had then run that algo in the market.

I pick the equity curves that look the best. The one below is one of the best I've ever created.


The big issue with data mining is curve fitting. Curve fitting is the process of constructing a curve, or mathematical function, that has the best fit to a series of data points

Looking at the metrics that the data mining application puts out allows me to avoid a lot of the curve fitting. I then also run a Monte Carlo Analysis that changes many of the metrics that a selected algo has output so that I can see whether it is too curve fitted and whether it is likely to be robust. The Monte Carlo analysis provides a report as below.


This alone could be enough. However, I also have a program that can do a FURTHER walk forward analysis. The picture below shows a set of results I like of that WFA.


The bottom lines of the chart above show the ongoing re optimization schedule.


As you can see, changing inputs and then looking at the results on unseen data afterwards shows that the algo was pretty robust and profitable. Of course there is an important disclaimer that you should read at the bottom of the blog page. However, my aspiration is that in live trading I achieve between 25% and 50% of the results shown.