Home                           

 Try Investor/RT             

 Investor/RT Tour           

 Getting Started              

 What's New                  

 Testimonials                 

[menuLeft.htm] Trading Systems
Key Reversals
Chad Payne

Name: 

 Key Reversals

Submitted by: 

 Chad Payne

Periodicity: 

 Daily

Rules...

RULE 1: Daily: If KeyRevLong then BUY $5500 at Last price
SIGNAL=KeyRevLong: LO < LO.1 AND CL > CL.1 AND CL < HI AND SET(V#1, HI.1)
ELEM=LO:Low
ELEM=CL:Close
ELEM=HI:High
ELEM=V#1:V#1
MARKER=[0,16,1,00FF3333]

RULE 2: Daily: If KeyRevExit then SELL at Value V#1 price
SIGNAL=KeyRevExit: HI >= HI.1 AND BARSOPEN = 1
ELEM=HI:High
ELEM=BARSOPEN:No. bars in position
MARKER=[0,16,1,00FF3333]

RULE 3: Daily: If KeyRevStop then SELL at Close price
SIGNAL=KeyRevStop: HI < HI.1 AND BARSOPEN = 1
ELEM=HI:High
ELEM=BARSOPEN:No. bars in position
MARKER=[0,16,1,00FF3333]

Explanation and Comments...

This system was submitted as a Trader's Tip for the December 2001 issue of Stocks and Commodities magazine.  The text which was submitted with the tip can be seen below.  The tricky part of this backtest is in the use of the V#1 variable.  The first rule always sets the variable to the previous high because the second rule might need to use it as it's exit price.  Also, the BARSOPEN token is used.  This token represents how many bars the system has been in the position.  In this case, we only want to stay in the position one day.  The system is actually quite simply, we are buying at the close if the current low is lower than the previous days low, the current close is greater than the previous close, and the current close is less than the current high.  We then either exit or stop during the next day.  We exit whenever the price reaches the previous high, otherwise we stop at the close.

Investor/RT provides a comprehensive backtesting capability, which makes it easy to simulate the key reversal system described in this month’s article “Finding Key Reversals”.  First, create the following three trading signals (File: New: Trading Signal). 

Name: KeyRevLong
Description: Key reversal entry signal.  Also sets the custom variable, V#1, to the previous high.
Syntax: LO < LO.1 AND CL > CL.1 AND CL < HI AND SET(V#1, HI.1) 

Name: KeyRevExit
Description: Exit signal, if bar exceeded previous high.
Syntax: HI >= HI.1 AND BARSOPEN = 1 

Name: KeyRevStop
Description: Stop signal, if bar did not exceed previous high.
Syntax: HI < HI.1 AND BARSOPEN = 1 

Now, create a new trading system (File: New: Trading System), and add the following three rules in this order…

If KeyRevLong then BUY  $5500 at Last price
If KeyRevExit then SELL at Value V#1 price
If KeyRevStop then SELL at Close price

This backtest should be run on Daily data.  Click on the “Setup Backtest…” button to specify your backtest details, such as: 

  • Symbol or group of symbols on which to run the backtest
  • Backtesting period (number of bars on which to run the backtest)
  • Maximum position sizes
  • Commissions and fees
  • Reporting options

Now, click the “Save System” button to save the backtest for future reference, calling it something like “KeyReversal”.  Now, click the “Backtest” button to run the backtest and view the resulting reports.