Professional Documents
Culture Documents
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).
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%.
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.
Explanation:
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:
Stock loses more than 10% from the most recent high (long
positions) or.
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.
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/-.
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.
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);
//Scanner mode
Buy=Cross(C,Ref(res,-1));
Sell=Cross(Ref(sup,-1),C);
Buy=ExRem(Buy,Sell);
Sell=ExRem(Sell,Buy);
_SECTION_END();