Print Page | Close Window

trailing stop loss

Printed From: BullCharts Forum
Category: BullCharts
Forum Name: BullScript
Forum Discription: Technical discussion related specifically to the BullScript programming language.
URL: http://www.bullcharts.com.au/forum/forum_posts.asp?TID=689
Printed Date: 19 May 2024 at 7:57am
Software Version: Web Wiz Forums 9.69 - http://www.webwizforums.com


Topic: trailing stop loss
Posted By: slips
Subject: trailing stop loss
Date Posted: 04 Mar 2011 at 1:26pm
Hi again
I asked a question last night, but reading it now I don't think anyone would have quite got what i was asking.  I have been unable to work out how to put my own trailing stop loss in my charts.  can anyone guide me through the right process
slips


-------------
slips



Replies:
Posted By: maximo
Date Posted: 04 Mar 2011 at 9:32pm
Hello slips,
 
What kind of stop loss did you want to use, example. ATR or percentage or another?
 
 


Posted By: cmacdon
Date Posted: 16 Sep 2012 at 6:26am
Here is an indicator to play around with.  I developed it some time ago when I read a Michael Jenkins article where he used the square root theory to set stop loss levels but I discarded Sq roots method as it did not seem to work too well on some low value dollar ASX stocks.
 
Instead, this indicator attempts to show whether a stop loss based on the settings for a number of ATRs is more conservative than a % stop set by the user.  It is interesting as once set the more conservative solution changes from time to time as shown by the colour fills and some markers. A variable requires the indicator to be set for Longs or shorts.
 
 

[target

=Price;]

n :=

input("Time periods for highest high",15);

type :=

input("Is this Stop for 1 Long or 2 Short",1);

sl :=

input("percent for Stop Loss",6);

 

LongPercent:=

If(type=1,Highest(h,n)-((sl/100)*C),undefined);

 

[color

=Dark Gray; linestyle=Dotted; width=2;]

LongPercent;

S2 :=

input("No. of ATRs for Stop Loss",2);

LongATR:=

If(type=1,Highest(h,n)-(atr(n)*s2),undefined);

[color

= Dark Purple; linestyle=Dotted; width=2;]

LongATR;

{ Fill }

[name

=Fill; linestyle=fill; visible=false]

[color

= Dark Gray] LongPercent;

[color

= Dark Purple] LongATR;

[name

=% Set more conservative; linestyle=marker; marker=type1; visible=no] [tooltip="% Set more conservative"]

cross

(LongPercent, LongATR);

[name

=ATR set more conservative; linestyle=marker; marker=type1; visible=no] [tooltip="ATR set more conservative"]

cross

(LongATR, LongPercent);

shortPercent:=

If(type=2,Lowest(l,n)+((sl/100)*C),undefined);

 

[color

=Dark Gray; linestyle=Dotted; width=2;]

ShortPercent;

 

ShortATR:=

If(type=2,Lowest(h,n)+(atr(n)*s2),undefined);

[color

= Dark Purple; linestyle=Dotted; width=2;]

ShortATR;

{ Fill }

[name

=Fill; linestyle=fill; visible=false]

[color

= Dark Gray] ShortPercent;

[color

= Dark Purple] ShortATR;

[name

=% set more conservative; linestyle=marker; marker=type1; visible=no] [tooltip="% set more conservative"]

cross

(ShortPercent, ShortATR);

[name

=ATR set more conservative; linestyle=marker; marker=type1; visible=no] [tooltip="ATR set more conservative"]

cross

(ShortATR, ShortPercent);



-------------
BC User since June 2007



Print Page | Close Window

Bulletin Board Software by Web Wiz Forums® version 9.69 - http://www.webwizforums.com
Copyright ©2001-2010 Web Wiz - http://www.webwiz.co.uk