Skip to content

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

ParameterArgument typeDescriptionDefault Value
source_highpd.SeriesHigh prices series-
source_lowpd.SeriesLow prices series-
source_closepd.SeriesClose prices series-
source_volumepd.SeriesVolume series-
fastperiodintFast period for the indicator3
slowperiodintSlow period for the indicator10

Outputs

OutputType
adoscnp.ndarray

Example usage

strategy.py
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)