Summary: This analyst script is used to determine whether an underlying indicator is overbought or oversold. Values: 1. 0 - Not overbought or oversold. 2. -100 - Overbought. 3. 100 - Oversold.
Define value As Number = IndicatorValue(_analyzedIndicatorKey, barIndex) ' Check for an overbought condition. If (value > _overboughtValue) Then Return -100 End If ' Check for an oversold condition. If (value < _oversoldValue) Then Return 100 End If Return 0
' Assign the script parameters to script variables. _analyzedIndicatorKey = analyzedIndicatorKey _overboughtValue = overboughtValue _oversoldValue = oversoldValue