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
| 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 | - |
Outputs
| Output | Type |
|---|---|
| ad | np.ndarray |
Example usage
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)