List of technical analysis indicators

1. Trend Indicators

1.1. EMA (Exponential Moving Average)

EMA is a moving average line calculated with a weighting system that assigns greater importance to more recent price data. EMA reacts faster to price changes, helping investors grasp market trends promptly.

def ema(column: pandas.core.series.Series, window: int)

Parameter

Parameter
Meaning
Data type
Default

column

The data column (series) contains the values for calculating EMA.

pandas.Series

window

Number of data points used in the EMA calculation.

int

Example

fi = client.FiinIndicator()
df['ema_5'] = fi.ema(df['close'], window = 5)
print(df)

1.2. SMA (Simple Moving Average)

SMA is a simple moving average, an indicator calculated by taking the arithmetic mean of prices over a specified period.

def sma(column: pandas.core.series.Series, window: int)

Parameter

Parameter
Meaning
Data type
Default

column

The data column (series) contains the values for calculating SMA.

pandas.Series

window

Number of data points used in the SMA calculation.

int

Example:

fi = client.FiinIndicator()
df['sma_5'] = fi.sma(df['close'], window = 5)
print(df)

1.3. WMA (Weighted Moving Average)

WMA is a weighted linear moving average. This indicator is more sensitive and closely tracks market price fluctuations. WMA assigns different weights to each value in the data series, with the highest weights given to the most recent data and gradually decreasing for older values. This characteristic makes the WMA line more sensitive and "smoother" compared to SMA or EMA moving averages.

def wma(column: pandas.core.series.Series, window: int)

Parameter

Parameter
Meaning
Data type
Default

column

The data column (series) contains the values for calculating WMA.

pandas.Series

window

Number of data points used in the WMA calculation.

int

Example:

fi = client.FiinIndicator()
df['wma'] = fi.wma(df['close'], window = 14)
print(df)

1.4. MACD (Moving Average Convergence Divergence)

MACD is one of the most widely used technical analysis tools by traders. It helps measure the momentum, direction, and strength of a price trend.

Structure:

  • MACD Line: The difference between a short-term EMA (typically 12 days) and a long-term EMA (typically 26 days).

  • Signal Line: The EMA of the MACD line (typically 9 days).

  • MACD Histogram: The difference between the MACD line and the Signal line.

def macd(column: pandas.core.series.Series, window_slow: int = 26, window_fast: int = 12)

def macd_signal(column: pandas.core.series.Series, window_slow: int = 26, window_fast: int = 12, window_sign: int = 9)

def macd_diff(column: pandas.core.series.Series, window_slow: int = 26, window_fast: int = 12, window_sign: int = 9)

Parameter

Paramter
Description
Data type
Default

column

The data column (series) containing the values for calculating MACD.

pandas.Series

window_slow

Number of data points used for the long-term EMA in the MACD calculation.

int

26

window_fast

Number of data points used for the short-term EMA in the MACD calculation.

int

12

window_sign

Number of data points used for the EMA in the MACD Signal calculation.

int

9

Example:

fi = client.FiinIndicator()
df['macd'] = fi.macd(df['close'], window_fast=12, window_slow=26)
df['macd_signal'] = fi.macd_signal(df['close'], window_fast=12, window_slow=26, window_sign=9)
df['macd_diff'] = fi.macd_diff(df['close'], window_fast=12, window_slow=26, window_sign=9)
print(df)

1.5. ADX (ADXIndicator)

ADX is an oscillating indicator tool used to determine the strength of a trend. It's commonly used to identify whether a market is trending sideways (sideway market) or has begun a new trend. Initially, this indicator was widely used in commodity markets but has since expanded to many other financial markets, such as stocks, forex, and cryptocurrencies.

def adx(high: pandas.core.series.Series, low: pandas.core.series.Series, close: pandas.core.series.Series, window: int = 14)

def adx_neg(high: pandas.core.series.Series, low: pandas.core.series.Series, close: pandas.core.series.Series, window: int = 14)

