: 0 , 2 :

:
:   : 2005-09-09 09:58
: (0)   :

more detail at http://www.traderclub.com

This system is provided free to people who join the System Traders Club. It is a profitable Bond Trading System that we supply in order to demonstrate the quality of our work, and as an example of the documentation that comes with each of our systems.

Gary Randal mailto:Randall_Gary@tmac.com has ported this system into MetaStock format. His comments and code for MetaStock follow our normal system Documentation. A Rrade by Trade Report concludes the document


"25 x 25" BOND TRADING SYSTEM
by Charles LeBeau and Terence Tan

Introduction

In this report we will present several useful concepts for trading the Bond futures markets, and illustrate these concepts with a Bond trading system that we have called the "25 x 25". The "25 x 25" system is a long-only trend-following system designed for the Bond market which has made hypothetical profits of $53,000 over the last 10 years of historical data, with an accuracy rate of 76%.


Aims of the System Traders Club

Before we present the details of the system, we will review some of the goals we hope to achieve for the System Traders Club.

First, we do not hope to reveal any "holy grails" to trading. Many of the systems that you will see in the System Club reports include indicators that you may already be familiar with, or that can be easily programmed into the computer. In addition, you will find that many of these systems are not perfect: they will all have drawdowns, and none of them are 100% accurate over the long run. However, we think they deserve serious consideration for actual real-time trading applications. We realize that in the business of trading the futures markets there is no single method that makes money automatically. We believe that a combination of logical system concepts and reasonable entry and exit strategies greatly increases the probability of success in trading. We hope to be able to communicate to you, through these reports, many of the concepts that we have learned over the years.

Second, we hope that these reports will serve both an informative as well as a practical purpose. We will share with you lessons that we have accumulated over the years regarding trading strategies and techniques that have worked in various markets, and the logic behind them. You may also want to view the systems presented as illustrations of general principles and concepts in systematic trading of the futures markets. We hope that you may also apply these concepts to your own favorite markets and time-frames. We would welcome any feedback you may have on possible improvements and different applications of these systems.

Third, we intend to provide many different systems and market combinations in our reports. Multiple systems can be combined together in a portfolio to generate more frequent trades and higher returns than any single system. We believe in diversification; but we also realize that diversification is a function of personality and preference. For this reason, we will be offering many different types of systems, from which you will be able to select systems that suit your personality and preference and combine them into your own diversified trading portfolio.


"25 x 25" System Rules

We will concisely present the system rules first, and then elaborate and explain the concept and logic behind some of the more important trading techniques represented in the system:

To go long in the Bond market, three conditions must be met.

1. The 14-day +DI must be above the 14-day -DI.

2. The 14-day ADX must be above 20.

3. The 4-day RSI must be below 50.

If these three conditions are met then buy tomorrow only if and when prices rise 18 ticks (18/32) above today's close. Enter on a buy stop order.

After a trade has been entered, place a sell stop at whichever of the positions below are closest to the market price.

1. A stop order at $2,500 below the entry price.

2. Or a stop order at the lowest low of the last 25 days.

3. After 25 days (count entry day as day 1), change stop #2 from the lowest low of 25 days to the lowest low of 2 days.

4. Regardless of the number of days in the trade, after any close where the open profit is greater than 5 Average True Ranges the exit stop should be at the lowest low of 2 days. (Important: use 45 days to calculate the ATR)

Historical Results

Table 1 shows the historical results of trading 1 contract on the system tested over 10 years of data. For the testing purposes, we used continuous back-adjusted daily data. We ignored all night sessions, and all calculations were based on day-session prices and ranges only. $100 was deducted from every trade to simulate the effects of commissions and slippage. The test period was from 1/1/88 to 1/16/98 with MaxBarsBack set to 50 to enable adequate smoothing on the ADX calculations. (MaxBarsBack refers to the number of bars of data necessary to calculate the rules in a system. System rules only begin after the MaxBarsBack period. The test period includes the MaxBarsBack period, so that no trades are taken for the first 50 trading days.)


Table 1. 25 x 25 System v.2.0 Hypothetical Results (TradeStation format) This system was created originally for Tradestation and then interpreted into MetaStock Format by one of our members. We do not have MetaStock reports.

Total net profit $ 55,112.50 Open position P/L $ 1,875.00
Gross profit $ 64,887.50 Gross loss $-9,775.00

Total # of trades 32 Percent profitable 72%
Number winning trades 23 Number losing trades 9

Largest winning trade $ 5,181.25 Largest losing trade $ -2,600.00
Average winning trade $ 2,821.20 Average losing trade $ -1,086.11
Ratio avg win/avg loss 2.60 Avg trade(win & loss) $ 1,722.27

