BullCharts Forum Homepage
Forum Home Forum Home > BullCharts > BullScript
  New Posts New Posts RSS Feed: Guppy Trend Volatility Line Bullscript
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

Guppy Trend Volatility Line Bullscript

 Post Reply Post Reply
Author
Message Reverse Sort Order / View First Unread Post
Bana View Drop Down
Regular
Regular
Avatar

Joined: 02 Jan 2007
Location: Australia
Posts: 46
Post Options Post Options   Quote Bana Quote  Post ReplyReply Direct Link To This Post Topic: Guppy Trend Volatility Line Bullscript
    Posted: 04 May 2010 at 4:12pm
Thanks for the coding.
 
Cheers
Back to Top
maximo View Drop Down
BullCharts Guru
BullCharts Guru
Avatar

Joined: 02 Sep 2006
Location: Australia
Posts: 232
Post Options Post Options   Quote maximo Quote  Post ReplyReply Direct Link To This Post Posted: 28 Mar 2010 at 2:49pm
That's some pretty fancy coding there, thanks :)
Back to Top
TheFerret View Drop Down
Newbie
Newbie
Avatar

Joined: 18 Aug 2007
Posts: 9
Post Options Post Options   Quote TheFerret Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Bulletin Board Software by Web Wiz Forums® version 9.69
Copyright ©2001-2010 Web Wiz