Welcome to the Traders Laboratory Forums.
Coding Forum Collaborate, receive help, or discuss coding related issues.

Reply
Old 04-14-2010, 08:00 AM   #1
O66

Join Date: Nov 2006
Location: abc
Posts: 18
Ignore this user

Thanks: 0
Thanked 2 Times in 2 Posts

Compile Error MC

Hi im trying to compile below code in MultiCharts but no luck.
any ideas?

thanks.

Inputs:
Length( 9 );

Value1 = Cum(UpTicks - DownTicks) ;

Value2 = Average(Value1, Length) ;

If Value2 > Value2 1 bar ago then
Begin
Plot1(Value2, "AccVol", Green, default, 1) ;
End

Else
Begin
Plot1(Value2, "AccVol", Red, default, 1);
End ;


Study: "CumVolume" (Indicator)
Please wait ....
------ Compiled with error(s): ------
syntax error, cannot reference previous values in such expression
errLine 8, errColumn 12, errLineEnd 8, errColumnEnd 12
causal study: (Function)
O66 is offline  
Reply With Quote
Old 04-14-2010, 08:52 AM   #2

BlowFish's Avatar

Join Date: Mar 2007
Location: In Da House
Posts: 3,292
Ignore this user

Thanks: 129
Thanked 1,054 Times in 702 Posts

Re: Compile Error MC

Try changing

If Value2 > Value2 1 bar ago then

to

If Value2 > Value2[1] then


Not sure why...I guess this syntax ensures that Value2 gets stored for each bar.
I would suggest using 'meaningful' names for variables rather than the temporary value1 value2 etc.
BlowFish is offline  
Reply With Quote
Old 04-14-2010, 10:00 AM   #3
O66

Join Date: Nov 2006
Location: abc
Posts: 18
Ignore this user

Thanks: 0
Thanked 2 Times in 2 Posts

Re: Compile Error MC

thanks!
it's working now
O66 is offline  
Reply With Quote

Reply

Thread Tools
Display Modes Help Others By Rating This Thread
Help Others By Rating This Thread:


Similar Threads
Thread Thread Starter Forum Replies Last Post
TS8 Error hogarstrasni General Discussion 2 10-07-2009 06:22 PM
Error in MC emptyvault Coding Forum 11 08-30-2009 12:55 PM
Error Code Help Please emptyvault Coding Forum 10 07-19-2009 12:21 PM
Error when Retrieving PMs brownsfan019 Support Center 4 04-21-2009 11:16 PM
Url.dll Error - Help! brownsfan019 Tools of the Trade 5 09-16-2008 05:50 PM

All times are GMT -4. The time now is 02:36 PM.
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
CS to VB integration by DeskLancer
©2006-2011 Traders Laboratory, All Rights Reserved.