Max consec. winners 5 Max consec. losers 2
Avg # bars in winners 26 Avg # bars in losers 12

Max intraday drawdown $ -3,381.25
Profit factor 6.64 Max # contracts held 1
Account size required $ 3,381.25 Return on account 1,630%

The hypothetical performance data above was generated using Omega TradeStation, with $100 deducted per trade for commissions and slippage. In our opinion, the "account size required" and "return on account" calculations may not accurately reflect the actual account size required to trade this system nor the return to be expected.


PAST PERFORMANCE IS NOT NECESSARILY INDICATIVE OF FUTURE RESULTS.

HYPOTHETICAL OR SIMULATED PERFORMANCE RESULTS HAVE CERTAIN INHERENT LIMITATIONS. UNLIKE AN ACTUAL PERFORMANCE RECORD, SIMULATED RESULTS DO NOT REPRESENT ACTUAL TRADING. ALSO, SINCE THE TRADES HAVE NOT ACTUALLY BEEN EXECUTED, THE RESULTS MAY HAVE UNDER-OR-OVER COMPENSATED FOR THE IMPACT, IF ANY, OF CERTAIN MARKET FACTORS SUCH AS LACK OF LIQUIDITY. SIMULATED TRADING PROGRAMS IN GENERAL ARE ALSO SUBJECT TO THE FACT THAT THEY ARE DESIGNED WITH THE BENEFIT OF HINDSIGHT. NO REPRESENTATION IS BEING MADE THAT ANY ACCOUNT WILL OR IS LIKELY TO ACHIEVE PROFITS OR LOSSES SIMILAR TO THOSE SHOWN.


System Concept

The concept behind the system is simple. We designed 25 x 25 to be a trend following system that will enter an uptrend during a dip in prices. To do this we will implement three entry strategies. First, there is a trend indicator to identify a strongly uptrending market. Second, there is a shorter term retracement indicator that will identify a small dip in the uptrend which will set up the trade. Third, we have a precise short-term entry signal which will enter the trade when the uptrend resumes.


Trend Indication

For the trend indicator, we employ one of our favorite trend indicators, the Directional Movement Indicator. Specifically we will use the relationship between the +DI (Plus Directional Indicator), -DI (Minus Directional Indicator), and the ADX (Average Directional Movement Index). These indicators were described by Welles Wilder in his book, New Concepts In Technical Trading Systems, and are pre-programmed into most of the modern computerized charting software. The default value chosen by Mr Wilder was 14-days for all the indicators, and this is the value we have chosen for the system.

For our trend indication, we will require that the 14-day +DI must be above the 14-day -DI, and that the value of the ADX must be above 20. The relationship of the +DI to the -DI is a useful way of determining the direction of the intermediate trend; however this definition of trend is inadequate without the inclusion of the ADX which actually measures the strength of the trend. Trend indicators traditionally only indicate whether the trend is up or down, which is not an accurate representation of how the market behaves. As you are aware, markets spend most of their time neither in an uptrend or downtrend, but in a sideways market. By demanding that the ADX be above 20, we effectively filter out these sideways markets, and enable our system to enter during periods of relatively strong uptrends. It is important to understand that the ADX does not indicate the direction of the trend, merely its strength, which is why we need to combine the strong ADX reading with the DI relationship.

As a general concept it is a good idea to always trade markets according to the direction of the intermediate trend. For instance, with our trend indicator installed, the 25 x 25 system made $53,000 over 10 years with an accuracy of 76%, and had an average trade of $1,829. This indicator included a requirement for the ADX to be above 20.

To assess the impact of an uptrend in trading the Bond market from the long side, we eliminated the ADX requirement and reversed the rules of the system so that it only took trades when the +DI was below -DI, indicating a downtrend. The results are illuminating: trading the Bond market with all the same entry signals but during a downtrend as defined as -DI being above +DI produced losses of $781 over 10 years of trading, with a dismal accuracy of 29%, an average trade of -$6, and a drawdown of $25,000! You clearly do not want to be buying the Bond market using this technique in an intermediate downtrend.

We have mentioned the value of the ADX value in assessing the strength of the uptrend. To see the impact of the ADX value, we re-tested the system to see how it would perform if the ADX were below 20 while maintaining the requirement for the +DI to be above the -DI. When the ADX is below 20 in a prevailing uptrend (as defined by the +DI and -DI relationship), the system only made $8,900, was only 47% accurate, and had an average trade of only $595 and a drawdown of $6,500, a significant deterioration of results. We conclude that an uptrend indication on a trend indicator such as the DI only gives average results; however, combining the trend indicator with an ADX value is significantly superior because the ADX level serves to filter out periods of sideways markets.