def adx_pos(high: pandas.core.series.Series, low: pandas.core.series.Series, close: pandas.core.series.Series, window: int = 14)

Tham số

Paramter
Meaning
Data type
Default

low

The data column containing the lowest price values for ADX calculation.

pandas.Series

high

The data column containing the highest price values for ADX calculation.

pandas.Series

close

The data column containing the closing price values for ADX calculation.

pandas.Series

window

Number of data points used in the ADX calculation.

int

14

Example:

fi = client.FiinIndicator()
df['adx'] = fi.adx(df['high'], df['low'], df['close'], window=14)
df['adx_neg'] = fi.adx_neg(df['high'], df['low'], df['close'], window=14)
df['adx_pos'] = fi.adx_pos(df['high'], df['low'], df['close'], window=14)
print(df)

1.6. PSAR (Parabolic Stop and Reverse)

PSAR is a technical indicator developed by J. Welles Wilder Jr., used to determine price trends and reversal points in trading. PSAR lies below the price during an uptrend and above the price during a downtrend, helping traders identify support or resistance levels. When the price crosses PSAR, the trend may reverse. This indicator is easy to use, especially effective in strongly trending markets, but can generate noisy signals in sideways markets.

def psar(self, high: pd.Series, low: pd.Series, close: pd.Series, step: float = 0.02, max_step: float = 0.2)

Parameter

Parameter
Description
Data type
Default

high

Column containing highest price values.

pandas.Series

low

Column containing lowest price values.

pandas.Series

close

Column containing closing price values.

pandas.Series

step

Initial Acceleration Factor (AF) in the calculation process. A smaller step means PSAR reacts slower to price changes, suitable for less volatile markets. A larger step means PSAR is more sensitive, quickly catching changes but potentially generating noisy signals.

float

0.02

max_step

Maximum value the Acceleration Factor (AF) can reach.

float

0.2

Example:

fi = client.FiinIndicator()
df['psar'] = fi.psar(df['high'], df['low'], df['close'], step=0.02, max_step=0.2)
print(df)

1.7. Ichimoku (Ichimoku Kinko Hyo)

Ichimoku is a technical indicator developed by Goichi Hosoda. It helps assess trends, support, resistance levels, and provides buy/sell signals within a single chart. The indicator consists of five main components: Tenkan-sen, Kijun-sen, Senkou Span A, Senkou Span B, and Chikou Span, forming a "cloud" (Kumo) that reflects market dynamics. Ichimoku is particularly effective in clearly trending markets, assisting traders in making decisions based on price equilibrium.

def ichimoku_a(self, high: pd.Series, low: pd.Series, close: pd.Series, window1: int = 9, window2: int = 26, window3: int = 52) -> pd.Series: ...
def ichimoku_b(self, high: pd.Series, low: pd.Series, close: pd.Series, window1: int = 9, window2: int = 26, window3: int = 52) -> pd.Series: ...
def ichimoku_base_line(self, high: pd.Series, low: pd.Series, close: pd.Series, window1: int = 9, window2: int = 26, window3: int = 52) -> pd.Series: ...
def ichimoku_conversion_line(self, high: pd.Series, low: pd.Series, close: pd.Series, window1: int = 9, window2: int = 26, window3: int = 52) -> pd.Series: ...
def ichimoku_lagging_line(self, high: pd.Series, low: pd.Series, close: pd.Series,
    window1: int = 9, window2: int = 26, window3: int = 52) -> pd.Series: ...

Parameter

Parameter
Description
Data type
Default

high

Column containing highest price values.

pandas.Series

low

Column containing lowest price values.

pandas.Series

close

Column containing closing price data.

pandas.Series

window1

Number of data points used for the Conversion Line (Tenkan-sen).

int

9

window2

Number of data points used for the Base Line (Kijun-sen) and for translating lines like Chikou Span and Senkou Span A/B.

int

26

window3

Number of data points used for the Senkou Span B line.

int

52

Example

