# Trailing Stoploss Indicator

#### karthikmarar

##### Well-Known Member
Friends

Here is the formula for a simple Trailing stop indicator

The formula draws a stoploss loss line which will be 7% below the highest close within a lookback period of 20 bars.

The Stoploss % and the Lookback period can be varied. When you plot the indicator you will be prompted for Look back period and Stoploss%. The defaults are set to 20 bars and 7%.

LB:= Input("Enter lookback period",15,30,20);
PERIOD:= Input("ENTER % STOPLOSS",2,10,7);
HHV(C ,LB)-(HHV(C,LB)*(PERIOD/100))

A chart is enclosed just to give an idea how this one looks

regards

karthik

Last edited:

#### AMITBE

##### Well-Known Member
karthikmarar said:
Friends

Here is the formula for a simple Trailing stop indicator

The formula draws a stoploss loss line which will be 7% below the highest close within a lookback period of 20 bars.

The Stoploss % and the Lookback period can be varied. When you plot the indicator you will be prompted for Look back period and Stoploss%. The defaults are set to 20 bars and 7%.

LB:= Input("Enter lookback period",15,30,20);
PERIOD:= Input("ENTER % STOPLOSS",2,10,7);
HHV(C ,LB)-(HHV(C,LB)*(PERIOD/100))

A chart is enclosed just to give an idea how this one looks

regards

karthik
Hi Karthik, nice one.
Have been working on a similar formula for my Amibroker too. Just to add another point, when the scrip is low in liquidity and mostly low in volatility for that reason, one may try with a 5% or even 4% trailing stop. With low volatility, 4 or 5% change would be enough deviation. You may want to try it out on a counter like Madras Cement. Do let me know.
Thanks.

#### karthikmarar

##### Well-Known Member
Hi Amit

You are correct. In case of Madras Cements a 4% stoploss would be appropriate. That is why I gave the option of changing the percentage. By the way...Even the 7% default figure based on your post on stoploss..

regards

karthik

#### sidzaw

##### New Member
Dear karthikmarar

Simple and best and I like it much

cheers
sidzaw

U

#### uasish

##### Guest
sidzaw,

A warm Welcome to the Forum.

Asish

#### rkkarnani

##### Well-Known Member
Friends

Here is the formula for a simple Trailing stop indicator

The formula draws a stoploss loss line which will be 7% below the highest close within a lookback period of 20 bars.

The Stoploss % and the Lookback period can be varied. When you plot the indicator you will be prompted for Look back period and Stoploss%. The defaults are set to 20 bars and 7%.

LB:= Input("Enter lookback period",15,30,20);
PERIOD:= Input("ENTER % STOPLOSS",2,10,7);
HHV(C ,LB)-(HHV(C,LB)*(PERIOD/100))

A chart is enclosed just to give an idea how this one looks

regards

karthik
Hello sir, Nice input.
Seeing the attached graph it seems the SL is for LONG ONLY positions and not for SHORT sold trades. Could not test it in my Metastock as it needs to be reloaded!!!
Regards.
R K Karnani