passing Inputs between strategy and indicators fail

Questions about MultiCharts .NET and user contributed studies.
Ram
Posts: 90
Joined: 25 Nov 2014
Has thanked: 17 times
Been thanked: 5 times

passing Inputs between strategy and indicators fail

Postby Ram » 04 Jan 2015

Hi All,

I have a strategy based on an indicator which is based on a different indicator, all the three (1 strategy and 2 indicators) have the same input interface:

Code: Select all

<Input()> Public Property Big_Length As Integer
<Input()> Public Property Small_Length As Integer

Public Sub New(ByVal _ctx As Object)
MyBase.New(_ctx)
Me.Big_Length = 300
Me.Small_Length = 20
End Sub
I need both of the indicators to inherit the values set in the strategy inputs, so when loading the first indicator from the strategy i use this:

Code: Select all

Private MyInd As PowerLanguage.Indicator.Main_Tick_V4
MyInd = AddIndicator("Main_Tick_V4")
MyInd.Big_Length = Me.Big_Length
MyInd.Small_Length = Me.Small_Length
and then pass the same input values to the third indicator in the same way..

My problem is when i tried to optimize my results by setting the range of Me.Small_Length to 10 ~ 30 i got the same profit for every input... so I've added printouts for each indicator to see what is the input value it receives and indeed it looks like it doesn't inherit the values set by its parent creator and it keeps on using the default values..

Any thoughts will be highly appreciated!! :)

Thank you all and wish you a great year with lots of profits!
R.

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

Re: passing Inputs between strategy and indicators fail

Postby Henry MultiСharts » 05 Jan 2015

Hello Ram,

Are you able to replicate this behavior using prebuilt studies?
If you can do that - please send us (support@multicharts.com) the following information for further analysis:
- workspace you are using;
- in QuoteManager select the symbols you are using, make a right click on it->Export data->Export instrument (without data). Send us the QMD export file for analysis;
- in PowerLanguage .NET editor->File->Export->export the studies you are using for replicating this behavior; send us the pln file;
- instructions for replicating the error.

Ram
Posts: 90
Joined: 25 Nov 2014
Has thanked: 17 times
Been thanked: 5 times

Re: passing Inputs between strategy and indicators fail

Postby Ram » 05 Jan 2015

I'll make an example that replicates it, thx much!


Return to “MultiCharts .NET”