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

Reply
Old 05-23-2009, 09:00 AM   #1

Join Date: May 2009
Location: hong kong
Posts: 34
Ignore this user

Thanks: 9
Thanked 2 Times in 2 Posts

Error Code Help Please

I am a newbie in multicharts and easylanguage .
I tried to translate the code I used in metastock to it .
The following is a moving average .
I tested it in the complier but no error return and complied successfully for the first time ,
but when I applied it over a chart , it returned error message and said there are kind of floating calculation error .
Can someone give me a hand ?
(notes , CMO is chande mementum oscillator which was posted here by another kind man earlier )


{10VIDYA}
inputs: smooth(5);
variable : AbsCMO(0);
variable : SC(0);
variable : vidya10(c);
AbsCMO=AbsValue(CMO(C))/100;
SC= 2/(smooth+1);
vidya10= (sc*AbsCMO*c)+(1-(SC*AbsCMO))*vidya10[1];
Plot1(vidya10,"vidya10");
emptyvault is offline  
Reply With Quote
Old 05-23-2009, 09:01 AM   #2

Join Date: May 2009
Location: hong kong
Posts: 34
Ignore this user

Thanks: 9
Thanked 2 Times in 2 Posts

Re: Error Code Help Please

I have tried to add a statement ->

SetFPCompareAccuracy(1);

to decrease the accuracy if it caused the problem , but still cannot help ....
emptyvault is offline  
Reply With Quote
Old 05-23-2009, 01:28 PM   #3

Join Date: May 2008
Location: amsterdam
Posts: 114
Ignore this user

Thanks: 25
Thanked 39 Times in 30 Posts

Re: Error Code Help Please

besides a price the cmo needs a period for its calculation,
change

AbsCMO=AbsValue(CMO(C))/100;

by

AbsCMO=AbsValue(CMO(C,5))/100;

and it should work,
or as you prefere set a input for the CMO's Period

good luck
flyingdutchmen is offline  
Reply With Quote
Old 05-23-2009, 02:13 PM   #4

Join Date: May 2009
Location: hong kong
Posts: 34
Ignore this user

Thanks: 9
Thanked 2 Times in 2 Posts

Re: Error Code Help Please

Thanks for replying .
I have tried that before . When I added the coma and a figure in it .
It just shown error :
Invalid number of parameters. 1 parameter(s) expected .

Did I miss some steps that have to declare the CMO function as it is not built in by the program ?
emptyvault is offline  
Reply With Quote
Old 05-23-2009, 02:35 PM   #5

Join Date: May 2009
Location: hong kong
Posts: 34
Ignore this user

Thanks: 9
Thanked 2 Times in 2 Posts

Re: Error Code Help Please

I tried and tried over and over again .
I cannot sure if it is bug or not but it finally seems worked out on some charts only . Some symbols still show same error .....
maybe I have to ask CS for help again ..
emptyvault is offline  
Reply With Quote
Old 05-23-2009, 05:22 PM   #6

Tams's Avatar

Join Date: Sep 2008
Location: Geelong
Posts: 3,779
Ignore this user

Thanks: 2,084
Thanked 1,477 Times in 912 Posts

Re: Error Code Help Please

There are 2 versions of code.

if you had imported the PLA version from this thread:
http://www.traderslaboratory.com/for...ator-6013.html
the CMO function only requires one input.

input:
Length(NumericSimple);


try 14


if you had copy and pasted the text code in the 2nd post, you will need 2 inputs:

input:
Price(NumericSeries),
Length(NumericSimple);

try
close for price,
and 14 for length.


.

Last edited by Tams; 05-23-2009 at 05:54 PM.
Tams is offline  
Reply With Quote
Old 05-24-2009, 02:41 AM   #7

Join Date: May 2009
Location: hong kong
Posts: 34
Ignore this user

Thanks: 9
Thanked 2 Times in 2 Posts

Re: Error Code Help Please

dear Tams ,
I used the first one and downloaded there .
Did you try the code I posted if you can see any problem on your computer . As I only success for once but most of the other simbol return error message . I guess maybe it is the problem of MC . If someone tried the code and you can successfully apply to your chart . Please dont mind to tell me .

In fact , it is said to be the code of variable index dynamic average of Tuschar Chande which I picked out from my MS program and tried to translate to MC codes . If someone has better way to do it . Please feel free to share .
emptyvault is offline  
Reply With Quote
Old 05-24-2009, 02:59 AM   #8

Join Date: May 2009
Location: hong kong
Posts: 34
Ignore this user

Thanks: 9
Thanked 2 Times in 2 Posts

Re: Error Code Help Please

oh , I just found that at MC home page .
There is vidya by Chande, let me see if it is the same old one .
thanks all .
emptyvault is offline  
Reply With Quote

Reply

Tags
cmo

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
Web Site Rendering Error Spydertrader Support Center 3 05-13-2009 10:29 PM
Error when Retrieving PMs brownsfan019 Support Center 4 04-21-2009 11:16 PM
Easylanguage Error #408 and #410?? isisisis Coding Forum 2 04-10-2009 06:30 PM
Future Data Error in TS Indicator blib Coding Forum 6 04-05-2009 04:09 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 09:23 AM.
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
CS to VB integration by DeskLancer
©2006-2011 Traders Laboratory, All Rights Reserved.