fi = client.FiinIndicator()
df['senkou_span_a'] = fi.ichimoku_a(df['high'], df['low'], df['close'], window1 = 9, window2 = 26, window3 = 52)
df['senkou_span_b'] = fi.ichimoku_b(df['high'], df['low'], df['close'], window1 = 9, window2 = 26, window3 = 52)
df['kijun_sen'] = fi.ichimoku_base_line(df['high'], df['low'], df['close'], window1 = 9, window2 = 26, window3 = 52) 
df['tenkan_sen'] = fi.ichimoku_conversion_line(df['high'], df['low'], df['close'], window1 = 9, window2 = 26, window3 = 52)
print(df)

1.8. CCI (Commodity Channel Index)

CCI is a technical indicator developed by Donald Lambert used to measure the deviation of price from its average over a period, helping to identify overbought or oversold conditions. When CCI goes above 100, the price might be overbought, and when below -100, the price might be oversold. This indicator is suitable for detecting new trends or signaling potential reversals.

def cci(self, high: pd.Series, low: pd.Series, close: pd.Series, window: int = 20, constant: float = 0.015) -> pd.Series: ...

Parameter

Parameter
Description
Data type
Default

high

Column containing the highest price values.

pandas.Series

low

Column containing the lowest price values.

pandas.Series

close

Column containing closing price values.

pandas.Series

window

Number of data points used for the SMA and Mean Deviation.

int

20

constant

Constant for normalization to ensure CCI values oscillate within a defined range.

float

0.015

Example:

fi = client.FiinIndicator()
df['cci'] = fi.cci(df['high'], df['low'], df['close'], window = 20, constant = 0.015)
print(df)

1.9. Aroon

Aroon is a technical indicator developed by Tushar Chande, used to measure trend strength and identify the beginning or end of a trend. The indicator consists of two main components: Aroon-Up (tracking the highest high) and Aroon-Down (tracking the lowest low) over a specified period. Values range from 0 to 100, with high values indicating a strong trend and low values indicating a weakening trend. Aroon is particularly useful for detecting accumulation phases or reversals in the market.

def aroon(self, high: pd.Series, low: pd.Series, window: int = 25) -> pd.Series: ...
def aroon_up(self, high: pd.Series, low: pd.Series, window: int = 25) -> pd.Series: ... 
def aroon_down(self, high: pd.Series, low: pd.Series, window: int = 25) -> pd.Series: ...

Parameter

Parameter
Description
Data type
Default value

high

Column containing the highest price values.

pandas.Series

low

Column containing the lowest price values.

pandas.Series

window

Number of data points used for the SMA and Mean Deviation.

int

25

Example:

fi = client.FiinIndicator()
df['aroon'] = fi.aroon(df['high'], df['low'], window: int = 25)
df['aroon_up'] = fi.aroon_up(df['high'], df['low'], window: int = 25)
df['aroon_down'] = fi.aroon_down(df['high'], df['low'], window: int = 25)
print(df)

2. Momentum Indicators (Chỉ báo động lượng)

2.1. RSI (Relative Strength Index)

RSI is an indicator that measures the speed and magnitude of recent price changes to assess whether an asset is overbought or oversold.

RSI is calculated based on closing prices over a specific period (typically 14 days).

This index fluctuates between 0 and 100.

  • RSI above 70: This is the overbought zone; the asset may have risen too quickly and could be due for a downward correction.

  • RSI below 30: This is the oversold zone; the asset may have fallen too deeply and could be due for a rebound.

def rsi(column: pandas.core.series.Series, window: int = 14)

Parameter

Parameter
Description
Data type
Default value

column

Column (series) containing the values for calculating RSI.

pandas.Series

window

Number of data points used in the RSI calculation.

int

14

Example:

fi = client.FiinIndicator()
df['rsi'] = fi.rsi(df['close'], window=14)
print(df)

2.2. Stochastic

The Stochastic Oscillator is an effective technical analysis tool that helps assess price momentum and potential reversals, identifying potential buy/sell zones in the market.

