Print Page | Close Window

Need Help Building An 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=458
Printed Date: 24 Apr 2025 at 12:50am
Software Version: Web Wiz Forums 9.69 - http://www.webwizforums.com


Topic: Need Help Building An Indicator
Posted By: kennerhk
Subject: Need Help Building An Indicator
Date Posted: 13 Feb 2008 at 4:08am

I am trying to build an indicator in BC, but know ZERO about this, so I'm hoping someone can help me out.  This indicator is a variation on the Chaikin MoneyFlow with some exponential smoothing built in to correct some false signals.  The Metastock code provided by the indicator's author/creator on his website is as follows:

{2003-09-24}

periods:=Input("TMF periods",1,100,21);

TRH:=Max(Ref(C,-1),H);

TRL:=Min(Ref(C,-1),L);

TR:=TRH-TRL;

ADV:=((C-TRL)-(TRH-C))/If(TR=0,999999,TR)*V;

WV:=V+(Ref(V,-1)*0);

If(Wilders(WV,periods)=0,0,Wilders(ADV,periods)/Wilders(WV,p eriods))

I tried to just cut and paste this into the indicator builder window, but when I try to do that, I get the following error message:

"Error 902: parameter 3 to input function must not be greater than parameter 2"

Does anyone know how to tweak this to run in BC?  Ideally, I'd like the correct code so I can just cut and paste it into the Indicator Builder.  Would greatly appreciate your help on this. 

Thanks in advance!

 

 




Replies:
Posted By: blackdog
Date Posted: 13 Feb 2008 at 8:23pm
kennerhk,
 
The error message refers to your input statement which should be in the format
INPUT(MESSAGE[,DEFAULT,MINIMUM,MAXIMUM]).
 
If you cut and paste your code into BS, perform 'check' then you get the error message that you found. However you also get the option for BS to correct the code. Select 'yes' and then hey presto your input line will change to
periods:=input("TMF periods", 21, 1, 100);
and your code will now work.
 
 
regards,
 
p.s. You also have to remove the space in "p eriods" in the last line.
BD


Posted By: kennerhk
Date Posted: 17 Feb 2008 at 5:19pm

Black Dog, I tried your suggestion and it worked.  The indicator is up and running perfectly.  MUCH THANKS for your help!!!! 




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