Gotcha |
Post Reply |
Author | |
NeilW
Newbie Joined: 06 Aug 2006 Location: Australia Posts: 8 |
Post Options
Quote Reply
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; |
|
Post Reply |
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |