Help by implementing stop-loss strategy |
Post Reply |
Author | |
charlie_8
Regular Joined: 06 Apr 2011 Posts: 21 |
Post Options
Quote Reply
Topic: Help by implementing stop-loss strategy Posted: 09 Aug 2011 at 8:28am |
Dear forum memebers,
I would be glad if somebody could help me by writing a stop-loss strategy in bullscript. This strategy based on Nth bar lows for longs and Nth bar highs for shorts. Short explanation: let us assume, that we took a long position on 3.1.2011. The up pivot bar is let say on 1.1.2001 (so we should have a posibility to decide witch day is our first day for stoploss - like ATR stoploss in Bullcharts). We want to place our stoploss on the level of the low of the pivot bar and then move it higher. We want to see our stop on the lowest low of let us say as example last 9 bars (should be adjustable). maby maximo could help me? Thank you
|
|
maximo
BullCharts Guru Joined: 02 Sep 2006 Location: Australia Posts: 232 |
Post Options Quote Reply Posted: 09 Aug 2011 at 10:13am |
Hi Charlie,
That indicator has been around for quite a while. It's known as the Donchian channel, which Richard Donchian so named. The turtles of Richard dennis reportedly used them.
[lineStyle =Solid; Target=Price]n := input("Lookback periods",10,0);hshift := input("Horizontal shift",0);[color =steel blue]hist (HHV(H,n),hshift);[color =steel blue]hist (LLV(L,n),hshift);[linestyle =dotted]hist (HHV(H,n) + LLV(L,n),hshift)/2;Edited by maximo - 09 Aug 2011 at 10:14am |
|
charlie_8
Regular Joined: 06 Apr 2011 Posts: 21 |
Post Options Quote Reply Posted: 09 Aug 2011 at 11:24am |
thank you maximo, you actually right about donchian channel :) i didnt think this way :D
|
|
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 |