Print Page | Close Window

Indicator code for trailing stop

Printed From: BullCharts Forum
Category: BullCharts
Forum Name: BullScan
Forum Discription: For discusssions on BullScan
URL: http://www.bullcharts.com.au/forum/forum_posts.asp?TID=803
Printed Date: 19 May 2024 at 11:42am
Software Version: Web Wiz Forums 9.69 - http://www.webwizforums.com


Topic: Indicator code for trailing stop
Posted By: wombat40
Subject: Indicator code for trailing stop
Date Posted: 28 Feb 2012 at 7:26pm
Gday there,
                  Im using a trailing stop, and also an initial stop in bullcharts/ tradesim scans that works ok in tradesim system ,

Initial stop =  hist(lowest(L,8),1)

Trailing stop = Close<hist(lowest(L,8),1)   

But i want to code it so that i can use it as a indicator when viewing the results on charts...ie formula to make it a indicator..and be able to change the period etc

Just inquiring if anyone knows how to do this.?

cheers...mark



Replies:
Posted By: maximo
Date Posted: 01 Mar 2012 at 3:51pm
Hey mark,
 
This should do it.
 

[lineStyle=Solid; Target=Price]

n := input("Lookback periods",8,0);

hshift := input("Horizontal shift",1);

[color=steel blue]

hist(Lowest(L,n),hshift);



Posted By: wombat40
Date Posted: 02 Mar 2012 at 2:43pm
Thanks buddy.
                 Now can that be used as Initial stop ...or trailing stop on the charts?  Is it the same code for both, or that is the trailing stop?

Appreciate the help
     
...mark


Posted By: maximo
Date Posted: 03 Mar 2012 at 12:23am

Yes that is for both Initial stop and trailing stop.

You're welcome.

 




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