Adapting to changing market volatility with a statistical position size table

We know that prices can go up or down. We also know that the quality of these ups and downs can be very smooth or very choppy. As such, it's not surprising that the trend and volatility of a market form the two universal characteristics of a price action. No matter which market you trade, the trend and volatility of the prices will influence your trading and P&L. That can be both good and bad as volatility is a double edged sword. A fast paced moving market can rain down gold on you or it can burn your cash away. Most of the time, it's the latter case. Consequently, there are many ways traders adapt to changing volatility in the market. You can tailor your trading strategy, change trading timeframe, switch market entirely, or manage your risk accordingly, for examples. In this post, I'd like to give an example for the use of a statistically-derived forex position size table to fit with market volatility. The problem with market volatility is that it's hard to notice. As opined by Dr. Steenberger, "many traders will adapt to directional changes quicker than they adapt to shifts in volatility." The art of identifying market conditions is not discussed in this post. But obviously, if there is a way to build in an inherent way to manage your risks based on market volatility, you will have built yourself a safety net. That is the logic behind my statistically-derived forex position sizer. It's a data-driven tool to impose an inherent safety net in your trading. What it does is simple. Here's what it boils down to:

  1. It finds the recent 2 sigma value (i.e., a statistical measure of volatility, see wiki) of each major currency pairs.
  2. It calculates the maximum position size for each pair using the 2 sigma value.
  3. Then it converts the number to correspond with your account currency based on a real-time currency exchange rate for each trading pair.

Thus, a table such as this one I published for forex can give you a real-time guideline to the maximum position size you should take given your risk appetite. One shortcoming with this approach is that while you may limit your loss during a volatile market, you are also limiting your potential gain. But this is where the old saying, "let your profit run and cut your losses short" applies. One solution is to simply add to your winning trades, according to your trading setups, of course. That way, when the market moves in your favour or you get confirmation on your setup, you can increase the position size responsibly without stretching your principal. By now, it's probably obvious that the use of such a tool is not, and should not, meant to be a solution to changing market volatility. It is merely a convenience tool to serve as one of the many that a trader has at his/her disposal. Nevertheless, I find the table to be very convenient for me because I don't have to worry about calculating the position sizes manually on each trade. Trading is tough enough already, so I like to develop tools that can make my life ever so slightly easier.

many traders will adapt to directional changes quicker than they adapt to shifts in volatility

My thoughts and goals on automated trading a year later

In 2008, I spent a few good months developing strategies in TradeStation full-time for the index futures. Now after a full year of break in development, I am starting to devote more and more time in quantitative finance research again. In hindsight, the biggest shortcoming with my previous strategies is that they are not discriminating enough. Using an analogy from robotics (my specialty), some of the most basic robots are great because they can do one task, and one task only, especially well. Those developers that are too ambitious in trying to conjure a jack-of-all-trade robot typically fail miserably. Our current technology simply isn't sufficient for anything more than a specialized automation. Much is the same in developing automated trading. With my limited resources and skills, my goal is to build simple automated systems that can do one job only and do it damn well. Once that can be achieved, it's only a matter of concatenating all these individual systems to exploit more and more opportunities. Therefore, the new plan which I'll follow for development are:

  1. Identify a recurring profitable scenario in the market
  2. Isolate the conditions which would yield a high probability of such scenario happening
  3. Program the findings into my platform
  4. Run backtests to calculate the expected profit (probability * reward/risk)
  5. Tweak and debug

Ultimately, remember this: It's not a matter of the number of trades you take, it's a matter of being as picky as you can in only playing the best of the best trades you can find.

Starting to use MatLab for quantitative finance

After trying TradeStation, Ninja Trader, and RightEdge for trading, I've gone back to my engineering root and is starting to explore with MatLab as my quantitative finance tool and eventually as my platform for an automated trading system.

I gave up on TradeStation last year because it just didn't fit my style. Then I gave both Ninja Trader and RightEdge a quick spin (a few days) and found that I need to learn C# to really make use of them. After procrastinating for a couple of months in learning C#, I realize I don't have the time to learn a new language just to start working on a quant tool.

So after some wandering, I stumbled upon MatLab again. In particular, I found out that there's a Financial Toolbox in MatLab that seem to have many of the basic functions that I need. Furthermore, people have used MatLab as an automated trading platform. Since I've been using MatLab as an engineering tool for several years, I wouldn't have to start learning from scratch. Furthermore, because of its academic popularity, there are many existing analytical functions which I can build my future work upon.

Isn't it silly of me? I really should have considered MatLab earlier because it's so well known. I've just always associated MatLab as an analytical tool but never thought that it can be used as an automated trading platform too.

Anyway, my short term plan is to brush up on my MatLab by playing with the financial tools and trying some basic stuff up. I have scheduled 8:00 - 9:00 pm every night to do this with another 10 min afterward to write a brief lesson summary. Let's see how this goes.

4 automated trading development platforms for beginner to advanced traders

Over the weekend, I've dug into a few more automated trading development platforms. There are certainly many out there. This condensed comparison is based on my own experience, online research, or reading through their documentation. I only included the ones which I find to be the best for each different level of independent developers. We'll start with the most basic and work our way up the food chain.

TradeStation

Pros: Easy to learn and implement. Large Community. Cons: Legacy system. Require work-arounds for complex functions.

Who I think it's for: Algorithmic, technical analysis (traditional indicators) trader. Light to no programming background.

www.tradestation.com

Ninja Trader

Pros: Free for development use. Modern GUI. Use of major programming language, C#. Good documentation and support.

Cons: Performance on the slow side. Proprietary API. Possible stability problem.

Who I think it's for: Medium to high programming background. Low cost (free to develop or \$50/month for trading), good for independent developer that has a long development time.

www.ninjatrader.com

OpenQuant

Pros: Good framework. Well built piece of software. Capable of advanced techniques. "Lite" version of professional quant software by QuantHouse.

Cons: Only 1 month of trial period. Documentation and support seems lacking.

Who I think it's for: Good to Advanced programming skills.

www.openquant.com

Alphacet

Pros: Latest and greatest. Codeless development capability. Faster concept to deployment time.

Cons: Cost a fortune. Not tailored for independent developer.

Who I think it's for: Really experienced ATS trader with deep pockets.

www.alphacet.com

←   newer continue   →