Skip to content

Weighted Close Price

WCLPRICE calculates the weighted close price based on high, low, and close.

Method

tm.ta.wclprice(source_high, source_low, source_close)

Inputs

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

Outputs

OutputType
wclpricenp.ndarray

Example usage

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