KPL Swing (breakout trading system)

The KPL Swing is a simple trend following mechanical trading system which automates the entry and exit.

The trading system is extremely simple and easy to use, works across multiple time frames and does not require any in-depth knowledge of TA. It is somewhat similar to the turtle trading system.

The trading or investing logic is simple.... buy new highs (strength) and sell new lows (weakness). The default entry or decision level for long positions is a close above 20 days highest high.

The system follows a trailing stoploss for exit with profitable trades. No targets are given as no one knows how high (or low) a stock can move. Profits are whatever the market gives. A trailing stoploss locks in the gains and removes emotions from trading.

Respect for stoplosses is a mandatory requirement. If you cannot follow stoplosses, you should stay out of the market completely.

Caveat: this indicator works best with indices and highly liquid stocks. It is not recommended for stocks with poor liquidity as freak trades often distort the value of the breakout level (high or low).

Code for Amibroker AFL is posted at the end of this page.

How to use indicator in Amibroker:

Example charts: NIFTY 60min - SBI 60min - Wipro Dly - Asian Paint Dly - Tatamotors Dly - Reliance Weekly

- Default setting: N=20. Higher values (30, 50, 100 etc) will give fewer but far more reliable trades.
- Timeframe and charts: daytraders/ swing traders (30 min), positional traders (daily) and long term investors (weekly/ monthly).
- Smaller the timeframe or N, higher the number of trades and whipsaws.
- Ignore signals if market is rangebound. Eg., if market is trading within last month's range, ignore signal on daily chart.
- Entry trade: Initiate a long trade when indicator gives a BUY (stock closes for the first time above the 20 days or 20 weeks highest high).
- Stoploss: Keep a "hard stoploss" few points below the Signal bar LOW.
- Trend reversal: Exit trade when indicator gives a SELL (Exit long positions).
- Position sizing: always follow this to determine trade quantity...this will automatically limit losses to a predefined value irrespective of stock price.
- Always paper trade before trading with actual cash.

- You can use a ATR based trailing stoploss or a 5% trailing stoploss or use a time based exit (10, 20, 30 days etc).
- You can use the same code in Scanner mode to generate Buy/ Sell signals.

Position sizing - How much quantity to buy? Use position sizing and limit loss to Rs.500/- per trade.

Qtty = 500/ (Purchase price - Stoploss).

Eg. You want to buy a stock trading at Rs.100/- with a stoploss Rs.90. The quantity you shd trade is 500/(100-90) = 50 shares. So if your stoploss gets hit, you shd exit and your max loss will be Rs.500/-.

You can set an initial stoploss of say 5% or a recent swing low (for long positions).

And finally, the code....Amibroker AFLs

Note: the current bar is always dynamic so for intraday purposes, you should evaluate the signal only after the current bar is complete.

Metastock users: I am no longer supporting metastock....