Structure:

  • %K line: This line compares the current closing price of the security with its highest and lowest price range over a specified period. Above 80 indicates the security might be overbought, with a potential for price correction downwards. Below 20 suggests the security might be oversold, with a potential for price recovery.

  • %D line: This is the Simple Moving Average (SMA) of the %K line, helping to smooth out short-term fluctuations.

Both %K and %D oscillate between 0 and 100.

def stoch(high: pandas.core.series.Series, low: pandas.core.series.Series, close: pandas.core.series.Series, window: int = 14, smooth_window: int = 3)

def stoch_signal(high: pandas.core.series.Series, low: pandas.core.series.Series, close: pandas.core.series.Series, window: int = 14, smooth_window: int = 3)

Parameter

Parameter
Description
Data type
Default value

low

Column containing the lowest price values for Stochastic calculation.

pandas.Series

high

Column containing the highest price values for Stochastic calculation.

pandas.Series

close

Column containing closing price values for Stochastic calculation.

pandas.Series

window

Number of data points used in the Stochastic calculation.

int

14

smooth_window

Number of data points used in the Stochastic Signal calculation by taking the SMA of Stochastic.

int

3

Example:

fi = client.FiinIndicator()
df['stoch'] = fi.stoch(df['high'], df['low'], df['close'], window=14)
df['stoch_signal'] = fi.stoch_signal(df['high'], df['low'], df['close'], window=14, smooth_window=3)
print(df)

3. Volatility Indicators

3.1. Bollinger Bands

Bollinger Bands is a technical analysis tool developed by John Bollinger in the 1980s. Bollinger Bands help measure price volatility and identify potential high/low price levels within a trend.

Structure:

  • Centerline: A moving average (typically a 20-day SMA) of the price.

  • Upper Band: A specified number of standard deviations (typically 2) calculated from the centerline, added to the centerline's value.

  • Lower Band: A specified number of standard deviations (typically 2) calculated from the centerline, subtracted from the centerline's value.

def bollinger_hband(column: pandas.core.series.Series, window: int = 20, window_dev: int = 2)

def bollinger_lband(column: pandas.core.series.Series, window: int = 20, window_dev: int = 2)

Parameter

Parameter
Description
Data type
Default value

column

Column containing the values for calculating Bollinger Bands.

pandas.Series

window

Number of data points used in the Bollinger Bands calculation.

int

20

window_dev

Number of standard deviations used to calculate the distance of Bollinger Bands.

int

2

Example

fi = client.FiinIndicator()
df['bollinger_hband'] = fi.bollinger_hband(df['close'], window=20, window_dev=2)
df['bollinger_lband'] = fi.bollinger_lband(df['close'], window=20, window_dev=2)
print(df)

3.2. Supertrend

Supertrend (super trend) is a technical analysis tool developed by investor Olivier Seban in 2010. Supertrend uses a combination of factors such as price, ATR (Average True Range), and the current trend to identify the main market trend and potential reversal points.

def supertrend(high: pandas.core.series.Series, low: pandas.core.series.Series, close: pandas.core.series.Series, window: int = 14, multiplier: float = 3.0)


def supertrend_hband(high: pandas.core.series.Series, low: pandas.core.series.Series, close: pandas.core.series.Series, window: int = 14, multiplier: float = 3.0)


def supertrend_lband(high: pandas.core.series.Series, low: pandas.core.series.Series, close: pandas.core.series.Series, window: int = 14, multiplier: float = 3.0)

Parameter

Parameter
Description
Data type
Default value

high

Column containing the highest price values for Supertrend calculation.

pandas.Series

low

Column containing the lowest price values for Supertrend calculation.

pandas.Series

close

Column containing closing price values for Supertrend calculation.

pandas.Series

window

Number of data points used in the Supertrend calculation.

int

14

multiplier

Multiplier used to adjust the width of the Supertrend indicator relative to the price level.

float

3.0

Example:

