Indicator code for trailing stop |
Post Reply |
Author | |
wombat40
Newbie Joined: 14 Aug 2010 Location: perth Posts: 8 |
Post Options
Quote Reply
Topic: Indicator code for trailing stop 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 |
|
maximo
BullCharts Guru Joined: 02 Sep 2006 Location: Australia Posts: 232 |
Post Options Quote Reply 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); |
|
wombat40
Newbie Joined: 14 Aug 2010 Location: perth Posts: 8 |
Post Options Quote Reply 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 |
|
maximo
BullCharts Guru Joined: 02 Sep 2006 Location: Australia Posts: 232 |
Post Options Quote Reply Posted: 03 Mar 2012 at 12:23am |
Yes that is for both Initial stop and trailing stop. You're welcome.
|
|
Post Reply |
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |