Use of Functions / Shared Code in VS  [SOLVED]

Questions about MultiCharts .NET and user contributed studies.
KaBo
Posts: 11
Joined: 17 Jul 2014
Has thanked: 4 times
Been thanked: 4 times

Use of Functions / Shared Code in VS

Postby KaBo » 17 Jul 2014

Hi everyone,

I have been evaluating MC.Net and I am a little confused about the integration with VS. I've read the documentation and some faq/forum. I am not a professional programmer, but have VS Pro and done some c# development.

When I want to use a certain calculation in my strategy and display as an indicator in the chart, I can either
a) copy/paste code into both (indicator / signal) and hope/try to keep the code in sync
b) use a function, which I can't edit or debug in VS

Q: So basically I can't develop or debug any shared code in VS?

From my understanding, most indicator calculations must be shared, because I can't display anything in the chart out of the strategy.
IMHO this is extremely inconvenient, but how do you handle this? Am I missing something major?

Cheers
KaBo

User avatar
Henry MultiСharts
Posts: 9041
Joined: 25 Aug 2011
Has thanked: 1247 times
Been thanked: 2898 times

Re: Use of Functions / Shared Code in VS

Postby Henry MultiСharts » 17 Jul 2014

Hello KaBo,

The functions created by the user in PowerLanguage .NET editor can be accessed from Visual Studio.
If you need to transfer values from the signal into an indicator - please see this post for more info: MultiCharts .NET FAQ
You can also use the new functionality we have introduced in MultiCharts 9.0 - an indicator can now plot the values received from a signal using IStrategyPerformance.SetPlotValue and IStrategyPerformance.GetPlotValue.
These users thanked the author Henry MultiСharts for the post:
KaBo

KaBo
Posts: 11
Joined: 17 Jul 2014
Has thanked: 4 times
Been thanked: 4 times

Re: Use of Functions / Shared Code in VS

Postby KaBo » 17 Jul 2014

Hello Henry,

thanks, I have to read up and play around with the indicator in strategy concept.

However, to the base question, you wrote:
Henry MultiСharts wrote:The functions created by the user in PowerLanguage .NET editor can be accessed from Visual Studio.

In the project files there are only the indicators and signals. I can't find a way to access functions in my VS environment, so could you please point me to some description to do it.

Cheers
KaBo

User avatar
Henry MultiСharts
Posts: 9041
Joined: 25 Aug 2011
Has thanked: 1247 times
Been thanked: 2898 times

Re: Use of Functions / Shared Code in VS  [SOLVED]

Postby Henry MultiСharts » 17 Jul 2014

You need to create the function in PowerLanguage .NET editor first.
Please go to PowerLanguage .NET editor->File->New->Function.
Create a function with the code that you need.
Now you can load it in VS.

KaBo
Posts: 11
Joined: 17 Jul 2014
Has thanked: 4 times
Been thanked: 4 times

Re: Use of Functions / Shared Code in VS

Postby KaBo » 17 Jul 2014

Sorry, my mistake, I was blind.

Thanks
KaBo


Return to “MultiCharts .NET”