Formula 301 – #5 Money Management

Money management techniques if used properly can stabilize the performance of a trading system, or even boost the performance dramatically. On the other hand, if used improperly, it will adversely affect the trading system. I am going to discuss the general rules of employing money management orders and demonstrate how to write basic money management that works.

What is Money Management?

Money management is the act of managing open positions in the trading system based on its current profitability, relative performance to other positions taken, or statistical behaviour computed from historical testing.

The principle behind money management is very simple – if we can take the profit before they vanish, and reduce the losses before they grow in size, the system should, in theory, making more money and easier to trade with.

There are 3 basic types of money management rules,

1. Stop Loss
2. Trailing Stop
3. Profit Target

We are going to discuss each type individually.

Stop Loss

Stop Loss is the concept of taking out a position if some predefined level of losses is reached. The predefined level could be a fixed amount of money, a fixed number of points from the entry price point. There are many ways to define the stop loss level. We will leave that for a separate article.

Most stop loss rules are done through the use of stop orders. For example, if you are in a long position, you can enter a simple stop loss order as follows,

LongExitStop (
OpenPositionAverageEntryPrice * 0.9,

LongExitStop is an order placement function. Its general form is,

LongExitStop (condition, price, size, comment)

It places a sell stop order if you have an existing long position and the condition is met. In the condition parameter, we have OpenPositionLong which does not change the requirement of the function. For more complex strategies, you can have multiple LongExitStop orders that you will want to have control over which orders get placed.

You can omit the comment parameter if you do not want one for the order, as in our case.

OpenPositionAverageEntryPrice is a position information function. It returns the entry price of your current position, if your system enter a position with a single entry order. Or, it returns the average entry price calculated from all the trades taken in the current direction.

So, what the formula above does is that it is placing an order to sell the complete position (OpenPositionAbsSize) if the current price dip below 10% of the original entry price.

Here is another example. If you system is currently in a short position, then the following formula,

ShortExitStop (
OpenPositionAverageEntryPrice + 5,

will place a buy stop order at 5 points above the entry price.

ShortExitStop is an order placement function. Here is the general form,

ShortExitStop (condition, price, size, comment)

It places a buy stop order if you have an existing short position and the condition is met.

Trailing Stop

Trailing Stop is the concept of protecting profits of the open position. Usually, a trigger level has to be reached before the trailing stop orders are placed. The trigger level can be a fixed amount of profit, or a fixed number of points from the entry price. Once the trigger level is reached the stop orders are placed to protect certain part of the current profit.

For example, if you are currently in a long position, you can do the following to place your trailing stop order,

LongExitStop (
OpenPositionLong > 0 and OpenPositionBestPriceLevel - OpenPositionAverageEntryPrice > 5,
OpenPositionBestPriceLevel - 5,

OpenPositionBestPriceLevel is a position information function. It returns the best price level recorded since the start of the current open position. If the current position is long, then the best price level is the highest price level seen by the position. On the other hand, if the current position is short, then the best price level is the lowest price level reached since the position started.

So, the formula above will place a sell stop order when the current open position is long and has reached 5 points better than the entry price. The stop price is set to trail at the best price level reached minus 5 points.

If the current position no longer perform and price started to drop, the stop price will get the position out at breakeven.

If the current position keeps improving over time, the best price level will increase, and in turn increase the trailing stop order price level. Say, if the best price level reached increase to 6 points above the entry price, then, the trailing stop order will protect at least 1 point profit for the position.

Profit Target

Profit Target is the concept of taking the profit while it is in your advantage. A predefined level is set and when the level is reached, the system will exit the current position immediately. Predefined level can be anything from a fixed amount of profit, a fixed number of points from the entry price, to particular price level like previous month high or previous trading day high. Usually, profit target rules are implemented by using limit orders.

Here is an example of profit target order for an existing short position,

ShortExitLimit (
OpenPositionAverageEntryPrice - 15,

The above order will exit the current short position once the price has reached 15 points below the entry price.

ShortExitLimit is an order placement function. Its general form is,

ShortExitLimit (condition, price, size, comment)

It places a buy limit order if there is an existing short position and the condition is met.

General Tips in Using Money Management Rules

1. Apply money management code only after the system is showing some form of consistent profitability.

2. Avoid using money management orders whenever possible.

3. It is a known fact that the further away you place your stop loss, the easier you boost the number of winning positions, together with increased drawdown size.

4. It is a known fact that profit target rule can boost profitability significantly, but may not work going forward, unless your profit targeting rule takes into consideration of adapting to current market conditions.

5. By using optimization on money management rules only, it is possible to turn most non-performing trading systems into profitable systems. Such results are not sustainable going forward because it is simply curve fitting the system against the historical data.

Static Value vs. Volatility Adjusted Value

Most beginners design trading systems with static values in their money management rules. You cannot blame them because most software provides such canned money management options so that everyone can optimize their systems to show some form of profitability.

The more appropriate approach is to use adaptive values that changes based on the market condition, not a fixed value chosen arbitrarily by the user or the optimizer.

For example, if you designed a trading system that has a fixed 3 point profit target, it may work in the current price level, but it will not be when the price level has changed to, say, double the current price.

Modifying an Existing System

Another issue with adding money management code to an existing system is that you have to first properly modify the system so that its entries do not change. Otherwise you will fall into the trap of developing a different trading system without even knowing it.

For example, if your system takes oscillator signal when reversing from overbought and oversold conditions, you could have multiple buy signals in a row. If your money management rules take you out of your current position, should your system take on the consecutive signals that follow? In most cases, it is best that you do not let your system re-enter a position in the original direction until after the original system has its position taken out.

An Example

In Formula 301 #3 I showcased a basic moving average system that works consistently as a daytrading system but less so when you hold the position overnight.

Can money management techniques help?

Notice the data we are dealing with is emini S&P over so many years. It ranges from 800 to 1500 which is a huge variation for any static money management rules to work properly. We need something that is more robust to consistently describe our rules.

The technique I am going to use is a volatility based method using average daily range. The reason is obvious, since we are keeping positions overnight, we need to be able to work with the volatility of the daily changes in the emini S&P. All stop loss, trailing stop, and profit target are described indirectly as a fraction of the average daily range.

The script is pretty long, so I am not going to show the script here.

You can download the system here, Moving Average (2 Lines) System with Money Management.

Here is a comparison chart of how the system performs with various money management parameter settings.

formula301 part5 chart

The names I gave to each variation of the money management rules are pretty descriptive so I am not going to repeat them here. One of the more interesting setup is the one with Stop at 0.5 and Target at 1.5 without Trailing Stop. How do we do that? By setting the Trailing Stop Trigger to a very large value, larger than the Target, then the Trailing Stop will never get triggered.

As you can see, money management rules are doing magic to this system.


Proper use of money management rules can certainly boost system performance as we have seen in the example. But I have not included this system in the Trading Systems That Work category. Personally, I will not trade this system because it holds position overnight and has a very low winning percentage at 33%. Nonetheless, It is a good starting point for further investigation.

Discuss this article.

Leave a Comment

Blog Developed
By ContentRobot