Summary: This heat study script generates values based on the overbought / oversold status of a single indicator. Returns: Overbought: - 1 Oversold : 1
' Assign the script parameters to script variables. _overboughtValue = overboughtValue _oversoldValue = oversoldValue ' Use for holding indicator keys based on the specified indicator key, indexed by symbol index. Redefine _indicatorKeys(SymbolCount() - 1) ' Iterate over all of the symbols. For i As Integer = 0 To SymbolCount() - 1 ' Create an indicator for each symbol, based on the specified indicator. _indicatorKeys(i) = IndicatorCopy(indicatorKey, i) Next
' Get the indicator value, indexed by bar index. Define value As Number = IndicatorValue(_indicatorKeys(symbolIndex)) ' Oversold. If (value < _oversoldValue) Then Return 1 ' Overbought. ElseIf (value > _overboughtValue) Then Return -1 End If Return 0