Hello all,
I’m seeking clarification on whether it is possible to segment an indicator so that only parts of it are shown.
Say, for example that we have a Parabolic SAR plotted around price.
Is it possible to code the indicator in such a way that it is only shown when below the price? In other words, when the PSAR i above the price, the indicator should return nothing.
Many thanks,
From8to800
Yes of course, you have to code a custom SAR for that purpose:
a = SAR[0.02,0.02,0.2]
if close>a then
indi=a
else
indi=0
endif
return indi coloured(0,200,0) style(point,3)
To hide the PSAR, we set our variable to 0 (because there is no other way to set a variable to an empty value), so remember to change the vertical autoscaling in the price settings window.
Hi Nicola,
Many thanks for your response.
I guess that works too. I tend to prefer my charts vertically adjusted for indicators also, but I can live with it adjusted on price only.
Once again, thank you!
From8to800