Testing, research and upgrade of Mark Fisher's ACD system, trading programs

This program can calculate Points A and C and optimal opening range for the securities you trade. You should have historical data of 1-minute bars for the seciurities for several years, at least 1000 days. The metodology for calculating Points A and C is described in chapter 2 and chapter 4, respectively.

I will repeat here the main points of this calculation. Understanding how the program calculates point A is best done using an example. Suppose the opening range is 20 minutes. Then, if the market breaks the upper border of the opening range, it goes further, say, 7 ticks up, and the low of 10 consecutive 1-minute bars is above the upper border of the opening range plus 7 ticks, then a potential A up, equivalent to 7 ticks, is established. The trade closes at the last minute of the trading day. Only one Point A is allowed during a trading day. Point A can be established to the penultimate minute of the trading day so that closing can be done at the last minute. If potential Point A is established and the market breaks through the opposite side of the opening range by 1 tick, the program closes the trade, simulating stop loss at Point B. Transaction costs are not taken into account. The program sequentially iterates over the breakout level values for potential Point A from 0 to 100 ticks with opening ranges of 10, 20, 30, 40 minutes. Point A corresponds to the breakout level that brings maximum profit for the whole history.

Point C is calculated based on Point A obtained earlier. Potential Point C is established if the market reaches an appropriate breakout level (from 0 to 100 ticks) on the opposite side of the opening range to point A and remains there for half the duration of the opening range. If potential Point C is established and the market breaks through the opposite side of the opening range by 1 tick, then stop loss at Point D is activated. For point C, the same conditions are fulfilled as for point A, namely, during the trading day, only one point C is allowed, and it can be set up to the penultimate minute of the trading day. The program sequentially iterates over the breakout level values for potential Point C from 0 to 100 ticks with opening ranges of 10, 20, 30, 40 minutes. As in the case of Point A, Point C corresponds to the level of breakout, which brings maximum profit for the whole history. Of course, trades generated from points A are not taken into account in the profit.

The program also calculates, together with Points A and C, their range, for example 0-10, 5-15, etc, which brings the maximum profit and avoids random deviations of Points A and C.

As already mentioned, Points A and C are calculated for opening ranges of 10, 20, 30, 40 minutes. The optimal opening range is determined based on Point A because Point A is much more common than point C and tends to be more profitable. The opening range that makes the most profit from Point A is optimal. You can update Points A and C as often as you like using the program. But in fact, updating every six months is enough. Why Points A and C can be calculated based on 1000 days and updated every six months, is explained in chapter 9. The program also calculates the accumulated profit and the average profit per trade, which will let you know if the ACD system is profitable for the securities you trade.

When you run the program, it will ask you to enter the security code and its step (minimum price change). The security code must match the name of the history data file. The calculation results will be in the file acd.csv. An example of such calculation for several Russian securities you can see in Table 1.1. Let’s look at the results for SBER stock. The highest profit from Point A is with 30-minute opening range (23294 ticks) which is optimal. Profit from Point C is low due to small number of trades and sometimes even negative. This is why it is better to determine optimal opening range based on Point A.