Print Page | Close Window

Gotcha

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=380
Printed Date: 18 May 2024 at 6:30pm
Software Version: Web Wiz Forums 9.69 - http://www.webwizforums.com


Topic: Gotcha
Posted By: NeilW
Subject: Gotcha
Date 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;




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