Can a C# function be called from a VB indicator?

Questions about MultiCharts .NET and user contributed studies.
SSS
Posts: 14
Joined: 01 Apr 2013
Has thanked: 10 times
Been thanked: 2 times

Can a C# function be called from a VB indicator?

Postby SSS » 17 May 2014

I have a function written in C#, which I am now calling from an indicator also written in C#.

I'm trying to re-write the indicator in Visual Basic, and don't want to spend time re-coding the function in VB.

Can I call the C# function from a VB indicator? If so, how?

I've tired but I'm getting a compiler error that the function doesn't exist.



And I have another VB-related question...
The code below is taken from the built-in indicator Moving_Average_2_lines.

Code: Select all

' Properties
<Input> _
Public Property displace As Integer

<Input()> _
Public Property fastlength As Integer

Private Property price As ISeries(Of Double)

<Input()> _
Public Property slowlength As Integer
The very first line uses <Input> but the subsequent lines use <Input()> with parentheses. What is the difference?

Thanks in advance.

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

Re: Can a C# function be called from a VB indicator?

Postby Henry MultiСharts » 19 May 2014

Hello SSS,

In .Net there is no difference whether the code is VB or C#. All of the built-in VB studies are calling the functions written in C#. You can use these studies for reference.
The very first line uses <Input> but the subsequent lines use <Input()> with parentheses. What is the difference?
There is no difference. Both instances are correct and working.


Return to “MultiCharts .NET”