Cant Get Bullcharts to Plot indicator |
Post Reply |
Author | |
RODCAM
Newbie Joined: 15 Nov 2007 Location: Australia Posts: 14 |
Post Options
Quote Reply
Topic: Cant Get Bullcharts to Plot indicator Posted: 09 May 2008 at 10:16pm |
I've had problems before trying to get Bullcharts to plot an indicator of another indicator. I think it may be related to the use of the PREV statement. I've tried to recreate a Heikin-ashi zero lagging TEMA consistent with the May edition of the Technical Analysis of Stocks & Commodities. Recreating the coding is straight forward. I can get the Heikin-ashi indicator (just a smoothed version of close) to plot but I cannot get moving average of the Heikin-ashi indicator to plot. The coding is below. I suspect this is a Bullscript bug but I am not sure. Can anyone spot the problem? [citation ="Technical Analysis of STOCKS & COMMODITIES, May 2008, p.22"][target =Price; category=Moving Average; alias=zlaHaC;]method := inputma("Method",EXPONENTIAL);n := input("Time periods",14,1);x:= ( ref((O+H+L+C)/4,-1)+prev)/2;expr:= (( O+H+L+C)/4+x+Max(H,x)+Min(L,x))/4;ma1 := ma(expr,n,method);ma2 := ma(ma1,n,method);difference := ma1-ma2; zla := ma1+difference; [name =HaC; color=blue]expr; [name =Average; color=blue]zla; { Markers } [name=Above; linestyle=marker; marker=type1; tooltip="Value passed above moving average"] cross (C,zla);[name =Below; linestyle=marker; marker=type2; tooltip="Value passed below moving average"]cross (zla,C); |
|
RODCAM - Brisbane
|
|
maximo
BullCharts Guru Joined: 02 Sep 2006 Location: Australia Posts: 232 |
Post Options Quote Reply Posted: 10 May 2008 at 2:31am |
Hi Rodcam, hows it going? I think the expr variable is a reserved word, so that might be it, though it worked fine on mine. You could change the occurrence's of expr to y or something. Also can try editing out these 4 instructions Temporarily to see the TEMA bullscript function works a little different to the calculation they give. You might have a preference for 1 or the other, cheers! {ma1 := ma(y,n,method); ma2 := ma(ma1,n,method); difference := ma1-ma2; zla := ma1+difference;} replace withzla:=tema(y,n);
Edited by maximo |
|
RODCAM
Newbie Joined: 15 Nov 2007 Location: Australia Posts: 14 |
Post Options Quote Reply Posted: 11 May 2008 at 12:25pm |
Maximo, I am doing fine. Good to see you are keeping up with the posts. Before lodging the post I did a bit of tickering like you suggested but the problem persisted, so I decided to lodge in case I was missing something obvious. I've now coded it into my laptop version 3.4.1.28129 and it works fine. What version are you using? It may just be a problem with the Vista 3.6.7.21815 version I am using on my desktop machine. If you confirm you are using an earlier version I'll lodge the problem with the Bullcharts technical group. Cheers Rod |
|
RODCAM - Brisbane
|
|
maximo
BullCharts Guru Joined: 02 Sep 2006 Location: Australia Posts: 232 |
Post Options Quote Reply Posted: 11 May 2008 at 4:32pm |
I'm using version 3.4.1.28129 same as your laptop version, which works fine. Looks like its a Vista vers issue.
Edited by maximo |
|
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 |