Passing Values from an Indicator to a Signal/Strategy

Questions about MultiCharts and user contributed studies.
eegroup
Posts: 78
Joined: 04 Aug 2008
Has thanked: 11 times
Been thanked: 9 times

Passing Values from an Indicator to a Signal/Strategy

Postby eegroup » 29 Oct 2021

The documentation for i_setplotvalue and i_getplotvalue keywords says:

Gets the value calculated by a signal that is to be used for plotting from an indicator. It can be considered as a bridge between a signal and an indicator. Using i_setplotvalue and i_getplotvalue keywords makes it possible to avoid copying the same script for calculation the same value in both indicator and signal.

Is there any way to pass values the other way around, from an indicator to a signal/strategy beside using Global Variables?

Thanks!

Mydesign
Posts: 177
Joined: 15 Feb 2017
Has thanked: 32 times
Been thanked: 39 times

Re: Passing Values from an Indicator to a Signal/Strategy

Postby Mydesign » 02 Nov 2021

Is there any way to pass values the other way around, from an indicator to a signal/strategy beside using Global Variables?
Yes. You can use a function as the middleman to retrieve it with i_getplotvalue, then call that function from your signal.

Mydesign
Posts: 177
Joined: 15 Feb 2017
Has thanked: 32 times
Been thanked: 39 times

Re: Passing Values from an Indicator to a Signal/Strategy

Postby Mydesign » 10 Nov 2021

I hope my answer was helpfull to someone... :roll:

eegroup
Posts: 78
Joined: 04 Aug 2008
Has thanked: 11 times
Been thanked: 9 times

Re: Passing Values from an Indicator to a Signal/Strategy

Postby eegroup » 12 Feb 2022

Very good suggestion. Thank you!


Return to “MultiCharts”