Retracement Indicator

The second indicator we have adopted is the 4-day RSI (Welles Wilder's Relative Strength Index) which we use to identify a short-term dip in the market prices during the prevailing uptrending Bond market. We use the RSI because of its popularity and inclusion in most charting applications. Mr Wilder described a longer-term RSI, and our choice of a 4-day RSI reflects our design intention of identifying short-term retracements that would set up high probability trades. The RSI oscillates between a minimum and maximum value of 0 and 100. When the RSI declines to below 50 (the midpoint), we have defined a short-term decline in the market.

Does the short-term decline, as measured by the 4-day RSI falling below 50 actually make that much difference to trading this market? To study the difference, we ran another test on the system with the exact same rules, but eliminating the 4-day RSI rule. The tests over 10 years of data showed a profit of $22,400 over 51 trades, with an accuracy of 51%, an average trade of $440, and a drawdown of $9,200. The results are striking: by eliminating the retracement indicator and entering the markets at any point during an uptrend, the system makes less than half of the profits made when entering on a short-term decline. The average trade declined to less than 25% of the average trade when entering during a retracement! ($440 as compared with $1,800). We concluded therefore that in an uptrending Bond market, waiting for a short-term decline or dip in prices to set up a long trade is preferable to entering the trend on strength.


Entry Trigger

With the +DI, -DI and ADX rules in place, and a short-term market decline measured by the RSI, we have identified a market situation that is highly bullish. What we require next is a very short term indicator that will get us into the market. In our opinion, this particular indicator is the least important. It only serves to time our entry a bit more precisely. In fact, our tests show that you could ignore this entry trigger, and just enter the trade on the opening of the next trading day after the ADX and RSI setups are present, to get a profit of $49,600 over 10 years and 57% accuracy with an average trade of $974, a drawdown of $6,000, and a profit factor of 2.63! Entering on the open would have traded 51 times over the last 10 years, significantly more than the 29 trades with our 18-tick entry rule.

But entering on the opening after a decline has its difficulties, especially if the market continues to decline. on a psychological level, many traders (including us) are more comfortable knowing that the market is moving up in the direction of the trade before entering the position. Hence the logic of our entry trigger: to wait till the market proves itself by rallying 18 ticks from the previous day's close before we enter the trade. This is a significant rally, but forcing the prices to rally significantly before entering enables the system to produce a much higher percentage (76% over 10 years) of winning trades.

There is no particular magic about the 18-tick number. In fact to test the robustness of this entry parameter, we ran a series of tests using the same entry rules, and varying the entry trigger from 2-ticks to 36-ticks above the closing price. The results are presented in Table 2 below.

The most significant fact of the optimization is that all the tests are profitable, which is a good indicator of a parameter robustness. Significantly also, all tests have large average trades exceeding $1,000 per trade, and all tests show profit factors better than 2.50, and no drawdown on any test is greater than $6,000. It probably does not matter how many ticks above the close you decide to take for the entry point. As mentioned previously, even blindly entering on the opening is profitable over the historical data. Also, we could trade more frequently if we acted on smaller moves above the previous close, but we would expect to have a lower percentage of winners. For instance, we could have chosen a smaller move of 8 ticks above the close to get a profit of $52,500 on more trades (40 trades), but with a lower accuracy rate (68%) and a slightly higher drawdown ($5,600). Since all tests are profitable, if a trader wishes to deviate from the published system, we will leave it up to the individual trader to decide which profile of trades bests suits him.

Table 2. Optimization Results on Entry Trigger Parameters

Ticks Net Profit Avg Trde PFact MaxDD #Trds %Prft

2.00 54712.50 1189.40 2.93 -5168.75 46 61
4.00 54087.50 1175.82 2.95 -4825.00 46 59
6.00 48475.00 1101.70 2.66 -5606.25 44 61
8.00 52562.50 1314.06 3.39 -5668.75 40 68
10.00 48575.00 1278.29 3.39 -5731.25 38 68
12.00 49300.00 1332.43 3.72 -5793.75 37 70
14.00 51375.00 1467.86 4.69 -3881.25 35 71
16.00 48837.50 1575.40 5.40 -4256.25 31 71
18.00 53068.75 1829.96 7.17 -3381.25 29 76
20.00 46100.00 1589.66 5.01 -4037.50 29 72
22.00 46700.00 2030.43 7.64 -4100.00 23 78
24.00 46362.50 2107.39 8.66 -4131.25 22 82
26.00 39306.25 1871.73 6.11 -4193.75 21 76
28.00 30787.50 1620.39 4.71 -4256.25 19 68
30.00 15343.75 1022.92 2.52 -4318.75 15 60
32.00 17637.50 1356.73 3.05 -4381.25 13 62
34.00 16400.00 1490.91 3.02 -4443.75 11 64
36.00 12281.25 1228.13 2.50 -4506.25 10 60


Testing the Entry Technique

Often, when we want to study the effectiveness of an entry technique by itself, we do optimization tests on the entry technique and exit simply at a close X days in the future. This often gives a good indication of the profit potential of any entry technique. The percentage of winning trades is a good indication of the efficiency of the entry technique. Table 3 below presents the results of the entry technique described above, and exiting at the Xth close after the entry. These tests do not include any money management stops or any other risk-management strategies.

Notice that all exits were profitable except an exit on the first close, which amounts to exiting on the close of the day of entry. You certainly do not want to be day-trading with this trend-following technique! Notice the high accuracy rates of 85 to 90% when the trade is held 20 days or more. For instance, if you exited each trade on the 22nd close, you would make $54,800 with a 91% accuracy rate and a drawdown of less than $5,500! And this is accomplished without any stop! We can conclude that this entry technique predicts,with almost 85 to 90 percent accuracy, a resumption of the trend that lasts between 20 to 25 days


Table 3. Results of the Entry Technique and Exiting on Xth Close.

X NetPrft AvgTrd PFact MaxDD #Trds %Prft

1.00 -412.50 -5.81 .96 -3900.00 71 45
2.00 2506.25 36.32 1.15 -4243.75 69 51
3.00 3231.25 51.29 1.18 -5493.75 63 52
4.00 9562.50 173.86 1.75 -4781.25 55 64
5.00 14925.00 287.02 2.30 -4043.75 52 63
6.00 21343.75 426.88 3.21 -3518.75 50 66
7.00 24650.00 535.87 3.05 -4056.25 46 65
8.00 31350.00 712.50 3.77 -3650.00 44 73
9.00 22481.25 522.82 2.73 -4212.50 43 60
10.00 21325.00 495.93 2.49 -5337.50 43 58
11.00 21418.75 498.11 2.51 -6431.25 43 63
12.00 27868.75 679.73 3.34 -4687.50 41 66
13.00 24187.50 604.69 2.73 -6081.25 40 63
14.00 19731.25 519.24 2.04 -7181.25 38 58
15.00 20768.75 561.32 2.11 -7393.75 37 70
16.00 25737.50 695.61 2.58 -7050.00 37 68
17.00 37000.00 1057.14 4.49 -5468.75 35 71
18.00 40631.25 1195.04 4.75 -5468.75 34 74
19.00 46162.50 1357.72 6.23 -5468.75 34 79
20.00 52793.75 1599.81 7.52 -5468.75 33 85
21.00 57168.75 1732.39 8.29 -5468.75 33 85
22.00 54862.50 1714.45 7.92 -5468.75 32 91
23.00 56618.75 1826.41 9.00 -5468.75 31 90
24.00 53318.75 1838.58 8.27 -5468.75 29 90
25.00 56168.75 2006.03 7.45 -5468.75 28 86
26.00 54075.00 1931.25 6.01 -5468.75 28 79
27.00 52325.00 1868.75 6.45 -5468.75 28 79
28.00 51043.75 1822.99 6.83 -5468.75 28 75
29.00 47893.75 1773.84 5.92 -5468.75 27 78
30.00 47581.25 1762.27 6.38 -5468.75 27 78



The Exit Techniques

For the exits we have included a $2,500 money management stop, which attempts to limit the worst possible loss sustainable on any particular trade. We are always most comfortable trading with stops that will limit the maximum dollar loss on any trade, although we realize that this protection may be limited if the market gaps against the position overnight. We have chosen $2,500 as the dollar-stop in this system. This is a large stop designed to avoid whipsaws, and it has only been hit once in the last 10 years. In spite of the fact that this stop is rarely triggered we believe it is essential and its presence makes us comfortable. We recommend dollar stops on all systems to protect against catastrophic losses.

The second exit strategy is a common one: the channel low exit. In this case we have chosen the low of the last 25 market days. Again, the exact number of days is probably unimportant; the concept of trailing a stop at a low point in the market is very popular and has been used successfully by market technicians for a long time.

If we merely installed the $2,500 dollar stop and the 25-day channel low exit, the system makes $43,000 over 10 years of trading, with 18 trades. The average bars in winners is 67, which is a relatively long period, and the average bars in losers is 14, showing that the trailing exit effectively cuts losses short and lets profits run. The system is 67% accurate, and has a huge average trade of $2,400. The ratio of average win to loss with this exit is 3.78.

While this variant of the system is profitable and tradable on its own, it suffers from several disadvantages: Firstly, it holds trades for a very long period. To take a profit on a winning trade, a trader would have to hold through an average of 67 days. This may not be psychologically appealing for many traders. But secondly, and even worse, the exit is inefficient in that it frequently gives up large amounts of open profits, since it always requires the market to reverse to a 25-day low before signalling an exit. We have frequently seen trades give up one-third, or half, or all of their open profits before exiting a trade on a trailing channel stop. In addition to suffering a "roller coaster" sensation while waiting for a profitable trade to retrace to a 25-day low, many winning trades could turn into losses because of the slow exit. This would not make us comfortable in spite of the potential profits.

A simple twist to the exit strategy allows us to reduce the number of days in the average holding period, increase total profits, increase the accuracy to 72%, and trade more frequently. The technique is this: we will wait patiently for a trade to develop over a specific number of days, using the conventional dollar and channel stops, and then switch to a tighter channel stop to effect a quick exit. Specifically, we will install the 25-day channel low exit for the first 25 days of a trade (count the day of entry as day 1), and on the 26th day, we will change the exit technique to a much tighter stop at the lowest low of the last 2 days. This dramatic hange will obviously trigger a more sensitive exit but will still allow us to maintain our position in a fast moving market.

We must also remember that our goal in trading is most directly related to the size of the profit and not to the average holding period. Holding a trade longer may be best in most cases but not in all. For those cases where we are fortunate enough to have a large profit in less than 25 days we want to raise our stop to protect those profits regardless of how long we have been in the trade. We have defined a large profit as a profit of 5 average true ranges or more. once our open profit on a closing basis reaches this level we will implement our 2 day low exit regardless of the number of days in the trade.

The combination of the $2,500 dollar stop, the 25-day lowest low stop, and the switch in exits after 25 days creates a unique exit strategy which leads us to the name for this system.


Conclusion

This report has presented several profitable concepts for trading Bonds, which we believe should be equally applicable in other markets. For example, we have observed that minor variations of this system work well in testing over data in T Notes and Swiss Francs. We have shown the impact of a strong prevailing trend on winning trades and recommend taking long trades only when the trend is clearly and strongly up. In spite of the strong trend we have also shown that it is more advantageous to wait for a decline in prices during the uptrend in order to set up a high-probability entry point. Also, we have shown how a simple adaptation of an age-old exit technique can increase profitability and accuracy, while reducing the average holding period per trade.

We hope that this system as well as all our systems will be profitable in the future. There are no guarantees. Constructing systems that perform well over past data is relatively easy once you learn a few basic rules. But in addition to showing great hypothetical performance, our goal is to develop systems that will serve our club members as valuable learning tools and hopefully produce reasonably good results over the unseen data in the future. Please give us your comments and suggestions about this system and other systems that you would like to see.

Aims of the System Traders Club

First, we do not hope to reveal any "holy grails" to trading. Many of the systems that you will see in the System Club reports include indicators that you may already be familiar with, or that can be easily programmed into the computer. In addition, you will find that many of these systems are not perfect: they will all have drawdowns, and none of them are 100% accurate over the long run. However, we think they deserve serious consideration for actual real-time trading applications. We realize that in the business of trading the futures markets there is no single method that makes money automatically. We believe that a combination of logical system concepts and reasonable entry and exit strategies greatly increases the probability of success in trading. We hope to be able to communicate to you, through these reports, many of the concepts that we have learned over the years.

Second, we hope that these reports will serve both an informative as well as a practical purpose. We will share with you lessons that we have accumulated over the years regarding trading strategies and techniques that have worked in various markets, and the logic behind them. You may also want to view the systems presented as illustrations of general principles and concepts in systematic trading of the futures markets. We hope that you may also apply these concepts to your own favorite markets and time-frames. We would welcome any feedback you may have on possible improvements and different applications of these systems.

Third, we intend to provide many different systems and market combinations in our reports. Multiple systems can be combined together in a portfolio to generate more frequent trades and higher returns than any single system. We believe in diversification; but we also realize that diversification is a function of personality and preference. For this reason, we will be offering many different types of systems, from which you will be able to select systems that suit your personality and preference and combine them into your own diversified trading portfolio.

******************************************************************

MetaStock Efficiency Issues

In order to implement the system several techniques were required that slow performance considerably. Daily commentaries suffer the most. on fast Pentium II processors the delays are bearable, but on a 486 processor it may take 3-5 minutes to update a commentary. System testing with a large data set requires a lot of patience. If charts are limited to a years daily data (250 bars more or less), delays will be minimized. Commentaries need only be enabled on setup and actual trade days. Keep open charts to a minimum.


Overview of MetaStock implementation

The 25x25 Bond System enters and exits trades at intraday prices. In order to create a MetaStock 6.50 version it was necessary to develop several indicators to keep track of the intraday entry and exit prices. While this sounds simple enough, MetaStock does not provide global variables or allow circular procedure referencing which would greatly simplify the task.

On top of these shortcomings, MetaStock imposes tremendous processing overhead by not allowing variable assignments within structured code. This means that all values that might be needed in a procedure must be calculated ahead of time, whether required or not, and are constantly updated when referencing previous values.

The 25x25 system only takes long trades. This MetaStock 6.50 system is designed as a template for more complex systems taking both long and short trades based on intraday prices and complex entry/exit procedures.

The main indicator is 25x25 LongEntry which returns the entry price for a trade for each day in the trade. A zero value indicates no position. The exit day is signaled by setting the entry price negative. Thus, the value returned by a single fml(25x25 LongEntry) statement tells you the market position, the entry price, and whether its the last day of a trade or not, and can be used to calculate a trades open profit and days in the trade. This indicator is the heart of the system. It should be carefully studied to understand how it decides when to enter a trade and whether to continue or exit the trade. It stands alone and the other indicators depend on it.

The second indicator is 25x25 LongExit which returns the exit price when 25x25 LongEntry returns a negative value. It simply recalculates the exit stop value which triggered a 25x25 LongEntry negative value. The result is only used to determine a trades closed profit. These two indicators may seem redundant for the 25x25 System, but the technique allows for more complex systems that may stop and reverse on intraday prices. By building corresponding ShortEntry and ShortExit indicators almost any system can be modeled.

A third indicator, 25x25 TP, returns the Trade Position and all other variables needed by the MetaStock Expert. While not efficient, the Expert allows the system to be traded without the need to plot the indicators.

Since MetaStocks System Tester does not handle intraday prices, it cant test the 25x25 performance. The 25x25 Equity indicator allows the user to plot an equity curve but, unfortunately, a trade by trade report cannot be generated. This indicator is not required by the system and should only be plotted when testing.

The 25x25 Stop indicator is another stand alone indicator not required by the system but which is very helpful in seeing the stop values while in a trade. Unlike the other indicators, which should be plotted in separate windows, the 25x25 Stop can be plotted directly on the daily bar chart. It should be plotted as a dashed line. Note that stop values for days with no trade position are plotted as the days low value just to keep the chart properly scaled.

Discrepancies between MetaStock and TradeStation Results

MetaStock and TradeStation do not compute several indicators exactly the same. In order to duplicate the TradeStation design as closely as possible, the following MetaStock indicators were modified:

Relative Strength Index (RSI(4)) results are rounded to two decimal places with the following code: PREC(RSI(4) + .005, 2)

Average True Range(ATR(45)) smoothing is removed with the following code: Mov(ATR(1), 45, S)

Even with these modifications not all 25x25 trades are exactly matched. However, they are very close. MetaStocks ten year test equity is $51,556.27 compared to TradeStations $53,068.75.


*********************************************************************************

{METASTOCK CODE}

{Chuck Le Beau's System Trader's Club}
{ http://traderclub.com }
{ mailto:chuck@traderclub.com }

{"25 x 25" Bond System MetaStock format}


{25X25 LongEntry}

{Returns long trade entry price. }
{A non-zero number if in a long trade. }
{A negative value if the last day of a trade. }

{Note: Modifications to MetaStock indicators }
{were req'd to simulate TradeStation results }
{ RSI: rounded to two decimal places }
{ ATR: Wilder's smoothing removed }

{Variables to avoid duplicate function calls }
PLLV2 := Ref(LLV(L,2),-1);
PLLV25 := Ref(LLV(L,25),-1);

{ Was yesterday a setup day? }
IsSetUp :=
Cum(1) > 50 AND
Ref(PDI(14),-1) > Ref(MDI(14),-1) AND
Ref(ADX(14),-1) > 20 AND
PREC(Ref(RSI(4),-1)+.005,2) < 50;

{Determine initial entry price condition}
EntryPriceCond := Ref(C,-1) + 0.5625;
{Adjust it to enter on open if open is greater}
EntryPriceCond :=
If(O > EntryPriceCond, O, EntryPriceCond);

{Return entry price, zero if no trade. }
If(PREV <= 0,
{Not in a long trade}
If(IsSetUp AND H >= EntryPriceCond,
{Trade entered today, was it stopped?}
If(L <= PLLV25 OR
L <= EntryPriceCond - 2.5,
-EntryPriceCond, {Yes}
EntryPriceCond {No}
),
{Not in trade and not entered today}
0
),
{Have been in trade for over one day. }
{Was it stopped today? }
{Note: BarsSince() gives days in trade }
If(L <= PREV - 2.5, - PREV,
If(BarsSince(PREV=0) > 24,
{More than 24 days in trade}
If(L <= PLLV2, -PREV, PREV),
{Less than 25 days in trade}
If(L <= PLLV25, -PREV,
If(Ref(C,-1) - PREV >
5*Ref(Mov(ATR(1),45,S),-1),
If(L <= PLLV2, -PREV, PREV),
PREV
)
)
)
)
);

25x25 Long Exit

{Returns exit price if last day of long trade}

EntryPrice := Fml("25x25 LongEntry");
ExitingTrade := EntryPrice < 0;

EntryPrice := Abs(EntryPrice);

{Variables to avoid duplicate function calls }
{Lowest low of previous two days }
PLLV2 := Ref(LLV(L,2),-1);
{Lowest low of previous 25 days }
PLLV25 := Ref(LLV(L,25),-1);
TradeDays := If(EntryPrice > 0,
BarsSince(Fml("25x25 LongEntry") = 0), 0);

{ Determine type of stop(s) }
Stop1 :=
ExitingTrade AND TradeDays>24 AND L<=PLLV2;
Stop2 :=
ExitingTrade AND TradeDays>0 AND TradeDays<=24 AND L<=PLLV25;
Stop3 :=
ExitingTrade AND L <= EntryPrice - 2.5;
Stop4 :=
ExitingTrade AND Ref(C,-1) - EntryPrice > 5*Ref(Mov(ATR(1),45,S),-1) AND L <= PLLV2;

{ Determine prices for activated stops }
Stop1Price :=
If(Stop1, Min(O, PLLV2), 0);
Stop2Price :=
If(Stop2, Min(O, PLLV25), 0);
Stop3Price :=
If(Stop3, Min(O, EntryPrice - 2.5), 0);
Stop4Price :=
If(Stop4, Min(O, PLLV2), 0);

{ Assume best stop price stopped the trade }
StopPrice :=
Max(Stop1Price,Max(Stop2Price,
Max(Stop3Price,Stop4Price)));

If(ExitingTrade, StopPrice, 0);

25x25 TP

{ Calculate today's trade position and other }
{ values used by the expert. }

{ LE = LongEntryPrice from indicator }
{ SULE = Tommorow's LongEntry if setup day }
{ SULS = Tommorow's LongStop if setup day }
{ TP = TradePosition +1,0 }
{ TLS = Tomorrow's LongStop if in trade }
{ PRFT = Trade Profit }
{ RISK = Tommorow's theoretical capital risk }


LE := Fml("25x25 LongEntry");
TP := If(LE <> 0, +1, 0);
PRFT := If(LE = 0, 0,
If(LE > 0, C - LE,
Fml("25x25 LongExit") + LE));
TradeDays := If(LE <> 0,
BarsSince(Fml("25x25 LongEntry") = 0), 0);

{Calculate tomorrow's entry prices }
SULE :=
If(TP = 0,
If(PDI(14) > MDI(14) AND ADX(14) > 20 AND
PREC(RSI(4)+.005,2) < 50,
C + .5625, 0), 0);

{Calculate initial stop price}
SULS :=
If(SULE <> 0, Max(LLV(L,25), SULE-2.5), 0);

{Calculate tomorrow's stops }
S1 := If(LE > 0,
If(TradeDays >= 24,
LLV(L,2),
LLV(L,25)), 0);
S2 := If(LE > 0, LE - 2.5, 0);
S3 := If(LE > 0 AND
PRFT >= 5*Ref(Mov(ATR(1),45,S),-1),
LLV(L,2), 0);

{Tomorrow's Long Stop}
TLS := Max(S1, Max(S2, S3));

PRFT := PRFT * 1000;

RISK :=
If(LE > 0, (LE-TLS)*1000,
If(SULE <> 0, (SULE-SULS)*1000, 0));

TP;



The following Trade by Trade Report was produced using the data supplied with this archive
which is continuous contract, back-adjusted, day session only, Bond futures data.

Bond "25" System UA.LNG-Daily 01/04/88 - 01/16/98

Date Time Type Cnts Price Signal Name Entry P/L Cumulative

06/22/88 Buy 1 64^10
07/13/88 LExit 1 62^22 L25 $ -1725.00 $ -1725.00
09/29/88 Buy 1 64^24
11/04/88 LExit 1 67^10 $ 2462.50 $ 737.50
05/05/89 Buy 1 67^23
06/15/89 LExit 1 73^13 $ 5587.50 $ 6325.00
06/20/89 Buy 1 73^14
08/03/89 LExit 1 77^21 $ 4118.75 $ 10443.75
08/15/89 Buy 1 74^12
08/22/89 LExit 1 73^24 L25 $ -725.00 $ 9718.75
08/23/89 Buy 1 74^08
08/29/89 LExit 1 73^17 L25 $ -818.75 $ 8900.00
10/19/89 Buy 1 76^14
11/27/89 LExit 1 77^01 $ 493.75 $ 9393.75
06/26/90 Buy 1 71^13
07/10/90 LExit 1 70^27 L25 $ -662.50 $ 8731.25
11/09/90 Buy 1 70^14
12/17/90 LExit 1 74^23 $ 4181.25 $ 12912.50
08/28/91 Buy 1 77^31
10/03/91 LExit 1 80^22 $ 2618.75 $ 15531.25
11/06/91 Buy 1 80^05
12/13/91 LExit 1 82^05 $ 1900.00 $ 17431.25
01/17/92 Buy 1 84^16
01/29/92 LExit 1 83^07 L25 $ -1381.25 $ 16050.00
05/29/92 Buy 1 83^25
07/08/92 LExit 1 86^13 $ 2525.00 $ 18575.00
07/15/92 Buy 1 86^17
08/21/92 LExit 1 89^22 $ 3056.25 $ 21631.25
12/29/92 Buy 1 91^18
02/10/93 LExit 1 93^31 $ 2306.25 $ 23937.50
02/11/93 Buy 1 93^31
03/22/93 LExit 1 97^17 $ 3462.50 $ 27400.00
08/09/93 Buy 1 104^20
09/15/93 LExit 1 108^25 $ 4056.25 $ 31456.25
12/13/94 Buy 1 94^05
01/20/95 LExit 1 94^15 $ 212.50 $ 31668.75
02/10/95 Buy 1 97^04
03/21/95 LExit 1 99^06 $ 1962.50 $ 33631.25
03/24/95 Buy 1 99^02
05/11/95 LExit 1 104^04 $ 4962.50 $ 38593.75
06/13/95 Buy 1 108^18
07/19/95 LExit 1 107^31 $ -693.75 $ 37900.00
09/19/95 Buy 1 110^13
10/27/95 LExit 1 112^05 $ 1650.00 $ 39550.00
10/27/95 Buy 1 112^31
12/07/95 LExit 1 116^16 $ 3431.25 $ 42981.25
08/16/96 Buy 1 108^22
08/26/96 LExit 1 106^06MM $ -2600.00 $ 40381.25
10/11/96 Buy 1 108^17
11/25/96 LExit 1 113^02 $ 4431.25 $ 44812.50
05/08/97 Buy 1 108^21
06/18/97 LExit 1 110^22 $ 1931.25 $ 46743.75
06/27/97 Buy 1 110^28
08/04/97 LExit 1 113^28 $ 2900.00 $ 49643.75
09/26/97 Buy 1 115^14
11/03/97 LExit 1 117^05 $ 1618.75 $ 51262.50
11/06/97 Buy 1 117^15
12/17/97 LExit 1 119^12 $ 1806.25 $ 53068.75
12/31/97 Buy 1 120^05

To view an equity chart based on the above trades go to:

http://www.traderclub.com/systems_25.htm

PAST PERFORMANCE IS NOT NECESSARILY INDICATIVE OF FUTURE RESULTS.

HYPOTHETICAL OR SIMULATED PERFORMANCE RESULTS HAVE CERTAIN INHERENT LIMITATIONS. UNLIKE AN ACTUAL PERFORMANCE RECORD, SIMULATED RESULTS DO NOT REPRESENT ACTUAL TRADING. ALSO, SINCE THE TRADES HAVE NOT ACTUALLY BEEN EXECUTED, THE RESULTS MAY HAVE UNDER-OR-OVER COMPENSATED FOR THE IMPACT, IF ANY, OF CERTAIN MARKET FACTORS SUCH AS LACK OF LIQUIDITY. SIMULATED TRADING PROGRAMS IN GENERAL ARE ALSO SUBJECT TO THE FACT THAT THEY ARE DESIGNED WITH THE BENEFIT OF HINDSIGHT. NO REPRESENTATION IS BEING MADE THAT ANY ACCOUNT WILL OR IS LIKELY TO ACHIEVE PROFITS OR LOSSES SIMILAR TO THOSE SHOWN.

 
:

Rambler's Top100

0.051