Skip to content

On-Neck Pattern

On-Neck Pattern is a bearish continuation pattern formed by two consecutive candles, where the second closes slightly below the first.

Method

tm.ta.cdlonneck(source_open, source_high, source_low, source_close)

Inputs

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

Outputs

OutputType
cdlonnecknp.ndarray

Example usage

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