Compilation error  [SOLVED]

Questions about MultiCharts and user contributed studies.
Leo
Posts: 63
Joined: 23 Sep 2015
Has thanked: 4 times
Been thanked: 2 times

Compilation error

Postby Leo » 03 Oct 2015

Hi all, I'm trying to compile a trading systems which uses the Ematrend addon as signal. However I cannot compile it in Powerlanguage as I get the following error:

------ Compiled with error(s): ------
Unknown Function

where the unknown functions is Ematrend. I thought it would have been recognized as Ematrend is available among MC indicators, but it seems it does not.
Any help appreciated, thanks

User avatar
TJ
Posts: 7232
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 991 times
Been thanked: 2058 times

Re: Compilation error

Postby TJ » 03 Oct 2015

Hi all, I'm trying to compile a trading systems which uses the Ematrend addon as signal. However I cannot compile it in Powerlanguage as I get the following error:

------ Compiled with error(s): ------
Unknown Function

where the unknown functions is Ematrend. I thought it would have been recognized as Ematrend is available among MC indicators, but it seems it does not.
Any help appreciated, thanks
What do you mean by "uses the Ematrend addon as signal" ?

How are you applying it? Please give detail.

Leo
Posts: 63
Joined: 23 Sep 2015
Has thanked: 4 times
Been thanked: 2 times

Re: Compilation error

Postby Leo » 03 Oct 2015

Hi all, I'm trying to compile a trading systems which uses the Ematrend addon as signal. However I cannot compile it in Powerlanguage as I get the following error:

------ Compiled with error(s): ------
Unknown Function

where the unknown functions is Ematrend. I thought it would have been recognized as Ematrend is available among MC indicators, but it seems it does not.
Any help appreciated, thanks
What do you mean by "uses the Ematrend addon as signal" ?

How are you applying it? Please give detail.
Hi TJ,

Ematrend is a proprietary indicator available among MC's addons indicator list.
When trying to compile in Powerlanguage editor a trading system which uses Ematrend (in a way like if C>Ematrend then buy...) I get the above mentioned "unknown function" error.
Thus I think I've to get Ematrend recognized by MC.

regards

User avatar
TJ
Posts: 7232
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 991 times
Been thanked: 2058 times

Re: Compilation error

Postby TJ » 03 Oct 2015

Hi TJ,

Ematrend is a proprietary indicator available among MC's addons indicator list.
When trying to compile in Powerlanguage editor a trading system which uses Ematrend (in a way like if C>Ematrend then buy...) I get the above mentioned "unknown function" error.
Thus I think I've to get Ematrend recognized by MC.

regards

You have misunderstood the application.

Ematrend is an indicator. It plots a line on the chart.

Ematrend is NOT a function. You cannot apply it the way as you described.

User avatar
TJ
Posts: 7232
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 991 times
Been thanked: 2058 times

Re: Compilation error

Postby TJ » 03 Oct 2015

You can go to PLE for examples of using functions in signal.

eg.

AverageFC is a function.

You can find examples of AverageFC in the following Signals:

MovAvg Cross LE
MovAvg Cross LX
MovAvg Cross SE
MovAvg Cross SX

Please open the scripts and study the code.

User avatar
TJ
Posts: 7232
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 991 times
Been thanked: 2058 times

Re: Compilation error

Postby TJ » 03 Oct 2015

This article might be of help to you:

https://www.multicharts.com/trading-sof ... y_on_study

Leo
Posts: 63
Joined: 23 Sep 2015
Has thanked: 4 times
Been thanked: 2 times

Re: Compilation error

Postby Leo » 07 Oct 2015

Hi TJ,

Ematrend is a proprietary indicator available among MC's addons indicator list.
When trying to compile in Powerlanguage editor a trading system which uses Ematrend (in a way like if C>Ematrend then buy...) I get the above mentioned "unknown function" error.
Thus I think I've to get Ematrend recognized by MC.

regards

You have misunderstood the application.

Ematrend is an indicator. It plots a line on the chart.

Ematrend is NOT a function. You cannot apply it the way as you described.
Thanks TJ and yes, as I wrote Ematrend is an indicator.
Please let me paste a screenshot of the Powelangiage window so that I can show which kind of erro I get while trying to compile

https://gyazo.com/4a96591a11660bfb20a6ccc2a5d7f36b

As you can see, MC does not know what Ematrend is, even if it's among the available platform indicator.

User avatar
ABC
Posts: 636
Joined: 16 Dec 2006
Has thanked: 120 times
Been thanked: 359 times
Contact:

Re: Compilation error  [SOLVED]

Postby ABC » 07 Oct 2015

Leo,

you can't call indicators like you are trying to do. This is only doable with a function. Just because you have an indicator called "Ematrend" doesn't mean there is a function with the same name.
If the function doesn't exist you will receive the error message that you are seeing on your end.

There are two solutions now:

1. You could create a function that does what the Ematrend indicator does. However as you have pointed out this is an Addon and you likely can't access the source code of it. So this might not be a viable solution and you'd have to stick to option 2.

2. TJ posted a link for you in an earlier post on how to apply studies on studies. You can use the same approach within your signal and call an indicator, but you need to follow the syntax that the thread shows. As a hint you can try to apply your Ematrend as a study on the Custom 1 Line indicator and copy and paste the resulting input value into your strategy code. This will help finding out what exactly needs to be done.

Regards,
ABC

maxmax68
Posts: 161
Joined: 20 Nov 2012
Has thanked: 53 times
Been thanked: 47 times

Re: Compilation error

Postby maxmax68 » 12 Oct 2015

You can use the same approach within your signal and call an indicator, but you need to follow the syntax that the thread shows. As a hint you can try to apply your Ematrend as a study on the Custom 1 Line indicator and copy and paste the resulting input value into your strategy code. This will help finding out what exactly needs to be done.
Hi ABC,
kindly could you attach a few lines of code to show how to do that with Ematrend ?
It would be very useful to learn a new programming possibility.
Thanks in advance.

Massimo


Return to “MultiCharts”