% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/ta_CDLSHORTLINE.R
\name{short_line}
\alias{short_line}
\alias{CDLSHORTLINE}
\title{Short Line Candle}
\usage{
short_line(x, cols, na.bridge = FALSE, ...)
}
\arguments{
\item{x}{An OHLC-V series coercible to \link{data.frame}.}

\item{cols}{(\link{formula}). An optional \code{4}-variable \link{formula} selecting columns from \code{x} via \link{model.frame}.
Defaults to \code{~open + high + low + close}.}

\item{na.bridge}{(\link{logical}). A \link{logical} of \link{length} 1. \link{FALSE} by
default. When \link{FALSE}, input \code{NA}s propagate through the TA-Lib C
routine (most indicators will fill the remaining output with
\code{NA}). When \link{TRUE}, input \code{NA} rows are stripped before
computation and re-inserted at the original positions in the
output, causing the indicator to treat non-consecutive non-\code{NA}
observations as if they were adjacent — see the \strong{Handling of
\code{NA} values} section above for the consequences.}

\item{...}{Additional parameters passed into \link{model.frame}.}
}
\value{
An object of same \link{class} and \link{length} of \code{x}:

\describe{
\item{CDLSHORTLINE}{\link{integer}}
}

Pattern codes depend on \code{options(talib.normalize)}:
\itemize{
\item If \code{TRUE}: \code{1} = identified pattern; \code{-1} = identified bearish pattern.
\item If \code{FALSE}: \code{100} = identified pattern; \code{-100} = identified bearish pattern.
\item \code{0} = no pattern.
}
}
\description{
\code{short_line()} is a generic S3 function that preserves
the input \link{class}: \link{data.frame} in, \link{data.frame} out; \link{matrix} in,
\link{matrix} out.
\subsection{Handling of \code{NA} values}{

Every indicator always emits \strong{leading \code{NA}s} for the initial
lookback period - positions where there is not yet enough data to
produce a result. This is separate from how \code{NA}s already present
in the input are handled, which is controlled by the \code{na.bridge}
argument:

\describe{
\item{\code{na.bridge = FALSE} (default)}{The input is passed to the
underlying TA-Lib C routine as-is. Because most indicators smooth
across time (EMA, RSI, MACD, Bollinger Bands, ...), a single
\code{NA} in the input typically propagates forward and \strong{poisons
every subsequent value} - it is common for one missing
observation to produce an output that is entirely \code{NA} from that
position onward. This mode is the right choice when you want to
\emph{see} the missing data in the output rather than silently
compute around it.}
\item{\code{na.bridge = TRUE}}{\code{NA} rows are stripped from the input
before the C routine runs; the indicator is computed on the
resulting dense series; results are then re-expanded to the
original length with \code{NA} inserted at every position the input
had \code{NA}. Output length always matches input length, so the
result can be joined back to the source \code{data.frame} by row.

\strong{Consequence to understand before enabling:} bridging causes
the indicator to treat non-consecutive observations as
consecutive. A 14-period RSI with \code{na.bridge = TRUE} over a
series containing a month-long gap will compute using 14
observations that span several real-world months as if they were
14 adjacent trading days. For sparse missing values (e.g. a
single missing tick) this is harmless; for clustered gaps (e.g.
a delisted period, a weekend encoded as \code{NA}) the output is
correctly aligned \emph{by position} but economically meaningless
across the gap. Inspect gap structure with \code{which(is.na(x))}
before enabling on low-quality time series.}
}
}
}
\details{
General options for candlestick pattern recognition:

\describe{
\item{N}{\link{integer}. Controls the number of candles to consider when identifying patterns.}
\item{alpha}{\link{double}. A sensitivity parameter when identifying patterns.}
}

Available options and their defaults:
\describe{
\item{BodyLong}{(N = 10, alpha = 1.0). Real body is long when it's longer than the average of the 10 previous candles' real body.}
\item{BodyVeryLong}{(N = 10, alpha = 3.0). Real body is very long when it's longer than 3 times the average of the 10 previous candles' real body.}
\item{BodyShort}{(N = 10, alpha = 1.0). Real body is short when it's shorter than the average of the 10 previous candles' real bodies.}
\item{BodyDoji}{(N = 10, alpha = 0.1). Real body is like doji's body when it's shorter than 10\% the average of the 10 previous candles' high-low range.}
\item{ShadowLong}{(N = 0, alpha = 1.0). Shadow is long when it's longer than the real body.}
\item{ShadowVeryLong}{(N = 0, alpha = 2.0). Shadow is very long when it's longer than 2 times the real body.}
\item{ShadowShort}{(N = 0, alpha = 1.0). Shadow is short when it's shorter than half the average of the 10 previous candles' sum of shadows.}
\item{ShadowVeryShort}{(N = 10, alpha = 0.1). Shadow is very short when it's shorter than 10\% the average of the 10 previous candles' high-low range.}
\item{Near}{(N = 5, alpha = 0.2). When measuring distance between parts of candles or width of gaps "near" means "<=20\% of the average of the 5 previous candles high low range."}
\item{Far}{(N = 5, alpha = 0.6). When measuring distance between parts of candles or width of gaps "far" means ">= 60\% of the average of the 5 previous candles high-low range."}
\item{Equal}{(N = 5, alpha = 0.05). When measuring distance between parts of candles or width of gaps "equal" means "<= 5\% of the average of the 5 previous candles high-low range."}
}

The options can be modified by running \code{options(talib.BodyLong.N = 5, talib.BodyLong.alpha = 0.2)}. See \code{vignette("candlestick")} for more details.
}
\examples{
## load Bitcoin (BTC)
## series
data(BTC, package = "talib")

## calculate the indicator
## for Bitcoin (BTC)
output <- talib::short_line(BTC)

## display the results
utils::tail(output)

## visualize the indicator
## with talib::chart()
##
## see ?talib::chart or ?talib::indicator
## for more details
{
 ## chart OHLC-V
 ## series with talib::chart()
 talib::chart(BTC)

 ## chart indicator
 ## with default values
 talib::indicator(
     talib::short_line
 )
}
}
\seealso{
Other Pattern Recognition:
\code{\link[=abandoned_baby]{abandoned_baby()}},
\code{\link[=advance_block]{advance_block()}},
\code{\link[=belt_hold]{belt_hold()}},
\code{\link[=break_away]{break_away()}},
\code{\link[=closing_marubozu]{closing_marubozu()}},
\code{\link[=concealing_baby_swallow]{concealing_baby_swallow()}},
\code{\link[=counter_attack]{counter_attack()}},
\code{\link[=dark_cloud_cover]{dark_cloud_cover()}},
\code{\link[=doji]{doji()}},
\code{\link[=doji_star]{doji_star()}},
\code{\link[=dragonfly_doji]{dragonfly_doji()}},
\code{\link[=engulfing]{engulfing()}},
\code{\link[=evening_doji_star]{evening_doji_star()}},
\code{\link[=evening_star]{evening_star()}},
\code{\link[=gaps_side_white]{gaps_side_white()}},
\code{\link[=gravestone_doji]{gravestone_doji()}},
\code{\link[=hammer]{hammer()}},
\code{\link[=hanging_man]{hanging_man()}},
\code{\link[=harami]{harami()}},
\code{\link[=harami_cross]{harami_cross()}},
\code{\link[=high_wave]{high_wave()}},
\code{\link[=hikakke]{hikakke()}},
\code{\link[=hikakke_mod]{hikakke_mod()}},
\code{\link[=homing_pigeon]{homing_pigeon()}},
\code{\link[=in_neck]{in_neck()}},
\code{\link[=inverted_hammer]{inverted_hammer()}},
\code{\link[=kicking]{kicking()}},
\code{\link[=kicking_baby_length]{kicking_baby_length()}},
\code{\link[=ladder_bottom]{ladder_bottom()}},
\code{\link[=long_legged_doji]{long_legged_doji()}},
\code{\link[=long_line]{long_line()}},
\code{\link[=marubozu]{marubozu()}},
\code{\link[=mat_hold]{mat_hold()}},
\code{\link[=matching_low]{matching_low()}},
\code{\link[=morning_doji_star]{morning_doji_star()}},
\code{\link[=morning_star]{morning_star()}},
\code{\link[=on_neck]{on_neck()}},
\code{\link[=piercing]{piercing()}},
\code{\link[=rickshaw_man]{rickshaw_man()}},
\code{\link[=rise_fall_3_methods]{rise_fall_3_methods()}},
\code{\link[=separating_lines]{separating_lines()}},
\code{\link[=shooting_star]{shooting_star()}},
\code{\link[=spinning_top]{spinning_top()}},
\code{\link[=stalled_pattern]{stalled_pattern()}},
\code{\link[=stick_sandwich]{stick_sandwich()}},
\code{\link[=takuri]{takuri()}},
\code{\link[=tasuki_gap]{tasuki_gap()}},
\code{\link[=three_black_crows]{three_black_crows()}},
\code{\link[=three_identical_crows]{three_identical_crows()}},
\code{\link[=three_inside]{three_inside()}},
\code{\link[=three_line_strike]{three_line_strike()}},
\code{\link[=three_outside]{three_outside()}},
\code{\link[=three_stars_in_the_south]{three_stars_in_the_south()}},
\code{\link[=three_white_soldiers]{three_white_soldiers()}},
\code{\link[=thrusting]{thrusting()}},
\code{\link[=tristar]{tristar()}},
\code{\link[=two_crows]{two_crows()}},
\code{\link[=unique_3_river]{unique_3_river()}},
\code{\link[=upside_gap_2_crows]{upside_gap_2_crows()}},
\code{\link[=xside_gap_3_methods]{xside_gap_3_methods()}}
}
\author{
Serkan Korkmaz
}
\concept{Pattern Recognition}
\concept{algorithmic trading}
\concept{finance}
\concept{technical analysis}
\concept{trading}
