BullCharts Forum Homepage
Forum Home Forum Home > BullCharts > BullScript
  New Posts New Posts RSS Feed: Gotcha
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

Gotcha

 Post Reply Post Reply
Author
Message Reverse Sort Order / View First Unread Post
NeilW View Drop Down
Newbie
Newbie


Joined: 06 Aug 2006
Location: Australia
Posts: 8
Post Options Post Options   Quote NeilW Quote  Post ReplyReply Direct Link To This Post Topic: Gotcha
    Posted: 18 Aug 2006 at 6:00pm

Hi All,

Tried to use the following piece of code and it did not perform the way I expected. When plotted onto a nice uptrend i.e. BHP end of March 06. It shows some "D"'s in the middle of the trend yet the fast MA is always above the slow MA???

Little did I know that "UpTrend" is actually a function and you can do what ever you like to it and it does not give the slightest hint that it is a reserved word/function and does whatever it likes.

So, always check any of your variable names you create and ensure that they are not used already by the compiler.

Neil.

[target=Price]

FastMA := input("Fast MA Value",4,0);

SlowMA := input("Slow MA Value",9,0);

[linestyle=NoPlot]

Uptrend := False;

MA1 := MA(C,FastMA,E);

MA2 := MA(C,SlowMA,E);

If( MA1 > MA2,UpTrend = True,UpTrend =False);

[color=Blue]

[linestyle=Text; textalign=Above,Center]

if(uptrend, "U","D");

Low-2*ATR(3);

[color=Blue]

[linestyle=dotted; ]

MA1;

[linestyle=solid; ]

MA2;

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