Skip to content

charton API


charton API / @chart-on/ta / psar

Function: psar() ​

psar(high, low, close, start, step, max, out?, state?): Float64Array

Defined in: trend.ts:334

Parabolic SAR: a stop that trails price and speeds up as the trend makes new extremes. The value at a bar is the stop in force during it. Each bar the stop moves factor of the way to the trend's extreme; the factor starts at start and grows by step on each new extreme, up to max. In an uptrend a low below the moved stop reverses the trend: the stop goes to the old extreme or the bar's high, whichever is higher. After that test the stop is kept at or below the lows of the two bars before (at or above their highs in a downtrend). This is the order of Wilder's rules most charts follow.

The first bar of a run sets nothing; the second starts an uptrend when its close is above the first's (stop from the first bar's low), else a downtrend (stop from its high), and can reverse at once. Lookback 1. A NaN input gives NaN and the next bar starts a new run.

Pass state to keep the trend for psarAt.

Parameters ​

high ​

Series

low ​

Series

close ​

Series

start ​

number

step ​

number

max ​

number

out? ​

Float64Array<ArrayBufferLike>

state? ​

PsarState

Returns ​

Float64Array