fi = client.FiinIndicator()
df['supertrend'] = fi.supertrend(df['high'], df['low'], df['close'], window=14)
df['supertrend_hband'] = fi.supertrend_hband(df['high'], df['low'], df['close'], window=14)
df['supertrend_lband'] = fi.supertrend_lband(df['high'], df['low'], df['close'], window=14)
print(df)

3.3. ATR (Average True Range)

ATR stands for Average True Range. This indicator measures price volatility over a specific period.

The indicator was introduced in J. Welles Wilder Jr.'s 1978 book, "New Concepts in Technical Trading Systems." Through this indicator, investors can predict future price fluctuations. This provides investors with a basis for setting appropriate stop-loss and take-profit points.

def atr(high: pandas.core.series.Series, low: pandas.core.series.Series, close: pandas.core.series.Series, window: int = 14)

Parameter

Parameter
Description
Data type
Default value

high

Column containing the highest price values for ATR calculation.

pandas.Series

low

Column containing the lowest price values for ATR calculation.

pandas.Series

close

Column containing closing price values for ATR calculation.

pandas.Series

window

Number of data points used in the ATR calculation.

int

14

Example:

fi = client.FiinIndicator()
df['atr'] = fi.atr(df['high'], df['low'], df['close'], window=14)
print(df)

4. Volume Indicators

4.1. MFI (Money Flow Index)

MFI is an indicator reflecting the money flow strength of a stock over a specified period, analyzed based on trading volume. The period is considered daily, weekly, or monthly, and typically calculated over 14 periods.

def mfi(high: pandas.core.series.Series, low: pandas.core.series.Series, close: pandas.core.series.Series, volume: pandas.core.series.Series, window: int = 14)

Parameter

Parameter
Description
Data type
Default value

high

Column containing the highest price values for MFI calculation.

pandas.Series

low

Column containing the lowest price values for MFI calculation.

pandas.Series

close

Column containing closing price values for MFI calculation.

pandas.Series

volume

Column containing trading volume values for MFI calculation.

pandas.Series

window

Number of data points used in the MFI calculation.

int

14

Example:

fi = client.FiinIndicator()
df['mfi'] = fi.mfi(df['high'], df['low'], df['close'], df['volume'], window=14)
print(df)

4.2. OBV (On Balance Volume)

OBV is a volume indicator that measures cumulative trading volume across sessions, thereby showing whether a stock is trending towards being bought or sold. If today's session is an up day, the volume is added to the OBV indicator. Conversely, volume is subtracted when today is a down trading session.

def obv(column: pandas.core.series.Series, volume: pandas.core.series.Series)

Parameter

Parameter
Description
Data type
Default value

column

Column (series) containing price values for OBV calculation.

pandas.Series

volume

Column containing trading volume values for OBV calculation.

pandas.Series

Example:

fi = client.FiinIndicator()
df['obv'] = fi.obv(df['close'], df['volume'])
print(df)

4.3. VWAP (Volume Weighted Adjusted Price)

VWAP stands for Volume Weighted Average Price, the average price of a stock calculated by its total trading volume. VWAP is used to determine a stock's average price over a period.

The volume-weighted average price helps compare a stock's current price to a benchmark, making it easier for investors to decide when to enter and exit the market. Additionally, VWAP can assist investors in determining their investment approach for a stock and executing appropriate trading strategies at the right time.

def vwap(high: pandas.core.series.Series, low: pandas.core.series.Series, close: pandas.core.series.Series, volume: pandas.core.series.Series, window: int = 14)

Parameter

Parameter
Description
Data type
Default value

high

Column containing the highest price values for VWAP calculation.

pandas.Series

low

Column containing the lowest price values for VWAP calculation.

pandas.Series

close

Column containing closing price values for VWAP calculation.

pandas.Series

volume

Column containing trading volume values for VWAP calculation.

pandas.Series

window

Number of data points used in the VWAP calculation.

int

14

Example:

fi = client.FiinIndicator()
df['vwap'] = fi.vwap(df['high'], df['low'], df['close'], df['volume'], window=14)
print(df)

5. Smart Money Concepts

