If this is in the wrong board, please move !
I am having a hard time with passing data to an indicator and use it in there. I must be badly overlooking something. I tried to find video tutorials about it, I have been looking for hours via Google, read the manuals, searched this forum, … found the question a dozen times asked, found a few marked as “thanks” a couple of times, but never found an example of a solution PLUS it working. Never.
Yesterday was I think the third time over the period of years, and today I am giving up on finding the solution myself. So now I am asking the community.
If it is impossible, then I hope that people in the future will find this post so for once and for all it becomes clear that what I want is not possible. But far better : if it works, a clear explanation of the how-to.
So just helping … maybe mainly myself. 🙂
The call from the ProRealCode program :
myDummy = CALL "DrawGain" [Gain] // Gain is unequal zero when in a position. Set Gain to 10 etc. if you like.
The super simple example of indicator code :
DefParam DRAWONLASTBARONLY = True
Gain = GainPar // This is in case it is required for ## notation in the line below.
DRAWTEXT(Gain, barindex, close, SansSerif,Bold,16)coloured(255,153,0) // This always shows the Default of the parameter (25 in this example).
Return Gain as "Gain" // This always returns a line at the value of 25.
The parameter and its default : (see 1st attachment).
The result in and out position, showing that the value is 25 always : (see 2nd attachment).
I have no troubles in returning values hence graphs etc. at all. It is only the passing of values TO the Indicator that I can’t get done. And I am as far that it is not possible. Still quite some posts “tell” that it works. This even includes a post from Nicolas where he tells that a (close) should be added at the end of the call. But still that does not help a thing. And I see nobody complain, so it must be me.
I think I have tried everything.
This is from the documentation :
myValue = CALL "my Personnal Indicator Name"[7,14]
a = myValue / 2
RETURN a
But this is a kind of pitfall because here the Call has to be from an indicator itself (see the RETURN). Thus this might work (I did not try it), but I can not use that either, unless my whole program code is to be moved to an indicator.
Hint for those who might be more creative than I am : When we define a variable to the ProRealCode program and use that for enumerating an optimisation, that variable DOES get passed to the Indicator. Thus, supposed I make a variable for optimization “Gain” in the main code and I let that enumerate from 1 to 10, then surely the 1 to 10 would be graphed and all. This must have been made explicitly (and is very useful), no matter how hidden that feature seems to be. But at least that proves that it can be done.
Peter