MC .NET 8.5 Beta2 : Visual Basic MA Adaptive is not compatib  [SOLVED]

Questions about MultiCharts .NET and user contributed studies.
Emmanuel
Posts: 290
Joined: 21 May 2009
Has thanked: 69 times
Been thanked: 19 times

MC .NET 8.5 Beta2 : Visual Basic MA Adaptive is not compatib

Postby Emmanuel » 02 Jan 2013

Hi

As I installed MC .NET 8.5 Beta2, the following line don't work anymore :

Code: Select all

Me.m_adaptivemovavg1.effratiolength = New Lambda(Of Integer)( Function() Me.effratiolength)


I get the error : "value type of Lambda(Of Integer) not compatible with Integer"

How do I fix this error ? Your help would be greatly appreciated .


I use the example of the indicator Mov_Avg_Adaptive.vb of the attached example of the 8 august 2012 http://www.multicharts.com/discussion/viewtopic.php?f=20&t=10688

Code: Select all

        Protected Overrides Sub StartCalc()
            Me.m_price = MyBase.Bars.Close
            Me.m_adaptivemovavg1.price = Me.price
            Me.m_adaptivemovavg1.effratiolength = New Lambda(Of Integer)( Function() Me.effratiolength)
            Me.m_adaptivemovavg1.fastavglength = New Lambda(Of Integer)( Function() Me.fastavglength)
            Me.m_adaptivemovavg1.slowavglength = New Lambda(Of Integer)( Function() Me.slowavglength)
            Me.m_maa.DefaultValue = 0
        End Sub
Attachments
VB examples.zip
(159.6 KiB) Downloaded 138 times

bluejack
Posts: 42
Joined: 02 Aug 2012
Has thanked: 25 times
Been thanked: 27 times

Re: MC .NET 8.5 Beta2 : Visual Basic MA Adaptive is not comp  [SOLVED]

Postby bluejack » 03 Jan 2013

Did you try to directly specify Me.effratiolength instead of the new Lambda expressions?

I'm guessing from the error message that these length variables should be simple Integers.
It seems you have to do this:

Code: Select all

            Me.m_adaptivemovavg1.effratiolength = Me.effratiolength
            Me.m_adaptivemovavg1.fastavglength = Me.fastavglength
            Me.m_adaptivemovavg1.slowavglength = Me.slowavglength
These users thanked the author bluejack for the post (total 2):
EmmanuelHenry MultiСharts

Emmanuel
Posts: 290
Joined: 21 May 2009
Has thanked: 69 times
Been thanked: 19 times

Re: MC .NET 8.5 Beta2 : Visual Basic MA Adaptive is not comp

Postby Emmanuel » 04 Jan 2013

BlueJack you are a king !!!!


it works !!!!

MC team removed "New Lambda(Of Integer)( Function()"

Thank you !!!!!!

it is much better this way , it is simplified.

Emmanuel


Return to “MultiCharts .NET”