5.1. Fair Value Gap (FVG)

FVG is a price range on a chart that has not been filled, appearing due to an imbalance between supply and demand. If the current candle is bullish, FVG appears when the high of the preceding candle is lower than the low of the following candle. If the current candle is bearish, FVG appears when the low of the preceding candle is higher than the high of the following candle.

def fvg(self, open: pd.Series, high: pd.Series, low: pd.Series, close: pd.Series, join_consecutive: bool = True) -> pd.Series: ...
    
def fvg_top(self, open: pd.Series, high: pd.Series, low: pd.Series, close: pd.Series, join_consecutive: bool = True) -> pd.Series: ...
    
def fvg_bottom(self, open: pd.Series, high: pd.Series, low: pd.Series, close: pd.Series, join_consecutive: bool = True) -> pd.Series: ...
    
def fvg_mitigatedIndex(self, open: pd.Series, high: pd.Series, low: pd.Series, close: pd.Series, join_consecutive: bool = True) -> pd.Series: ...

Parameter

Parameter
Description
Data type
Default value

open

Open price column.

pandas.Series

high

Highest price column.

pandas.Series

low

Lowest price column.

pandas.Series

close

Close price column.

pandas.Series

join_consecutive

If there are multiple consecutive FVG (Fair Value Gap) ranges, they will be merged into one, using the highest high as the top and the lowest low as the bottom.

bool

True

Example:

fi = client.FiinIndicator()
df['fvg'] = fi.fvg(df['open'],df['high'], df['low'], df['close'],join_consecutive=True)
print(df)

5.2. Swing Highs and Lows

Swing high occurs when the current candle's highest price is the highest within a defined period before and after it.

Swing low occurs when the current candle's lowest price is the lowest within the same period.

def swing_HL(self, open: pd.Series, high: pd.Series, low: pd.Series, close: pd.Series, swing_length: int = 50) -> pd.Series: ...
    
def swing_level(self, open: pd.Series, high: pd.Series, low: pd.Series, close: pd.Series, swing_length: int = 50)) -> pd.Series: ...

Parameter

Parameter
Description
Data type
Default value

open

Open price column.

pandas.Series

high

Highest price column.

pandas.Series

low

Lowest price column.

pandas.Series

close

Close price column.

pandas.Series

swing_length

Number of candles to consider before and after to determine a swing high or swing low.

int

50

Example:

fi = client.FiinIndicator()
df['swing_HL'] = fi.swing_HL(df['open'],df['high'], df['low'], df['close'], swing_length = 50)
print(df)

5.3. Break of Structure (BOS) & Change of Character (CHoCH)

BOS (Break of Structure): When the price breaks the previous trend structure (either uptrend or downtrend), it indicates a shift in market momentum.

ChoCH (Change of Character): A crucial indicator showing a trend reversal. ChoCH occurs when a downtrend changes to an uptrend or vice versa.

def break_of_structure(self, open: pd.Series, high: pd.Series, low: pd.Series, close: pd.Series, close_break: bool = True, swing_length: int = 50) -> pd.Series: ...
    
def chage_of_charactor(self, open: pd.Series, high: pd.Series, low: pd.Series, close: pd.Series, close_break: bool = True, swing_length: int = 50) -> pd.Series: ...
    
def bos_choch_level(self, open: pd.Series, high: pd.Series, low: pd.Series, close: pd.Series, close_break: bool = True, swing_length: int = 50) -> pd.Series: ...
    
def broken_index(self, open: pd.Series, high: pd.Series, low: pd.Series, close: pd.Series, close_break: bool = True, swing_length: int = 50) -> pd.Series: ...

Parameter

Parameter
Description
Data type
Default

open

Open price column.

pandas.Series

high

Highest price column.

pandas.Series

low

Lowest price column.

pandas.Series

close

Close price column.

pandas.Series

close_break

If True, confirmation is based on the candle's closing price. If False, confirmation is based on the candle's high/low.

bool

True

swing_length

