Money Management Algorithms

The Money Management Algorithms are a tool that we began developing in 2005 with the first revision finally completed in 2011. We continue to research and upgrade this tool as an open code solution. It is a “trading system for a trading system” and also known as also known as the Equity Curve Algorithms.

​The Money Management Algorithms were developed out of necessity to answer “What If” questions that simply could not be answered by any other trading systems software tool for both backtesting and automating strategies in live trading.

The Money Management Algorithms can be applied to individual trading systems and the ideas and concepts that have been learned from the Money Management Algorithms have been used to develop the Trading System Portfolios.

2023 Updates coming soon

The Money Management Algorithms are originally developed as an individual trading system tool that allows an overlay of different technical analysis techniques and market indicators to be applied to the equity curve of the original strategy to decide when to trade the strategy. Applying different Money Management Algorithms to different trading systems and then combining them into a portfolio would become a multi-layer, over optimized setup. We have never used this concept to design our trading system portfolios. This concept has only been applied to individual systems trading. The concepts learned from the Money Management Algorithms have been applied to the portfolio’s combined trading systems equity curve on an end of day basis. 

In 2023, portfolio management tools using the Money Management Algorithms software will be developed to manage the combined trading systems equity curve intra-day. The software structures in the Money Management Algorithm have the capability to generate the combined real time intra-day equity curve for multiple trading systems that can be looped back into each individual strategy. This will allow all strategies to essentially “see” each other. The base set of strategies will runs in multiple windows without automation to generate the original equity curve while the strategies are then duplicated once again with the addition of the combined equity curve for all strategies. Money Management Algorithm rules can then be applied using specific intra-day rules such as Portfolio Stop Loss, Portfolio Profit Target, Start After Drawdown Levels Amount X, etc.

The Original Version - My First revision

When I first started developing the Money Management Algorithms, back in 2005, I would export the trade information directly such as Marketposition, Open Equity, and Closed Equity directly from the strategy, using an indicator, to a text file. I would then import this information into a new chart window that included my original strategy plus the text file as a sub data series. I could modify my original strategy code to look at the trade information that was setup as a sub data series.

This approach was a nightmare to implement when trading multiple strategies on an intra-bar basis. Updating 10+ strategies with exported data files and re-importing into a new window and then checking the signal was a slow process, which was too slow to implement in live trading..

I could test the concepts to see that they were valid but implementing them on intra-day charts was not realistic.

Here is the problem

The problem with writing an equity curve algorithm rule within your original strategy is simply the fact that once you turn the strategy off, based on your equity curve rule, it does not continue to generate an equity curve that can be tracked. We want to track the equity curve in it’s purest form as a simple market analysis based strategy without equity curve rules so that equity curve rules can be applied separately.

The money management algorithms watch the original strategy trade in SIM mode and select which LIVE trades to take based on the criteria that it is given based on the research and method you have selected from back testing the setup before LIVE trading.

In the video we show a simple code set for stopping on a drawdown. Once we stop,, there is no way to know how the strategy is doing. We can blindly start the strategy after a certain period of time but that is “shooting form the hip”. What if the strategy continued to under perform while it was turned off?

How Does It work?

The problem with writing an equity curve algorithm rule within your original strategy is simply the fact that once you turn the strategy off, based on your equity curve rule, it does not continue to generate an equity curve that can be tracked. We want to track the equity curve in it’s purest form as a simple market analysis based strategy without equity curve rules so that equity curve rules can be applied separately.

The money management algorithms watch the original strategy trade in SIM mode and select which LIVE trades to take based on the criteria that it is given based on the research and method you have selected from back testing the setup before LIVE trading. 

In the video we show a simple code set for stopping on a drawdown. Once we stop,, there is no way to know how the strategy is doing. We can blindly start the strategy after a certain period of time but that is “shooting form the hip”. What if the strategy continued to under perform while it was turned off?

The Rules

It is critical to understand that the Money Management Algorithm Rules are a tool that is used to analyze the equity curve of your trading system to help you manage your money. It is a trading system for a trading system. There are 12 basic rules that we discussed in detail below. The 13th Rule is based on the Martingale Rule for well capitalized traders.

