Skip to content

Chaikin A/D Line

Chaikin A/D Line is a volume indicator that analyzes the relationship between price and volume changes

Method

tm.ta.ad(source_high, source_low, source_close, source_volume)

Inputs

ParameterArgument typeDescriptionDefault Value
source_highpd.SeriesHigh prices series-
source_lowpd.SeriesLow prices series-
source_closepd.SeriesClose prices series-
source_volumepd.SeriesVolume series-

Outputs

OutputType
adnp.ndarray

Example usage

strategy.py
import tradomate as tm
@tm.strategy()
def my_strategy(config: tm.TradomateConfig, data: tm.TradomateData):
# Trying out Average Directional Movement Index
ad = tm.ta.ad(data.high, data.low, data.close, data.volume)
# Get the last value and print
last_value = ad.iloc[-1]
tm.log(f"Last value of Average Directional Movement Index is {last_value}")
# Plot the values of ad
tm.plot(ad, title="Average Directional Movement Index", overlay=False)