Ultimate Oscillator
ULTOSC combines multiple timeframes to identify overbought and oversold conditions.
Method
tm.ta.ultosc(source_high, source_low, source_close, timeperiod1, timeperiod2, timeperiod3)
Inputs
Parameter | Argument type | Description | Default Value |
---|---|---|---|
source_high | pd.Series | High prices series | - |
source_low | pd.Series | Low prices series | - |
source_close | pd.Series | Close prices series | - |
timeperiod1 | int | First time period | 7 |
timeperiod2 | int | Second time period | 14 |
timeperiod3 | int | Third time period | 28 |
Outputs
Output | Type |
---|---|
ultosc | np.ndarray |
Example usage
import tradomate as tm
@tm.strategy()def my_strategy(config: tm.TradomateConfig, data: tm.TradomateData):
# Trying out Ultimate Oscillator ultosc = tm.ta.ultosc(data.high, data.low, data.close, timeperiod1=7, timeperiod2=14, timeperiod3=28)
# Get the last value and print last_value = ultosc.iloc[-1] tm.log(f"Last value of Ultimate Oscillator is {last_value}")
# Plot the values of ultosc tm.plot(ultosc, title="Ultimate Oscillator", overlay=False)