Number of candles to consider before and after to determine a swing high or swing low.

int

50

Example:

fi = client.FiinIndicator()
df['break_of_structure'] = fi.break_of_structure(df['open'],df['high'], df['low'],df['close'],swing_length=50)
df['chage_of_charactor'] = fi.chage_of_charactor(df['open'],df['high'], df['low'],df['close'])
print(df)

5.4. Order Blocks

An area where large institutions have placed trades, creating strong price pushes. When the price returns to the OB (Order Block) zone, this is often a potential entry point.

def ob(self, open: pd.Series, high: pd.Series, low: pd.Series, close: pd.Series, volume: pd.Series, close_mitigation: bool = False, swing_length: int = 50) -> pd.Series: ...
    
def ob_top(self, open: pd.Series, high: pd.Series, low: pd.Series, close: pd.Series, volume: pd.Series, close_mitigation: bool = False, swing_length: int = 50) -> pd.Series: ...
    
def ob_bottom(self, open: pd.Series, high: pd.Series, low: pd.Series, close: pd.Series, volume: pd.Series, close_mitigation: bool = False, swing_length: int = 50) -> pd.Series: ...
    
def ob_volume(self, open: pd.Series, high: pd.Series, low: pd.Series, close: pd.Series, volume: pd.Series, close_mitigation: bool = False, swing_length: int = 50) -> pd.Series: ...
    
def ob_mitigated_index(self, open: pd.Series, high: pd.Series, low: pd.Series, close: pd.Series, volume: pd.Series, close_mitigation: bool = False, swing_length: int = 50) -> pd.Series: ...
    
def ob_percetage(self, open: pd.Series, high: pd.Series, low: pd.Series, close: pd.Series, volume: pd.Series, close_mitigation: bool = False, swing_length: int = 50) -> pd.Series: ...

Parameter

Parameter
Description
Data type
Default

open

Open price column.

pandas.Series

high

Highest price column.

pandas.Series

low

Lowest price column.

pandas.Series

close

Close price column.

pandas.Series

volume

Volume column.

pandas.Series

close_mitigation

If True, confirmation is based on the candle's closing price. If False, confirmation is based on the candle's high/low.

bool

False

swing_length

Number of candles to consider.

int

50

Example:

fi = client.Indicator()
df['ob'] = fi.ob(df['open'],df['high'], df['low'],df['close'],df['volume'], close_mitigation = False, swing_length = 40)
df['ob_volume'] = fi.ob_volume(df['open'],df['high'], df['low'],df['close'],df['volume'])
print(df)

5.5. Liquidity

Liquidity appears when there are multiple highs or multiple lows within a small range, indicating an accumulation of orders in that area.

def liquidity(self, open: pd.Series, high: pd.Series, low: pd.Series, close: pd.Series, range_percent: float = 0.01, swing_length: int = 50) -> pd.Series: ...
    
def liquidity_level(self, open: pd.Series, high: pd.Series, low: pd.Series, close: pd.Series, range_percent: float = 0.01, swing_length: int = 50) -> pd.Series: ...
    
def liquidity_end(self, open: pd.Series, high: pd.Series, low: pd.Series, close: pd.Series, range_percent: float = 0.01, swing_length: int = 50) -> pd.Series: ...
    
def liquidity_swept(self, open: pd.Series, high: pd.Series, low: pd.Series, close: pd.Series, range_percent: float = 0.01, swing_length: int = 50) -> pd.Series: ...

Parameter

Parameter
Description
Data type
Default value

open

Open price column.

pandas.Series

high

Highest price column.

pandas.Series

low

Lowest price column.

pandas.Series

close

Close price column.

pandas.Series

range_percent

Percentage of the price range used to determine liquidity.

float

0.01

swing_length

Number of candles to consider before and after to determine a swing high or swing low.

int

50

Example:

// Some codepy

fi = client.FiinIndicator()
df['liquidity'] = fi.liquidity(df['open'],df['high'], df['low'],df['close'])
print(df)

Last updated