How to feed series from one strategy to another strategy  [SOLVED]

Questions about MultiCharts .NET and user contributed studies.
User avatar
orad
Posts: 121
Joined: 14 Nov 2012
Has thanked: 50 times
Been thanked: 20 times

How to feed series from one strategy to another strategy

Postby orad » 24 Nov 2015

I had a question that was answered by Henry in this other post, just adding here for reference:
Hi, how is AddIndicator different from SetPlotValue/GetPlotValue? Can you please point me to some docs on them in the wikis if there is any? Thanks!
Hello orad,

AddIndicator - allows your code to create an instance of an indicator with certain inputs and access the output values of this indicator programmatically, without physically applying this indicator to a chart.
SetPlotValue, GetPlotValue - allows sending information from an existing on chart instance of a signal or indicator to the receiving indicator applied to the same chart. Helps to avoid excessive programming and eliminate discrepancies between indicator and signal.
I have a few related questions: Can we use SetPlotValue and GetPlotValue to pass values from one strategy to another strategy?

If I have an object of type ISeries in one strategy, is there any way to use it directly in another strategy? I'm trying to avoid using shared function here because I don't want the function instance and all calculations to be duplicated in the two strategies that use it.

I know strategies on the same chart are run in the same synchronization context. With that in mind, if using global variables such as by using a ConcurrentDictionary how would you make sure the shared ISeries is initialized with values first before being used by the other strategy?

Thanks!

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

Re: How to feed series from one strategy to another strategy  [SOLVED]

Postby Henry MultiСharts » 08 Dec 2015

Hello orad,

All signals applied to the same chart form a single strategy. If you are referring to individual signals applied to the same chart then you can use SetPlotValue and GetPlotValue to pass values between studies applied to this chart.
If I have an object of type ISeries in one strategy, is there any way to use it directly in another strategy?
Please refer to the following topic.


Return to “MultiCharts .NET”