My own namespace for function  [SOLVED]

Questions about MultiCharts .NET and user contributed studies.
sylfvdk
Posts: 57
Joined: 06 Dec 2005

My own namespace for function

Postby sylfvdk » 14 May 2015

Hi,

1. I want to put all my Function/Indicator/Signals into my own Folder under Study folder in .Net Power Editor. Works fine.

Study -> Functions ... MC functions
Study -> Indicators ... MC Indicators
Study -> Signals ... MC Signals
Study -> MyFolder -> Functions ... My Functions
Study -> MyFolder -> Indicators ... My Indicators
Study -> MyFolder -> Signlas ... My Signals

2. As C# Developer I want that namespaces will reflect my new Folder structure, so I changed namespace for my function to : PowerLanguage.MyFolder.Functions.MyFunctionName...

Compiles and works perfect. However, the only thing is on Power Editor - my function is marked with Red Circle as not verified? But there is no any error and function works in run time perfect.

Why it is happening? Can I fix it?

novaleaf
Posts: 49
Joined: 17 Apr 2014
Has thanked: 9 times
Been thanked: 4 times

Re: My own namespace for function

Postby novaleaf » 14 May 2015

my idea, not verified:

it's a bit supprising to me that it works.... must mean that multicharts can use the binary compiled by visual studio. What version of visual studio are you using?

I think Power Editor expects all your code to be in it's single folder. if not, it won't watch the file for changes, meaning "hot editing" won't work.

sylfvdk
Posts: 57
Joined: 06 Dec 2005

Re: My own namespace for function

Postby sylfvdk » 15 May 2015

Yes, I agree with you. The only thing we can is just to create new folders only(!) under Power Language Editor which still keeps everything within single folder on the disk.
We should never mess with namespaces, will not work.

User avatar
Henry MultiСharts
Posts: 9165
Joined: 25 Aug 2011
Has thanked: 1264 times
Been thanked: 2957 times

Re: My own namespace for function  [SOLVED]

Postby Henry MultiСharts » 15 May 2015

Hello sylfvdk

PowerLanguage .NET Editor searches for functions only inside PowerLanguage.Function namespace.
If a function is declared in a different namespace - PowerLanguage .NET Editor does not treat it as a function, but as a class.

The Red or Green indication next to a study in the PowerLanguage .NET Editor is not only compiled/cont compiled status, but also ready/not ready and verified as its type or not. So the study can be compiled and ready, but not treated as its type (a function) by PowerLanguage .NET Editor. In this case it will work ok, but will have a red indication next to it in the editor.

sylfvdk
Posts: 57
Joined: 06 Dec 2005

Re: My own namespace for function

Postby sylfvdk » 15 May 2015

Thanks, Henry, that explains the things ...


Return to “MultiCharts .NET”