Sei sulla pagina 1di 6

KPL Swing (breakout trading system)

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

The trading system is extremely simple and easy to use and removes emotions from trading.

The trading or investing logic is simple.... buy on close above 20 days high and sell on close
below 20 days low.

No targets are given as profits are unknown and is whatever the market gives. Losses are limited
via position sizing.

Caveat: this indicator works best with indices and highly liquid stocks. It is not
recommended for stocks with poor liquidity (for that matter, any indicator).

Basic logic/ concept


When any stock has to rally, it has to cross some levels. This can be prior
resistance, last week's or month's highs etc etc. Here I have chosen 20 days
high as the reference level. Why 20 days? Because there are 20 trading days
in a month.

You can of course choose some other number like 30 or 55 etc. The concept
remains the same.

Now the outcome of any trade is random so any trade has a 50% chance of
succeding. This holds true for any system and statistically speaking, over a
large number of trades (a million?), the success will veer towards 50%.

By same logic, beware of any system or analyst who claims an exceptionally


high success rate!

So how is money made?


First you need to understand why people lose money. There are only 2
reasons (a) trading beyond one's capacity and (b) holding to loss making
positions for long time while 'booking profits' urgently in winning positions.
Put differently, to make money, you need to (a) limit the max loss in any trade
to under 1% of your trading capital and (b) follow strict stoplosses and trail
profits where trade is in your favour.

If you cannot do the above, then you will better off doing something else in
life.

About whipsaws
All indicators give whipsaws and the KPLSwing indicator is no exception. But
it is easy to know when a signal is likely to generate a whipsaw.

The first warning will be where the stock is trading in a small range for a long
time. Here it is possible to get a buy signal today followed by a sell signal in
next few days.

The second is where a buy signal is generated near a known/ significant


resistance.

Ditto for the sell side.

Now the indicator in action - same stock, different charts...


4-5 years
Previous - Next
Installing the indicator:
You must have Amibroker installed in your PC. If you do not
have this, download a trial version from Amibroker.com.

Download formula file (right click with


mouse) kpl_swing.afl and save in C:/Program
files/Amibroker/Formulas/Custom folder. Save the file with
name kpl_swing.afl

Start Amibroker and click on View/ Charts. Open the


Custom folder and you should see the "kpl_swing" indicator
file.

Drag and drop the indicator on the price/ chart pane/


window.

Explanation:

Entry trade: Initiate a long trade when indicator generates a


BUY signal (arrow).
Exit trade if stock loses 10% in a day or breaks recent
support or indicator generates a sell.

You can use the same code in Scanner mode to generate


Buy/ Sell signals.

Stoploss and Exit Strategy (delivery):


The kplswing indicator has no target because you can never know with
certainity if a stock will give 100, 200 or 500% return in a year. But by staying
in a trade as long as possible, you vastly improve the chances of atleast
capturing a significant percentage of the big move.

Initial stoploss: Min 10% from entry price or recent swing low (long positions)
or low of signal bar (tight, can lead to whipsaws).

Exit strategy:

Exit if stock closes below initial stoploss (entry level) or

Stock loses more than 10% from the most recent high (long
positions) or.

Indicator gives a sell

If you do not have Amibroker:


Vist any of these sites. Eg. ChartINK - Icharts - Trading
View

Consider previous month's high / low as decision making


levels.

Buy on close above previous month's high.

Position sizing will take care of the risk.

Risk management / Position sizing - How much quantity to


buy?
This is the most neglected aspect of trading and the reason why most people
lose money on a regular basis.

In the stock market, everyone likes to know how much money they can make.
No one asks how much they can lose.

So it makes sense you predefine your loss - this will help manage a trade. It
does not matter if your trades are wrong.

Half your trades are anyway bound to fail (statistically speaking) so following
this simple rule will automatically limit losses and help you stay in the market.

If you cannot quantify the loss before taking a trade, stay away from stock
markets and do something else.

Position sizing answers the question: how much quantity should you trade.

Quantity to buy = (1% of trading capital) / (Purchase Price - Stoploss) .

Eg. Assume an initial trading capital of Rs.100,000/- and a risk per trade of 1%
or Rs.1,000/-. You want to buy a stock trading at Rs.100/- with a stoploss
Rs.90.

The quantity you should buy is 1000/(100-90) = 100 shares. You are investing
Rs.10,000/- and if your stoploss gets hit, your maximum loss will be
Rs.1.000/-.

Let's assume your stoploss gets hit.

You are now left with Rs.99,000/- and for the next trade, your loss per trade is
Rs.990/-.

In above example, say the stoploss is Rs.95. The quantity you should buy is
990/(100-95) = 180 shares. You are now investing Rs.18,000/- and if your
stoploss gets hit, your maximum loss is still Rs.990/-.

The capital for the next trade is 99,000-990=98,010/-. Note that your capital is
reducing but the rate of reduction will also reduce.

It is obvious that this simple exercise will ensure that you still stay in the game
and have a good chance of a profitable trade.
_SECTION_BEGIN("KPL Swing");
//Save indicator as "kplswing.afl" in C: program files > Amibroker > Formulas
> Custom folder and then drag and drop indicator on price window.
//Copyright Kamalesh Langote. Email:kpl@vfmdirect.com. Visit
http://www.vfmdirect.com/kplswing for latest code and updates
//You can use in indicator mode (chart) or scanner (generate buy/ sell
signals).
//Risk management: do not risk more than 1% of your capital on any trade.
//Avoid trading in futures unless you are well capitalised.

no=Param( "Swing", 20, 1, 100,1 );

res=HHV(H,no);
sup=LLV(L,no);
avd=IIf(C>Ref(res,-1),1,IIf(C<Ref(sup,-1),-1,0));
avn=ValueWhen(avd!=0,avd,1);
tsl=IIf(avn==1,sup,res);

Plot(tsl, _DEFAULT_NAME(), colorTan, styleStaircase);


arrows=Cross(C,Ref(res,-1))*shapeUpArrow + Cross(Ref(sup,-
1),C)*shapeDownArrow;
PlotShapes(arrows,IIf(C>tsl,colorGreen,colorIndigo),0,IIf(Cross(C,Ref(res,-
1)),Low,High));

//Scanner mode
Buy=Cross(C,Ref(res,-1));
Sell=Cross(Ref(sup,-1),C);
Buy=ExRem(Buy,Sell);
Sell=ExRem(Sell,Buy);

_SECTION_END();

Potrebbero piacerti anche