Access indicators on the chart within another indicator

Created at 12 Aug 2019, 12:52
How’s your experience with the cTrader Platform?
Your feedback is crucial to cTrader's development. Please take a few seconds to share your opinion and help us improve your trading experience. Thanks!
ChrisCz's avatar

ChrisCz

Joined 26.07.2019

Access indicators on the chart within another indicator
12 Aug 2019, 12:52


I want to access indicator values from my chart in another indicator, to display the value or work with it inside the second indicator. Essentially what  the Market Snapshot does. But I can't find the API function giving me access to the other indicator results. EG: On the chart below is a Hull-MA and I want to display the value, like I do with the ATR in the top left corner. (The ATR is calculated within the ChartText function, but I would like to avoid doing that for other indicators already on the chart)


@ChrisCz
Replies

PanagiotisCharalampous
12 Aug 2019, 14:22

Hi Christian,

Thanks for posting in our forum, You can find an example of how to call an indicator inside another indicator here. Let me know if this helps.

Best Regards,

Panagiotis


@PanagiotisCharalampous

ChrisCz
12 Aug 2019, 16:28 ( Updated at: 21 Dec 2023, 09:21 )

Hi Panagiotis,

unfortunatly not really, as the reason I want to access the indicator on the chart is, that I don't want to take care of the indicator values inside the second indicator. Changing the indicator values on the chart gives new indicartor results. If I don't set the second indicator (referencing the one on the chart) to the same changed values, I have different results.

EG: I have a customMA (period 14) on the chart. My Chartvaluesindicator references that customMA and I have to submit the period 14 as I understand it

(_HMA = Indicators.GetIndicator<HullMovingAverage>(Source, 35, 14, 14);

If I now change the values of the HullMovingAverage on my chart, but not the referenced one in the chartvalues indicator, they show different results.

The Market Snapshot is obviously accessing the values of the indicators in the chart area and I would love to know how.


@ChrisCz

PanagiotisCharalampous
12 Aug 2019, 16:29

Hi Christian,

There is no way to access the actual indicators plotted on the chart.

Best Regards,

Panagiotis


@PanagiotisCharalampous

ChrisCz
12 Aug 2019, 16:35

Is there maybe some kind of Global Variables or Datasets, which can be shared by all indicators on one chart or maybe even over multiple charts? 

It would open really interesting possibilities.


@ChrisCz

PanagiotisCharalampous
12 Aug 2019, 17:49

Hi Christian,

No there isn't. You could consider using a file instead.

Best Regards,

Panagiotis


@PanagiotisCharalampous