Print Page | Close Window

Welles Wilder Volatility Stop

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=1021
Printed Date: 04 May 2024 at 6:36am
Software Version: Web Wiz Forums 9.69 - http://www.webwizforums.com


Topic: Welles Wilder Volatility Stop
Posted By: maximo
Subject: Welles Wilder Volatility Stop
Date Posted: 22 Feb 2018 at 4:54pm

{ Wilder Volatility Stop Trail }
[Target=price]
Mult:=Input("ATR Multiplier",3,1);
Nb:=if(Mult<3,7,Int(Mult*2+1));
Long :=Ref(HHV(C,Nb),-1) - (Ref(ATR(Nb),-1)*Mult);
Short:=Ref(LLV(C,Nb),-1) + (Ref(ATR(Nb),-1)*Mult);
trail:=
If(C>PREV and Ref(C,-1)>PREV, Max(PREV,Long),
If(C<PREV and Ref(C,-1)<PREV, Min(PREV,Short),
If(C>PREV, Long, Short)));
Trail;
[linestyle=pricecolor]
[color=rgb(0,174,0)] if(C>=Trail,1,0);
[color=rgb(255,85,85)] if(C<Trail,1,0);




Replies:
Posted By: meldeans
Date Posted: 26 Nov 2020 at 3:24pm
Hi Maximo,  I know this post is old now but i am new to it.  I understand this stop is 3 x ATR but i don't know what ATR period length is.  Is it 7 periods or some other number???  I don't understand the code.

Thanks
Dean
 


Posted By: maximo
Date Posted: 04 Dec 2020 at 2:10am
If the stop setting is < 'less than' 3, the minimum lookback bars used in calculation is 7 bars.   This is also the smallest number of bars for 3x ATR.   Higher ATR values will calculate with more bars than 7.




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