These concepts may be new to you but they are fairly basic ideas that we have shared over the years. The actual setup is the real challenge and having the open code is the real benefit since you will be able to customize the Money Management Algorithms with any new ideas that you have once you understand the structure.

Each individual rule is discussed below. When you setup the Money Management Algorithms, keep in mind, you can select any combination of rules. While we do not recommend using more that 2 or 3 in most cases, there are literally 1000’s of different solutions. An optimization algorithm is also included so that you can officially test the individual money management algorithm rules.

The type of questions that we wanted to ask and answer were:

1.) What happens if you stop trading on a drawdown and then start again on a runup?

2.) What happens if we wait for a drawdown to start trading and then stop on a runup?

3.) Can we apply indicators such as Moving Averages, RSI, and Stochastics to the equity curve to time our trading periods.?

4.) Can we look at the cycles in the average trade profit statistic to start and stop trading a strategy?

5.) Can we look at the original entry and then wait for a pullback to get in on a better entry?

These are just a few example questions that can be answered with the Money Management Algorithms. In order to answer these questions, the original strategy has to continue to generate trades while the algorithm decides which one of those trades to take.

In theory these ideas could be tested in spreadsheets and manually implemented (the way I tried to originally set it up in 2005). In the fast paced world of trading and markets, it is difficult to manage it. In the process, precision is lost and technical errors made it impossible.

A basic solution that includes programming stop losses directly into a trading system based on time periods such as stopping on a drawdown and then starting on the new month can be implemented. If “stop trading” based on a daily, weekly, or monthly drawdown is programmed directly into a trading system, then the base equity curve is no longer being generated. The idea of starting once the equity curve turns higher is not possible since the equity curve is no longer being generated in the original strategy.

The Money Management Algorithms are the only tool I have found (and developed) that can accurately backtest ideas based on tracking a continuous equity curve and then selecting when to start and stop trading. The same setup that is used to backtest these ideas can then be automated in live trading and used to manage your trading system.

 

The Money Management Algorithms are the only trading systems software tool that I have found that will allow real-time analysis and automation of the equity curve and the ability to apply money management algorithms. 

DLL’s are used to pass trade information between charts. The base trading system signal is generated in one chart window. The information from the based strategy is then passed to a second window that has a strategy that uses the original rules in addition to the equity curve management rules.

Our equity curve money management strategies currently include Thirteen different equity curve strategies (8,192 combinations):

    1. Close Trade Moving Average – Trade the strategy only if the two period moving average of the original strategies closed trade equity curve is up.
    2. Close Trade ADX – Trade the strategy only if the ADX of the closed trade equity curve is above the ADX Threshold.
    3. Closed Trade Stochastic – Trade the strategy only if the Stochastic of the closed trade equity curve is above the Stochastic Threshold.
    4. Closed Trade RSI – Trade the strategy only if the RSI of the closed trade equity curve is above the RSI Threshold.
    5. Average Trade Profit – Trade the strategy only if the Average Trade Profit of the last 10 trades is with the specified average trade profit range, typically above 0.
    6. Better Entry Price – Improve entry efficiency by entering at better prices by looking at the base strategies marketposition and entry price and placing limit orders to improve on that price by a specified dollar amount.
    7. Drawdown Stop – Stop trading the equity curve if it goes into a pre-defined drawdown (set as an input) and then start trading if it goes into a run up of a pre-defined amount from equity valley lows.
    8. Open Trade Drawdown Start I – Require the Drawdown to be greater than the Average Drawdown of the last 100 bars.
    9. Open Trade Drawdown Start II – Require the Drawdown to be less than the Average Drawdown of the last 100 bars.
    10. Open Trade Moving Average – Require the open equity curve two period moving average be up.
    11. Open Trade RSI – RSI of the open equity curve of the last L1 bars be greater than the RSI Threshold.
    12. Dip Buying Entry – Enter the strategy on a drawdown by “buying dips” of a specified amount/input.
    13. Consecutive Losers Algorithm – lets us start after a specified number of losers.

 

Money Management Algorithm Inputs