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.
Yes of course, you have to code a custom SAR for that purpose:
1
2
3
4
5
6
7
8
9
a=SAR[0.02,0.02,0.2]
ifclose>athen
indi=a
else
indi=0
endif
returnindicoloured(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.
We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.Ok