Print Page | Close Window

Can’t Get Bullcharts to Plot indicator

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=469
Printed Date: 24 Apr 2025 at 1:58am
Software Version: Web Wiz Forums 9.69 - http://www.webwizforums.com


Topic: Can’t Get Bullcharts to Plot indicator
Posted By: RODCAM
Subject: Can’t Get Bullcharts to Plot indicator
Date 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



Replies:
Posted By: maximo
Date 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 with

zla:=tema(y,n);

 



Posted By: RODCAM
Date 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


Posted By: maximo
Date 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.

      




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