Print Page | Close Window

Guppy Trend Volatility Line Bullscript

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=623
Printed Date: 27 Apr 2025 at 5:56pm
Software Version: Web Wiz Forums 9.69 - http://www.webwizforums.com


Topic: Guppy Trend Volatility Line Bullscript
Posted By: TheFerret
Subject: Guppy Trend Volatility Line Bullscript
Date Posted: 23 Mar 2010 at 5:04pm
Hi Everyone,
                    just wanted to share some code I wrote for the Guppy Trend Volatility Line Stop Loss. Just enter the date you bought it and the break even price(including brokerage, this is usually a few clicks more than your buy price.)The stop zig zags between the 30 and 60 ema by default and as such you should have the Guppy LT and ST GMMA on your screen as well,  but you may find a different pair of ema's that better define your trend and use them. I haven't tested it with falling trends but it appears to work with them as well.

[description=This indicator uses the Guppy GMMA and TVL.]
[citation=Daryl Guppy. Programming by The Surferret] [category=Stop Loss]
[target=Price]
[name=TVL Stop]
[Width=2]
[color=black]

PDate := inputdate("Date");
ma1 := input("EMA short", 30, 1, 200);
ma2 := input("EMA long", 60, 1, 200);
cost := input("Breakeven Cost", 0, 0, 9999);
m1:= ma(c,ma1,e);
m2:=ma(c,ma2,e);
prevm1:=ma(hist(c,1),ma1,e);
prevm2:=ma(hist(c,1),ma2,e);

if(now<PDate,cost,
if(now=PDate,if(cost<=m2,m1,cost),
if(m1 > m2 and previous < m2,((m1-prevm1)*(previous-prevm2)/(m2-prevm2))+prevm1,
if(m1 < m2 and previous > m2,((m1-prevm1)*(previous-prevm2)/(m2-prevm2))+prevm1,
previous))));

All the best,
The Surferret



Replies:
Posted By: maximo
Date Posted: 28 Mar 2010 at 2:49pm
That's some pretty fancy coding there, thanks :)


Posted By: Bana
Date Posted: 04 May 2010 at 4:12pm
Thanks for the coding.
 
Cheers



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