Essence of Trading: Applying The Concept of Refactoring To Trading

iStock_000014882807XSmallWe often hear our peers learning a new trading technique here, finding a new reliable trading setup there, etc. We seldom hear anyone saying that they refined their techniques and reduced the workload. I have to wonder why because having more tools is not necessary better in terms of analysis efficiencies or performance.


In computer programming, there is this concept of refactoring. In short, huge computer programs are often built over a long period of time, thus having a lot of useless and/or repeated code everywhere. By taking time to review and then recombine the redundant code fragments into organized libraries and structure, it will improve the manageability of the program code over the long run. It will also often improve the efficiency of the program and allowing more features to be added in the future without introducing a lot more bugs.

Think of your house – can you really find a particular tool if you have not intentionally organized all tools in a toolbox where you can find easily? If you simply leave your tools lying around everywhere in the house, you may still be able to find the screwdriver you have used 6 months ago. But what able the hammer you need right now that you have not seen in past 2 years? You know you have placed it somewhere in the house, you just do not know exactly where to locate the damn thing.

In daytrading, refactoring is very useful for discretionary traders. It is next to impossible to manage each and every trading setup when they are handled separately. You will have to remember every detail for each and every one of them so that you will not pull your trigger incorrectly. Worst yet, you somehow merged the techniques together because you have mixed up some key factors in your head as you are making your trading decision in compressed time.

Sounds familiar? Of course. Because it happens to everybody.

So what are we suppose to do to reduce the complexity in our decision making processing so that we can perform better?

Basic Reduction Strategy

Here is what I do whenever I add some new filters and/or trading setups,

1. Separate the trading setups into simpler components

2. Classify each components into categories like filters, buy/sell price patterns, support/resistance zones, and triggers

3. Automate the ones that can be done mechanically

4. Automate at least part of the decision making process

5. When looking to pull the trigger, I just need to know what’s left to figure out, not reconfirming everything every time.

You will be surprised how many trading setups after breaking them into smaller parts that you would end up with many similar components you can easily group together. This exercise also helps you clear your thoughts, organize your engagement rules and reduce the decision making process to something easier to work with.

If you are not good at programming, it is not a problem. It is not necessary to automate the tasks fully. You can always use the trusted pen and paper method – a checklist. It is what quality control do in factories or engineering firms – organize the components into a prioritized checklist. It will do the same thing, just that you have to check through all the items in sequence every time which takes a lot of discipline to do.


Here is an example. Say you are a trader who use moving averages for trend, support/resistance for price level and oscillator divergence as signal. Now you want to reduce and organize the trading method to something more manageable. Following ideas may be useful,

1. If you trade only in the trend of a higher timeframe, then have the higher timeframe trend definition clearly defined and set it up as a filter telling you if it is ok at the moment to go long, short, or do nothing.

2. If you do not use the higher timeframe moving averages for any other purpose, then do not keep the chart on the screen. It will only confuse you.

3. If you only act when price is near certain support resistance area. Then setup alerts telling you price is entering or exiting those zones.

4. At this point you can sit down and relax most of the time until your alert is triggered.

5. When the alert is triggered, take a look at the filters. If the pre-conditions are not lining up yet, just stop at this point and relax. Do not look for the trigger pattern at all.

6. Only when the pre-conditions are lined up, then you focus on the trigger timeframe to see if your trigger pattern has happened (in this case the oscillator divergence).

Time saved. Stress reduced. And likely better performance.

Leave a Reply

Your email address will not be published. Required fields are marked *