Chaikin A/D Oscillator
ADOSC is the difference between two Chaikin A/D Line values.
Method
tm.ta.adosc(source_high, source_low, source_close, source_volume, fastperiod, slowperiod)
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 | - |
source_volume | pd.Series | Volume series | - |
fastperiod | int | Fast period for the indicator | 3 |
slowperiod | int | Slow period for the indicator | 10 |
Outputs
Output | Type |
---|---|
adosc | np.ndarray |
Example usage
import tradomate as tm
@tm.strategy()def my_strategy(config: tm.TradomateConfig, data: tm.TradomateData):
# Trying out Chaikin A/D Oscillator adosc = tm.ta.adosc(data.high, data.low, data.close, data.volume, fastperiod=3, slowperiod=10)
# Get the last value and print last_value = adosc.iloc[-1] tm.log(f"Last value of Chaikin A/D Oscillator is {last_value}")
# Plot the values of adosc tm.plot(adosc, title="Chaikin A/D Oscillator", overlay=False)