jrrTAfunctions - rapmd73/JackrabbitRelay GitHub Wiki

JRR Technical Analysis Library Functions

This library serves as the analytical engine for the Jackrabbit Relay trading ecosystem. Its primary purpose is to ingest raw market data—specifically the opening, high, low, and closing prices of assets—and transform that data into actionable insights. By acting as a mathematical toolbox, it allows trading strategies to look beyond simple price movements to understand the deeper trends, momentum, and volatility driving the market.

Data Management and "Rolling Windows"

At the heart of this system is a sophisticated data management structure known as a "rolling window." Imagine a conveyor belt of financial data where the newest price updates are added to the front while the oldest data drops off the back. This ensures that the analysis is always based on the most relevant, up-to-the-second market conditions. The module handles all the heavy lifting regarding data consistency, ensuring that whether the market is moving fast or slow, the historical context needed for decision-making is always preserved and accessible.

Extensive Indicator Library

The core strength of this project is its massive library of technical indicators. It goes far beyond standard tools like Simple Moving Averages or the RSI. It includes advanced, institutional-grade algorithms such as Jurik Moving Averages for noise reduction, Black-Scholes models for volatility estimation, and complex geometric tools like Gann Fans and the Square of Nine. Whether a strategy relies on trend following, mean reversion, or volume analysis, this module provides the pre-calculated metrics required to execute those strategies effectively.

Automated Pattern Recognition

Beyond pure mathematics, this code includes a comprehensive "dictionary" of visual market patterns. It is capable of automatically scanning price charts to identify specific candlestick formations—such as Hammers, Dojis, Engulfing patterns, and Shooting Stars. This feature allows the software to recognize human psychology and market sentiment (like indecision or panic) solely by analyzing the shape of price movements, triggering signals based on behavior rather than just raw numbers.

Visualization and Reporting

To help users trust and understand the automated decisions, the module includes a built-in charting engine. It can generate high-resolution images of the market state, overlaying the calculated indicators and trade signals directly onto candlestick charts. This visual feedback is essential for backtesting and monitoring, as it allows users to "see" what the algorithm sees, verifying that the technical analysis aligns with visual market reality.


class TechnicalAnalysis:

Non-technical

This class provides a comprehensive toolkit for analyzing financial market data by tracking price movements and identifying patterns that might indicate future trends. It continuously collects and organizes historical price information into a moving window of data points, allowing users to apply various analytical techniques that professional traders use to make informed decisions. The system automatically processes this data to reveal potential buying or selling opportunities through visual representations and mathematical calculations that highlight momentum shifts, support and resistance levels, and significant price formations. By transforming raw market information into meaningful insights, it helps users understand market behavior without requiring them to perform complex calculations manually, essentially serving as an intelligent assistant that watches the markets and points out noteworthy developments as they happen.

Technical

  • exchange (string): Specifies which financial exchange to connect to, determining the source of market data and trading capabilities.
  • account (string): Identifies the specific trading account to use for data retrieval and potential trading operations.
  • asset (string): Defines the financial instrument or trading pair to analyze, such as a cryptocurrency pair or stock symbol.
  • timeframe (string): Sets the duration of each price candle or data point, ranging from seconds to days, which determines the granularity of analysis.
  • count (integer): Controls how many historical data points to maintain in the rolling window, with higher values preserving more history but requiring more memory.
  • length (integer): Determines the character width used when formatting numerical values for display purposes.
  • precision (integer): Specifies the number of decimal places to use when representing numerical values in outputs and calculations.
  • No fixed number of columns are added during initialization as the rolling window dynamically expands based on which technical indicators are subsequently applied, with each indicator adding its own specific number of columns (ranging from 1 to 5+ depending on the indicator).

Returns

Returns None.


def ts2date(self,timestamp):

Non-technical

This function transforms a numeric time value into a clear, standardized date and time format that anyone can easily read and understand, showing the full year, month, day, hour, minute, and second without requiring any technical knowledge about how time is stored in computer systems, making it particularly useful for displaying timestamps in a human-friendly way across different applications and reports.

Technical

  • timestamp: Represents a point in time as a numeric value, expected to be of type string or numeric (int/float). It determines which specific moment will be converted to a readable format, with the function anticipating this value expresses time in milliseconds since the Unix epoch.
  • No columns were added to any rolling window matrix.

Returns

Returns a string in the format 'YYYY-MM-DD HH:MM:SS' representing the converted timestamp in UTC time, or returns None if the conversion fails due to invalid input or other errors.


def Win2Text(self,idx):

Non-technical

This function takes a specific moment from a historical record of market data and transforms it into a neatly organized text format that clearly shows the date and all associated measurements. It ensures that each numerical value appears consistently formatted with the right amount of decimal places, while gracefully handling any missing information by replacing it with visible dashes, making the output easy to scan and understand at a glance without overwhelming the reader with technical details or irregular spacing.

Technical

  • idx: An integer representing which specific data point to convert from the historical record. A negative value counts backward from the most recent entry (where -1 refers to the latest data), while a positive value counts forward from the oldest entry. This parameter determines exactly which market snapshot will be formatted for display.
  • No columns were added to the rolling window.

Returns

Returns a string containing the formatted date followed by all associated numerical values from the selected data point, with each value consistently spaced and precision-controlled. If the requested index is invalid or the data window is empty, returns None.


def Log(self,idx,end=0,purge=False):

Non-technical

This function helps you save your trading activity to a file so you can review it later, whether you want to keep a complete record or just focus on specific moments. It gives you control over which parts of your trading history get recorded, lets you decide if you want to add new entries to existing records or start fresh with a clean file, and ensures your data stays organized in a format that's easy to read. You can choose to save just the latest update, a particular section of your trading journey, or your entire history all at once, making it simple to track your progress and analyze your decisions whenever you need to look back.

Technical

  • idx: An integer representing the starting position in the trading history to begin logging; negative values count backward from the most recent entry; determines which historical data point to start recording from
  • end: An integer with default value 0 representing the ending position in the trading history to stop logging; value of -1 logs all remaining entries; specifies how many entries to record after the starting position
  • purge: A boolean with default value False that, when set to True, deletes any existing log file before writing new entries; determines whether new data replaces or appends to previous records

Returns

Returns None.


def Display(self,idx):

Non-technical

This function shows a specific moment in the market's history in a clear, easy-to-read format by taking the complex data that has been gathered and organizing it into a single line of information that displays the date and all relevant market measurements with proper number formatting, making it simple to understand what was happening at that particular point in time without overwhelming the user with too many details or technical complexity.

Technical

  • idx: An integer representing which historical data point to display, where negative values count backward from the most recent entry (e.g., -1 shows the latest data). This parameter determines which specific moment in the market timeline will be presented to the user.
  • The function adds no columns to the rolling window matrix.

Returns

Returns None.


def GetSize(self):

Non-technical

This function helps determine how much market history is currently available for analysis by counting the number of complete time periods that have been properly recorded. It looks through the stored market data and tallies up all the entries that contain valid timestamps, giving you a clear picture of how much usable information is available for making trading decisions without including any incomplete or placeholder records.

Technical

  • No arguments required.

Returns

Returns an integer representing the count of valid rows in the rolling window that contain timestamp data.


def GetRow(self,row):

Non-technical

This function helps you look at specific moments in your trading history by letting you pick a particular point in time from your recorded data. It works like flipping through pages in a journal where each page represents market conditions at a specific moment. If you ask for a page that doesn't exist in your journal, it simply tells you there's nothing to show rather than causing an error. This makes it safe to use when exploring historical market data without worrying about accidentally requesting information that wasn't recorded.

Technical

  • row: Represents which historical data point you want to examine, expected to be an integer. Positive values count from the beginning of your recorded data while negative values count backward from the most recent entry (with -1 being the latest data). If you request a position outside the range of available data, the function will return an empty result instead of causing an error.

Returns

Returns a list containing market data for the requested time period, or an empty list [] if the requested position doesn't exist in the recorded data.


def LastRow(self):

Non-technical

This function provides immediate access to the most recent market data point that has been processed and stored in the system's memory, allowing users to quickly retrieve the latest price information, volume, and any calculated technical indicators for real-time analysis or decision making without having to navigate through historical records or manage complex data structures themselves.

Technical

  • No arguments required.

Returns

Returns a list containing the most recent market data values including timestamp, price points, volume, and any calculated technical indicators, or returns an empty list if no data is available in the system's memory.


def AddColumn(self,value):

Non-technical

This function seamlessly incorporates a new measurement into the most recent timeframe of an ongoing market analysis record, allowing multiple indicators to be tracked simultaneously within the same chronological framework; it takes whatever numerical value you provide and attaches it to the current period's data collection, enabling a comprehensive view of various market metrics as they evolve over time without disrupting the existing structure of historical observations.

Technical

  • value - Represents a numerical data point to be included in the analysis, expected to be a floating-point number. This value gets appended to the most recent timeframe's data record, effectively adding one new column to the rolling window matrix. The function adds exactly 1 column to the rolling window matrix.

Returns

Returns a list of lists representing the complete updated data structure containing all historical records with the new value added to the most recent entry.


def SaveChart(self, length=0, store=None, visible=[], title=None, subtitle=None, trades=[], labels=[], writer=None):

Non-technical

This function creates professional-looking visual representations of market movements that help users track price patterns and analytical signals over time, capturing the current state of financial analysis in a format that clearly shows how prices have moved alongside important indicators, then saves these images for later review or combines them into video sequences that reveal evolving market conditions, all presented with clean layouts and intuitive color coding that makes it easy to distinguish between different market behaviors and analytical elements without overwhelming the viewer with unnecessary complexity.

Technical

  • length: An integer specifying how many historical data points to include in the chart, with a default value of 0 meaning "show all available data," affecting how far back in time the chart displays.
  • store: A string representing the file path where chart images should be saved as PNG files, with no default value meaning charts won't be saved to disk unless provided.
  • visible: A list of boolean values determining which technical indicators should appear on the chart, with empty list as default meaning no indicators will be displayed.
  • title: A string for the main heading at the top of the chart, with default value of None resulting in a generic market motion title.
  • subtitle: A string for additional descriptive text appearing below the main title, with default value of None meaning no subtitle will be shown.
  • trades: A list of numerical values representing trade entry prices that will be marked as horizontal lines on the chart, with empty list as default meaning no trade markers will appear.
  • labels: A list of strings providing custom names for the indicators being plotted, with empty list as default causing the system to use generic column identifiers.
  • writer: An object that handles video frame writing for creating time-lapse sequences, with default value of None meaning no video frames will be generated.
  • No columns were added to the rolling window.

Returns

Returns None.


def Load(self,fn=None,verbose=True):

Non-technical

This function helps the system remember past market observations by loading previously saved data from a file, allowing analysis to continue where it left off rather than starting over; it quietly rebuilds the complete picture of market movements by reading historical records and organizing them properly, ensuring the trading system maintains continuity in its understanding of market conditions without losing any previously gathered insights.

Technical

  • fn: Expected to be a string representing a file path. When provided, the function attempts to load data from this specific file instead of the default log file. If the file doesn't exist, it's ignored.
  • verbose: Expected to be a boolean value. When set to True (the default), the function displays a message indicating it's reloading the data matrix. When False, it operates silently without any output.
  • No additional columns were added to the rolling window matrix.

Returns

Returns the updated window matrix containing the loaded market data as a list of lists. Each inner list represents a time period with various market measurements.


def Rolling(self,slice=None):

Non-technical

This function maintains a continuously updated historical record of market activity by carefully organizing incoming data points in chronological order while automatically discarding outdated information. It ensures that only the most recent market movements remain visible for analysis, quietly filtering out duplicate entries that arrive simultaneously and preserving a clean, accurate timeline that reflects the true progression of price changes over time. The system works behind the scenes to provide traders with a reliable foundation for identifying patterns and making informed decisions based on current market conditions without being cluttered by obsolete or redundant information.

Technical

  • slice: This parameter expects a list containing market data values, which may include timestamps, price points, and volume information. When provided, it attempts to incorporate this data into the historical record if it represents a newer time period; otherwise, it identifies the entry as a duplicate. The function does not add any new columns to the rolling window matrix.

Returns

Returns a list of lists containing the market data window, where each inner list represents a single time period's data points and the outer list contains the most recent data periods up to the system's configured limit.


def UpdateOHLCVRolling(self,live=True):

Non-technical

This function keeps your market data current by regularly refreshing the historical price records with the latest information from the exchange. When the market is actively trading, it carefully replaces the partially formed current price candle with a completed one and adds a fresh candle to maintain an accurate timeline. If the market data isn't available for any reason, it creates temporary placeholder entries to preserve the structure of your historical record. The system automatically manages how much historical data to keep, ensuring you always have access to the most relevant recent price movements while discarding older information that's no longer useful for analysis, giving you a clean, up-to-date view of market activity for making trading decisions.

Technical

  • live - A boolean value determining whether the market is currently active. When set to True (the default), the function replaces the most recent incomplete price candle with a finalized one before adding new data. When set to False, it simply appends new candles without modifying existing entries. This parameter affects how historical data is maintained during different market conditions. The function manages the existing OHLCV structure (6 columns: timestamp, open, high, low, close, volume) but does not add new columns to the rolling window.

Returns

Returns a list containing the updated rolling window of OHLCV data, where each element in the list is itself a list representing a single candle with timestamp, open, high, low, close, and volume values.


def ReadOHLCV(self,fn):

Non-technical

This function reads historical price and volume information from a text file, converting it into a structured format that can be analyzed. It carefully processes each line of the file, transforming numerical values into a usable form while ignoring any empty lines or invalid entries. The result is a clean set of market data that shows how prices moved over time, including the highest and lowest points reached, where trading started and ended during each period, and how much activity occurred.

Technical

  • fn - A string representing the file path to read OHLCV data from; this parameter specifies where the historical market data is stored and must point to a valid CSV file containing properly formatted price information; no additional columns were added to the rolling window.

Returns

Returns a list of lists containing OHLCV data, where each inner list represents a single time period with timestamp and numerical values for price and volume; if the file doesn't exist or is empty, it returns None.


def GetOHLCV(self):

Non-technical

This function retrieves historical price and trading volume information for a specific financial instrument, gathering details about how the price moved during each time interval including where it started, reached its highest and lowest points, where it finished, and how much activity occurred. It automatically adjusts the amount of historical data requested to stay within practical limits while ensuring comprehensive market information is obtained, and handles any connectivity issues gracefully by providing clear feedback rather than disrupting the overall system operation.

Technical

  • No arguments required.
  • This function does not add any columns to the rolling window.

Returns

Returns a list of lists containing OHLCV data or None if the data fetch fails. Each inner list represents a single time period with values for open price, high price, low price, close price, and volume.


def GetTicker(self):

Non-technical

This function provides immediate access to the current market pricing information for a specific financial instrument, delivering the most recent buying and selling prices along with related market details that traders rely on for making timely decisions, all while handling the complex communication with market data services behind the scenes so users receive clean, actionable information without needing to understand the technical infrastructure involved.

Technical

  • No arguments required.
  • The function does not add any columns to the rolling window matrix.

Returns

Returns a dictionary containing current market price information including bid price, ask price, spread, and timestamp.


def GetSyntheticTicker(self,previous_ticker,deviation=0.0005):

Non-technical

This function creates realistic-looking market price data when real-time information isn't available. It takes the most recent price information and generates a new set of prices that behave like actual market movements, with small random fluctuations that mimic how currency values naturally change over time. The generated prices maintain proper relationships between buying and selling values, creating a believable simulation that can be used for testing trading strategies or demonstrating how systems would respond to market conditions without needing live data feeds.

Technical

  • previous_ticker: A dictionary containing the previous market data with keys for bid, ask, and spread values; expected to be of type dict; provides the baseline values from which new synthetic prices are calculated, with the function using these values to determine starting points for the new simulated prices
  • deviation: A floating-point number representing the maximum percentage change allowed for price movement; defaults to 0.0005 (0.05%); controls how much the new price can randomly fluctuate from the previous price, with larger values creating more volatile simulated markets
  • No columns were added to the rolling window

Returns

Returns a dictionary containing simulated market price information with keys for DateTime, Ask, Bid, and Spread, where DateTime is a timestamp of when the synthetic data was generated, and the other values represent the simulated market prices rounded to eight decimal places.


def MakeOHLCV(self,days=0,hours=0,minutes=0,seconds=60,synthetic=False):

Non-technical

This function creates a complete price bar that shows how a market moved over a specific time period, capturing the starting price, highest price, lowest price, ending price, and trading activity during that interval. It works by continuously checking the current market price at regular intervals throughout the designated timeframe, tracking how prices fluctuate, and then compiling this information into a single cohesive record that represents the entire period. When requested, it can simulate market conditions instead of using real-time data, which is helpful for testing strategies without affecting live markets. The resulting price bar gives traders a clear snapshot of market behavior during the selected timeframe, showing both the overall price movement and the intensity of trading activity.

Technical

  • days: Integer representing the number of days to include in the bar duration; larger values create longer timeframes that smooth out short-term fluctuations but may miss intraday details
  • hours: Integer representing the number of hours to include in the bar duration; works with other time parameters to define the complete timeframe
  • minutes: Integer representing the number of minutes to include in the bar duration; combines with other time parameters to specify the exact length of the price bar
  • seconds: Integer representing the number of seconds to include in the bar duration; defaults to 60 (one minute) and serves as the smallest time unit when other parameters are zero
  • synthetic: Boolean flag that determines whether to generate simulated market data (True) or fetch real market data (False); when enabled, creates artificial price movements that mimic real market behavior without connecting to live exchanges
  • The function adds 6 columns to the rolling window (timestamp, open, high, low, close, volume).

Returns

Returns a list containing six elements: [timestamp, open price, high price, low price, close price, volume]; if the specified duration is invalid (zero or negative), returns an empty list.


def CandleCounter(self, idx, target_value, reset_count):

Non-technical

This function helps track how long it's been since a specific market condition occurred, counting down from a set number with each new data point. When the condition reappears, it restarts the countdown, allowing traders to maintain awareness of recent events for a predetermined duration. This creates a persistent signal that remains active for a specified number of periods after an important market event, helping to filter out noise while ensuring significant developments don't get overlooked too quickly.

Technical

  • idx: Integer representing which data point in each time period to monitor. Determines which value will be checked against your target condition.
  • target_value: The specific value that triggers the countdown reset. When the monitored data point matches this value, the counter restarts.
  • reset_count: Integer specifying how many time periods the counter should remain active after the target condition is met. Controls the duration of the persistent signal.
  • The function adds exactly 1 column to the rolling window.

Returns

Returns the updated data window as a list of lists, with the counter value added as a new column to the most recent time period.


def Cross(self,idx1,idx2):

Non-technical

This function helps identify when one trend line passes over or under another trend line on a price chart. It carefully compares the most recent position of these two lines to determine if they've recently crossed paths, which can signal potential changes in market direction. When the lines cross, it marks this event with a clear indicator that traders can use to make informed decisions about buying or selling. The function also calculates how far apart the lines are at any given moment, providing valuable context about the strength of the current market trend.

Technical

  • idx1 - An integer representing the position of the first trend line or indicator value within the historical data set; determines which line will be checked for crossing above or below the second line
  • idx2 - An integer representing the position of the second trend line or indicator value within the historical data set; serves as the reference line against which the first line's position is compared
  • The function adds exactly 2 new columns to the rolling window (matrix) - one showing the numerical difference between the lines, and another indicating crossing events

Returns

Returns the updated window matrix with two additional columns appended to the most recent data point: the first contains the numerical difference between the two trend lines, and the second contains an indicator value (1 for upward crossing, -1 for downward crossing, or 0 for no crossing).


def Rule37(self, MA_IDX):

Non-technical

This function helps determine the immediate direction of a market trend by examining how a specific smoothed price line is moving. It works by comparing the current position of this line to where it was just one step ago. If the line is moving upward or staying flat, the function signals a seven to indicate potential upward momentum. If the line is moving downward, it signals a three to indicate potential downward momentum. When there isn't enough historical data to make a reliable determination, it temporarily shows a neutral five until more information becomes available. This approach allows traders to quickly identify when a market might be changing direction at its earliest stages, helping them make more timely decisions without waiting for multiple confirmations that might come too late.

Technical

  • MA_IDX: An integer representing the column index in the data window where the moving average value is stored; this determines which smoothed price line the function examines to detect trend direction; higher values would point to different technical indicators in the data structure
  • The function adds exactly 1 column to the rolling window matrix.

Returns

Returns the updated window data structure (a list of lists) with the new Rule 37 value appended as an additional column to the most recent data point.


def SMA(self,idx,period=17):

Non-technical

This function helps identify the general direction of price movement by calculating a smoothed average that updates with each new data point, making it easier to see the bigger picture without getting distracted by short-term fluctuations. It takes historical price information and creates a running average line that traders use to determine whether an asset is trending upward, downward, or moving sideways, with the calculation considering a specific number of recent data points to balance responsiveness and stability in the signal it provides.

Technical

  • idx: An integer representing which price data column to analyze; determines which specific values from the dataset contribute to the average calculation, with higher values accessing different price metrics within the historical records.
  • period: An integer with default value 17 specifying how many consecutive data points to include in each average; larger values create smoother trend lines that react slowly to price changes while smaller values produce more responsive but volatile signals; directly controls the sensitivity of the trend identification.
  • The function adds exactly 1 column to the rolling window.

Returns

Returns the updated rolling window data structure (a list of lists) with the calculated simple moving average value appended to the most recent row; when insufficient historical data exists, it returns the window with a None value added instead of a numerical result.


def EMA(self, idx, period=17):

Non-technical

This function helps track the smoothed trend of price movements by giving more importance to recent data points while still considering historical values. It creates a line that follows price action more closely than a simple average would, making it easier to identify potential shifts in market direction. The calculation automatically adjusts based on how many time periods you want to consider, with newer prices having greater influence on the result than older ones. This smoothed line appears on your charts to help visualize whether prices are generally moving up or down over time.

Technical

  • idx: Integer representing which column of data to analyze, such as closing prices or another indicator. It determines which values from your historical data will be used in the calculation.
  • period: Integer specifying how many previous time intervals to include in the calculation, with a default value of 17. A smaller number makes the indicator more responsive to recent price changes, while a larger number creates a smoother line that filters out short-term fluctuations.
  • The function adds exactly 1 column to the rolling window matrix.

Returns

Returns a list of lists representing the updated rolling window data structure with the EMA value appended to the most recent row.


def WMA(self, idx, period=17):

Non-technical

This function calculates a special kind of moving average that gives more importance to recent price movements than older ones, helping to identify current market trends more responsively. It examines a specific set of price data over a chosen timeframe and creates a smoothed value that emphasizes the latest market activity while still considering historical patterns. Unlike a regular average that treats all data points equally, this approach makes the indicator more sensitive to new developments in the market, providing traders with a clearer picture of whether prices are trending upward or downward by weighting the most recent information more heavily in the calculation.

Technical

  • idx: An integer representing the position of the price data column to analyze; expected to be a positive whole number that identifies which specific price series (like closing prices) to use in the calculation, where higher values select different data points in the historical record.
  • period: An integer representing the timeframe over which to calculate the average; expected to be a positive whole number that determines how many recent data points will be included in the calculation, with a default value of 17 that can be adjusted to make the indicator more or less responsive to price changes.
  • The function adds 1 column to the rolling window.

Returns

Returns the updated rolling window (a list of lists) with the calculated weighted moving average value appended as a new column to the most recent data point; if there isn't sufficient historical data to perform the calculation, it appends a null value instead.


def HMA(self, wmaIDX, wma2IDX, period=21):

Non-technical

This function calculates a specialized moving average called the Hull Moving Average that helps identify price trends in financial markets by creating a smoother line that follows recent price movements more closely than traditional methods, allowing traders to spot potential trend changes earlier while reducing false signals from market noise, all by analyzing historical price patterns over a user-specified time window to produce a responsive indicator that balances smoothness with timely reaction to market shifts.

Technical

  • wmaIDX: Integer representing the column position where the full-period weighted moving average values are stored; determines which data series to use for the complete period calculation.
  • wma2IDX: Integer representing the column position where the half-period weighted moving average values are stored; provides the shorter-term moving average needed for the formula.
  • period: Integer with default value 21 specifying the lookback window length; larger values create smoother but more delayed results while smaller values react faster but with more noise. Adds exactly 4 new columns to the rolling window matrix.

Returns

Returns the updated rolling window data structure as a list of lists containing the original market data plus the newly calculated Hull Moving Average values in the additional columns.


def VWMA(self, idx, vol_idx=5, period=20):

Non-technical

This function calculates a special kind of average that pays more attention to price movements that happen with heavier trading activity, recognizing that price changes supported by large volumes carry more market significance than those with light participation. It examines recent price points alongside their corresponding trading volumes, giving greater influence to prices where more transactions occurred, then combines these weighted values into a single representative figure that reveals where the true market consensus lies when accounting for trading intensity. This approach helps identify meaningful trends that have genuine market participation behind them, filtering out noise from periods of low activity to provide a clearer picture of where prices are genuinely moving based on actual market conviction.

Technical

  • idx is an integer specifying which column of price data to analyze (e.g., closing prices), where higher values select different price series; affects which price values receive volume-based weighting in the calculation
  • vol_idx is an integer specifying which column contains volume data (default 5), where changing this value selects alternative volume measurements; determines which values weight the price points in the average
  • period is an integer determining how many recent data points to include (default 20), where larger values create smoother but more delayed results while smaller values yield more responsive but potentially noisier outputs; directly controls the calculation's historical scope
  • Adds exactly 1 column to the rolling window matrix containing the calculated volume-weighted moving average value

Returns

Returns the updated rolling window as a list of lists containing all historical data points, with the new VWMA value appended as an additional column to the most recent data point in the structure.


def RMA(self, idx, period=14):

Non-technical

This function calculates a specialized moving average that helps identify market trends by smoothing out price fluctuations over time. It works by gradually incorporating new price information while still considering past movements, creating a responsive yet stable indicator that reveals whether prices are generally rising or falling. Unlike basic averages that treat all data points equally, this method gives appropriate weight to recent activity without overreacting to short-term noise, making it particularly valuable for traders who need to distinguish genuine market direction from random price movements. The result updates automatically as new data arrives, providing a continuously refined view of market momentum that helps in making more informed trading decisions.

Technical

  • idx - An integer specifying which market data series to analyze (such as price movements or volatility measurements); larger values select different market metrics; expected type: integer
  • period - An integer determining how many recent data points to consider in the calculation; higher values create smoother results that react more slowly to changes; default value is 14; expected type: integer
  • The function adds exactly one column to the rolling window matrix.

Returns

Returns a list of lists containing the updated rolling window data with the RMA value appended as a new column to the most recent row.


def ZeroLag(self, idx, period=17):

Non-technical

This function creates a special version of a market indicator that tries to predict where the price might be heading right now, rather than showing where it's been. Imagine you're watching a car drive down a winding road - most indicators would show you the path the car has already taken, but this one attempts to point toward where the car is likely heading next by analyzing how quickly it's changing direction. It does this by comparing the current value with where it was some time ago, then projecting that movement forward to give you a more immediate sense of the market's momentum without the usual delay found in traditional indicators.

Technical

  • idx: An integer specifying which data column to process (e.g., price, moving average, or other indicator values), where higher values select different technical measurements in the dataset, affecting which market aspect gets the zero-lag treatment.
  • period: An integer with default value 17 that determines the historical lookback window size, where larger values create smoother but less responsive calculations while smaller values make the indicator more sensitive to recent price changes, directly controlling the calculation's time sensitivity.
  • Adds exactly 1 column to the rolling window matrix.

Returns

Returns the updated self.window, which is a list of lists (matrix) containing the complete rolling window of market data with the new zero-lag calculation appended as an additional column to each row.


def SineWeight(self, idx, period=17):

Non-technical

This function creates a special kind of moving average that gives more importance to price movements in the middle of the calculation period, using a smooth wave-like pattern that naturally emphasizes central values while gently fading toward the beginning and end of the lookback window, resulting in a more responsive indicator that can better capture the current market momentum without being overly influenced by older data or sudden short-term spikes.

Technical

  • idx: An integer specifying which column of historical data to analyze, where higher numbers correspond to more recent technical calculations; determines which price series or indicator value receives the sine weighting treatment
  • period: An integer setting how many recent price points to include in the calculation, with a default value of 17; larger values create a smoother but more delayed result while smaller values make the indicator more responsive but potentially noisier
  • Adds exactly 1 column to the rolling window

Returns

Returns the updated rolling window as a list of lists, where the last row now contains an additional column with the sine-weighted value; this maintains the structure of the original window while adding the new calculated indicator value for the most recent time period.


def JMA(self, idx=4, period=14, phase=0, factor=0.45):

Non-technical

This function creates a special moving average that follows price movements more closely than traditional averages while keeping the line smooth and responsive. It helps identify trends by filtering out market noise and short-term fluctuations, making it easier to see the underlying direction of prices. Unlike standard moving averages that often lag behind current prices, this version adjusts its sensitivity based on market conditions, providing clearer signals about when trends might be changing. The result is a line that hugs price movements more tightly while still maintaining enough smoothness to avoid false signals from random market noise, giving traders a more reliable tool for understanding market direction without being distracted by temporary price swings.

Technical

  • idx - An integer representing which price data point to analyze (like opening, high, low, or closing prices); higher values select different price points in the sequence; affects which price data the moving average follows
  • period - An integer specifying how many recent price points to consider; larger values create smoother but more delayed results while smaller values react faster but with more noise
  • phase - A number controlling whether the moving average line appears slightly ahead of or behind the actual prices; positive values shift the line backward for more stability while negative values move it forward for quicker reactions
  • factor - A decimal value determining how aggressively the moving average responds to price changes; lower values create smoother lines that ignore minor fluctuations while higher values make the line follow prices more closely but with more sensitivity to noise
  • The function adds exactly 4 new columns to the rolling window.

Returns

Returns the updated rolling window data structure with the new Jurik Moving Average values appended. It does not return a specific value type but modifies the internal state of the TechnicalAnalysis object by adding the calculated values to the current row of the rolling window.


def RSI(self, idx, period=14):

Non-technical

This function measures the strength and speed of price movements in a market by comparing recent gains to recent losses, creating a value between zero and one hundred that helps identify potential turning points in price trends. It examines a specific number of recent price points to determine whether upward momentum or downward pressure is dominating the market, with values near the upper end suggesting the asset might be overextended to the upside and values near the lower end indicating potential oversold conditions, giving traders insight into possible reversal opportunities without predicting exact price levels.

Technical

  • idx: Integer parameter specifying which column of price data to analyze. Determines which series of values (like closing prices) the indicator will be calculated from.
  • period: Integer parameter (default 14) setting the lookback period for the calculation. Larger values create smoother but less responsive readings, while smaller values make the indicator more sensitive to recent price changes.
  • The function adds exactly 1 column to the rolling window.

Returns

Returns the updated rolling window (a list of lists) with the RSI value appended as a new column to the most recent row.


def ADX(self, high_idx=2, low_idx=3, close_idx=4, period=14):

Non-technical

This function helps traders understand the strength and direction of market trends by analyzing price movements over time, revealing whether an asset is experiencing a strong directional movement or moving sideways without clear momentum, which can guide decisions about entering or exiting positions based on the conviction behind price changes.

Technical

  • high_idx: An integer specifying which column in the data contains the highest price values for each time period; default is 2. This determines where the function looks for peak prices to calculate directional movement.
  • low_idx: An integer specifying which column in the data contains the lowest price values for each time period; default is 3. This determines where the function looks for bottom prices to calculate directional movement.
  • close_idx: An integer specifying which column in the data contains the closing price values for each time period; default is 4. This determines where the function looks for settlement prices used in range calculations.
  • period: An integer representing the number of previous time periods to analyze; default is 14. Larger values create smoother trend measurements but respond more slowly to recent price changes, while smaller values react faster but with more noise.
  • The function adds 3 columns to the rolling window matrix: Positive Directional Indicator (+DI), Negative Directional Indicator (-DI), and Average Directional Index (ADX).

Returns

Returns the updated rolling window as a list of lists containing all historical price data plus the newly calculated indicator values appended to the most recent row.


def BollingerBands(self, idx, period=20, stddev_mult=2):

Non-technical

This function creates a visual representation of price movement boundaries that expand and contract based on market volatility. It establishes a central line representing the average price over a specific timeframe, then calculates two additional lines that sit equidistant above and below this center point. When prices move closer to the outer boundaries, it suggests the market is experiencing unusual activity compared to recent history, while prices near the center line indicate more typical trading conditions. The width between these boundaries automatically adjusts to reflect whether the market is currently calm or experiencing rapid price changes, helping users identify potential turning points when prices approach or breach these dynamic thresholds.

Technical

  • idx: Integer representing the column index containing the moving average values to use as the middle band; must point to valid numerical data in the window
  • period: Integer (default 20) specifying the lookback window for volatility calculation; larger values create smoother but less responsive bands
  • stddev_mult: Float (default 2) determining how many standard deviations the bands sit from the middle line; higher values create wider bands that touch price less frequently
  • Adds exactly 5 new columns to the rolling window matrix: mean, variance, standard deviation, upper band, and lower band

Returns

Returns the updated rolling window as a list of lists with the Bollinger Band calculations appended to the last row.


def BollingerBandsB(self, CloseIDX, UpperBandIDX, LowerBandIDX):

Non-technical

This function determines how close the current price is to the upper or lower boundary of a price channel that naturally forms around market movements. It creates a simple measurement that shows whether the price is near the top, middle, or bottom of this channel, with values above one indicating the price has moved beyond the expected upper limit, values below zero showing it has dropped below the expected lower limit, and values around 0.5 placing it right in the middle. This helps identify potential turning points when prices approach or breach these natural boundaries, giving insight into whether the market might be overextended in either direction.

Technical

  • CloseIDX: Integer representing the position of closing price data in the analysis window; determines which price values to compare against the bands
  • UpperBandIDX: Integer specifying where the upper boundary values are stored in the analysis window; must correspond to pre-calculated Bollinger Band values
  • LowerBandIDX: Integer indicating the location of lower boundary values in the analysis window; must correspond to pre-calculated Bollinger Band values
  • Adds exactly 1 column to the rolling window matrix

Returns

Returns the updated rolling window matrix (a list of lists) with the %B value appended to the most recent row.


def MACD(self, idxFAST, idxSLOW, period=9, signal_func=None):

Non-technical

This function calculates a popular trading indicator that helps identify potential trend changes and momentum in financial markets by comparing two different smoothed price lines. It creates three visual components: a main line showing the difference between these two price trends, a secondary smoothed line of that main indicator, and a bar chart displaying the growing or shrinking gap between them. When the bars grow taller, it signals increasing momentum in the current direction, while shrinking bars suggest weakening momentum that might precede a trend reversal. The indicator automatically adjusts when there isn't enough historical data to make complete calculations, ensuring it provides meaningful information as soon as possible while avoiding misleading signals during early data collection.

Technical

  • idxFAST: An integer specifying the position of the faster moving average column in the data window. This determines which pre-calculated trend line serves as the quicker-reacting component of the indicator.
  • idxSLOW: An integer specifying the position of the slower moving average column in the data window. This determines which pre-calculated trend line serves as the baseline reference for comparison.
  • period: An integer with default value 9 representing the number of periods used to smooth the signal line. Larger values create a smoother but more delayed signal line.
  • signal_func: A callable function (or None) that determines the calculation method for the signal line smoothing. If not provided, defaults to exponential moving average calculation.
  • The function adds exactly 3 columns to the rolling window matrix.

Returns

Returns the updated rolling window (a list of lists) with three additional columns appended to the most recent data point containing the MACD line value, signal line value, and histogram value respectively.


def ATR(self, high_idx=1, low_idx=2, close_idx=4, period=14, malen=14, smooth_func=None):

Non-technical

This function measures how much prices are moving in the market by looking at both the daily price swings and any gaps between closing and opening prices. It tracks this movement over time to give you a sense of whether the market is becoming more turbulent or settling down, helping you understand when price changes are becoming more dramatic or more stable as new data arrives.

Technical

  • high_idx is an integer representing the position of highest price values in your data; changing this directs the function to use different price points for calculating daily ranges.
  • low_idx is an integer indicating where lowest price values are stored in your data; this determines which price points define the bottom of each period's trading range.
  • close_idx is an integer specifying the location of closing price values in your data; this affects how the function calculates gaps between consecutive periods.
  • period is an integer controlling how many recent periods are considered when averaging the price movement; larger values create smoother results while smaller values react faster to changes.
  • malen is an integer determining the smoothing length for the volatility measurement; it works similarly to period but specifically affects how quickly the indicator adapts to new volatility levels.
  • smooth_func is a function reference that specifies the calculation method for averaging the price movements; if not provided, it defaults to a specialized smoothing technique that emphasizes recent data.

Adds 2 columns to the rolling window (matrix).

Returns

Returns self.window, which is a list of lists representing the updated data structure with True Range and Average True Range values appended to each row.


def Stochastic(self, high_idx, low_idx, close_idx, k_period=14, k_smooth=3, d_smooth=3, ma_func=None):

Non-technical

This function helps identify potential turning points in market momentum by comparing current prices to historical price ranges over a specific timeframe. It creates a visual representation of how extreme current prices are relative to recent highs and lows, which can signal when an asset might be overbought or oversold. By smoothing these measurements through multiple calculations, it filters out short-term price noise to reveal underlying momentum trends that might indicate upcoming changes in market direction. The result provides traders with three complementary measurements that work together to highlight potential entry and exit points based on momentum shifts rather than just price movements alone.

Technical

  • high_idx: Integer specifying which data column contains the highest prices during each time period; this determines the upper boundary of the price range used in calculations
  • low_idx: Integer specifying which data column contains the lowest prices during each time period; this determines the lower boundary of the price range used in calculations
  • close_idx: Integer specifying which data column contains the closing prices used for comparison against the high-low range
  • k_period: Integer with default 14; sets how many previous time periods to examine when establishing the high-low price range; larger values create more stable but slower-reacting signals
  • k_smooth: Integer with default 3; determines how many periods to use when smoothing the initial momentum calculation to reduce false signals
  • d_smooth: Integer with default 3; specifies how many periods to use when creating the signal line that confirms momentum direction
  • ma_func: Callable function with default None; selects the smoothing technique for the calculations; if not specified, uses exponential smoothing that emphasizes recent price movements
  • The function adds 3 columns to the rolling window matrix.

Returns

Returns a list of lists representing the updated rolling window matrix with three additional columns for the stochastic oscillator values appended to the most recent row.


def WilliamsR(self, high_idx, low_idx, close_idx, period=14):

Non-technical

This function helps traders understand if an asset might be overbought or oversold by examining recent price movements. It looks at the highest and lowest prices over a specific timeframe and compares them to where the current price sits within that range. When the value gets close to zero, it suggests the asset might be overbought and could potentially drop soon, while values approaching negative one hundred indicate the asset might be oversold and could be due for a price increase. The calculation automatically updates as new price data comes in, giving traders a constantly refreshed perspective on market conditions without requiring them to manually track historical extremes.

Technical

  • high_idx: An integer specifying which column in the data contains the highest prices for each time period; affects the calculation by determining the upper boundary of the price range.
  • low_idx: An integer specifying which column in the data contains the lowest prices for each time period; affects the calculation by determining the lower boundary of the price range.
  • close_idx: An integer specifying which column in the data contains the closing prices for each time period; affects the calculation by showing where the current price sits within the recent high-low range.
  • period: An integer with default value 14 that determines how many recent time periods to analyze; affects the sensitivity of the indicator, with larger values creating a smoother but less responsive reading.
  • Adds exactly 1 column to the rolling window (matrix).

Returns

Returns the updated self.window, which is a list of lists containing the rolling price data with the Williams %R value appended as a new column to the most recent row; the Williams %R value is a float between 0 and -100 when calculated successfully, or None when insufficient data is available.


def Volatility(self, CloseIDX=4, periods=19):

Non-technical

This function measures how much prices have been fluctuating recently by looking at historical price changes. It examines a specific number of past price points to determine the typical size of price movements, with larger values indicating more erratic price behavior and smaller values suggesting more stable conditions. The calculation considers the percentage changes between consecutive prices to provide a standardized measure of market turbulence that can be compared across different assets or time periods, helping to identify whether current market conditions are unusually calm or volatile compared to recent history.

Technical

  • CloseIDX - An integer representing which column in the data window contains the closing prices to analyze; higher values would look at different price data points but typically 4 refers to standard closing prices; affects which price series is used for volatility calculation
  • periods - An integer specifying how many historical price points to include in the volatility calculation; larger values produce smoother but more lagged volatility measurements while smaller values make the indicator more responsive to recent price changes; must be at least 2 for meaningful calculation
  • The function adds exactly 1 column to the rolling window (matrix).

Returns

Returns the updated window (a list of lists) with the volatility value appended as a new column to the most recent row; the volatility value itself is a floating-point number representing the standard deviation of percentage returns over the specified period.


def RDVolatility(self, CloseIDX=4, periods=19):

Non-technical

This function calculates a special spacing measure that helps determine how far apart to place trading levels in an automated grid trading system, examining recent price movements to understand market turbulence and then automatically adjusting the distance between trading points; when prices jump around more than usual, it increases the space between levels to prevent too many trades from triggering too quickly, while during calm periods it brings the levels closer together to capture smaller price movements, creating a self-adjusting system that works effectively across different market conditions without requiring manual tweaks or predictions about future price direction.

Technical

  • CloseIDX: An integer specifying which column in the data contains closing prices; larger values select different price points; default is 4
  • periods: An integer determining how many recent price points to analyze; affects responsiveness to market changes; larger values make the calculation smoother but slower to react; default is 19
  • Adds exactly 1 column to the rolling window

Returns

Returns the updated rolling window (a list of lists) with the new RDVolatility value added as an additional column to the most recent row.


def ASVolatility(self, CloseIDX=4, periods=19):

Non-technical

This function calculates a sophisticated measure of market turbulence by examining how prices have moved in relation to each other over recent time periods, helping traders understand whether the market is experiencing calm stability or unpredictable swings; it processes historical price movements to create a mathematical representation of uncertainty that adjusts automatically as new data arrives, providing valuable insight for making trading decisions that account for current market conditions without relying on simple price ranges or fixed thresholds.

Technical

  • CloseIDX: An integer specifying which column in the data window contains closing price information. This determines where the function looks for the primary price data it analyzes to measure volatility.
  • periods: An integer indicating how many recent price observations to include in the volatility calculation. Larger values create a smoother, longer-term volatility measurement while smaller values make the indicator more responsive to immediate price changes.
  • The function adds 4 columns to the rolling window (matrix).

Returns

Returns the updated rolling window as a list of lists containing the historical market data with four new volatility calculation columns appended.


def BSVolatility(self, CloseIDX=4, periods=19):

Non-technical

This function measures how much an asset's price tends to fluctuate over time by examining its recent price movements, calculating both the average size of price changes and how consistently those changes occur, which helps determine how unpredictable the asset might be in the near future.

Technical

  • CloseIDX: The integer position that identifies which price data to analyze, typically representing the closing price column; affects which price values are used in the volatility calculation.
  • periods: The integer number of recent price observations to consider; determines how far back the analysis looks, with larger values smoothing out short-term fluctuations but responding more slowly to new market conditions.
  • The function adds 4 columns to the rolling window.

Returns

Returns the updated rolling window (list of lists) with 4 new volatility-related columns appended to the most recent data row.


def Support(self, low_idx=3, period=14):

Non-technical

This function helps identify potential price floors in financial markets by analyzing recent price movements to determine where buying interest might naturally increase, creating a level where prices tend to stop falling and potentially reverse direction; it examines a specified window of historical price data to pinpoint the lowest price point within that timeframe, which traders can use as a reference for potential support zones where market sentiment might shift from bearish to bullish.

Technical

  • low_idx - An integer representing the position of the low price data within each price record; determines which price values are used to calculate support; higher values would look at different price metrics
  • period - An integer specifying how many recent price periods to analyze when determining support; larger values consider more historical data and produce more stable but less responsive support levels
  • The function adds exactly 1 column to the rolling window.

Returns

Returns the updated rolling window (a list of lists) with the newly calculated support level appended as an additional column to the most recent price record.


def Resistance(self, high_idx=2, period=14):

Non-technical

This function helps identify potential price barriers in the market by analyzing recent price movements to determine the highest level that prices have reached over a specific timeframe, which can indicate where buying pressure might weaken and selling pressure could increase, potentially slowing or reversing an upward price trend.

Technical

  • high_idx: An integer specifying which price data column contains the highest values to analyze, where the default setting focuses on the standard high price column, and changing this value allows examining different price metrics for resistance calculation.
  • period: An integer determining how many recent price intervals to examine when identifying resistance levels, with larger values creating more stable but less responsive indicators and smaller values making the calculation more sensitive to recent price changes.
  • The function adds exactly 1 column to the rolling window matrix.

Returns

Returns self.window, which is a list of lists containing the complete rolling price data structure with the newly calculated resistance level appended as an additional column to the most recent row, where the resistance value represents the highest price observed during the specified period.


def PSAR(self, HighIDX=2, LowIDX=3, startAF=0.02, stepAF=0.02, maxAF=0.2):

Non-technical

This function calculates a special market tracking tool that helps identify potential turning points in price direction by analyzing recent price movements. It continuously monitors whether prices are trending upward or downward and establishes specific reference points that signal when the market might be preparing to change direction. As prices move, the system automatically adjusts its calculations to stay responsive to the current market conditions, providing visual markers that can help identify optimal moments for entering or exiting positions. The tool becomes more sensitive as trends strengthen while maintaining stability during sideways price action, creating a dynamic reference system that adapts to changing market environments without requiring manual adjustments.

Technical

  • HighIDX is an integer representing the column position where high price values are stored in the data matrix; it determines which price data the calculation uses for upper price movements.
  • LowIDX is an integer representing the column position where low price values are stored in the data matrix; it determines which price data the calculation uses for lower price movements.
  • startAF is a float representing the initial acceleration factor that controls how quickly the indicator responds to price changes at the beginning of a trend; smaller values create smoother but less responsive signals.
  • stepAF is a float representing the increment by which the acceleration factor increases as a trend continues; larger values make the indicator become more sensitive faster during sustained trends.
  • maxAF is a float representing the maximum value the acceleration factor can reach; it prevents the indicator from becoming overly sensitive during extremely strong trends.
  • The function adds 4 columns to the rolling window (matrix): SAR value, trend direction, extreme point, and acceleration factor.

Returns

Returns the updated rolling window data structure (a list of lists) with four additional columns appended to the most recent row containing the Parabolic SAR calculations.


def Momentum(self, colIDX, period=10):

Non-technical

This function helps you understand how quickly something is changing by comparing its current state to where it was some time ago, similar to noticing whether a car is speeding up or slowing down by checking its position at two different moments. It calculates the difference between the present value and what it was a specific number of steps in the past, then records this difference so you can see if values are gaining strength or losing steam over time, which is useful for spotting trends and making informed decisions about what might happen next.

Technical

  • colIDX - An integer representing the position of the data column to analyze; specifies which measurement to calculate momentum for; larger values select different indicators in the dataset; must be a valid column number within the available data.
  • period - An integer representing the time span to look back; defaults to 10; determines how many previous data points are used to calculate the momentum; larger values show longer-term momentum while smaller values reveal more immediate changes; must be a positive whole number.
  • Always adds exactly 1 column to the rolling window.

Returns

Returns the updated rolling window (a list of lists) with the momentum value appended as a new column to the most recent data row; the momentum value is a numerical difference or None if insufficient historical data is available.


def RateOfChange(self, colIDX, period=10,absolute=False):

Non-technical

This function measures how quickly something is changing by comparing its current state to where it was some time ago, then expressing that difference as a percentage. Imagine tracking the growth of a plant by measuring its height today and comparing it to its height a week ago - this tool does the same for any measurement you're monitoring, showing you whether things are speeding up or slowing down. When you want to know if a trend is gaining momentum or losing steam, this calculation reveals the pace of movement, with positive values indicating growth and negative values showing decline, while an optional setting lets you focus purely on the size of change regardless of direction.

Technical

  • colIDX: Integer representing which specific data measurement to analyze; determines which column of values from your dataset will be used for the comparison
  • period: Integer with default value of 10; specifies how many historical intervals to look back when making the comparison; larger values show longer-term changes while smaller values reveal more immediate shifts
  • absolute: Boolean with default value of False; when enabled, calculates only the magnitude of change (always positive), while disabled shows directional change (positive for increases, negative for decreases)

Adds exactly 1 column to the rolling window matrix.

Returns

Returns the updated window (a list of lists) with the Rate of Change value appended as a new column to the most recent row.


def OBV(self, closeIDX=4, volumeIDX=5):

Non-technical

This function creates a visual representation of how trading activity relates to price changes over time by building a running total that grows when prices rise and shrinks when prices fall. It uses the amount traded during each period as the measure of change, creating a continuous line that reveals whether buyers or sellers are demonstrating stronger conviction through their volume activity. The resulting indicator helps identify potential trend confirmations or early warnings of market sentiment shifts by showing whether trading volume is supporting the current price direction or suggesting a possible change in momentum, making it particularly useful for spotting divergences between price movements and market participation.

Technical

  • closeIDX: An integer specifying which position in the data records contains the closing price values. This determines where the function looks to compare current and previous prices for calculating volume direction.
  • volumeIDX: An integer specifying which position in the data records contains the trading volume values. This determines where the function finds the amount to add or subtract from the running total based on price changes.
  • The function adds exactly 1 column to the rolling window (matrix).

Returns

Returns the updated rolling window (a list of lists) with the newly calculated On-Balance Volume value added as an additional column to the most recent data point.


def VolumePriceTrend(self, OpenIDX=1, HighIDX=2, LowIDX=3, CloseIDX=4, VolIDX=5):

Non-technical

This function tracks how trading volume relates to price movements over time, creating a running total that grows when prices rise with volume and shrinks when prices fall with volume. It helps identify whether volume is confirming or contradicting price trends, which can signal potential market strength or weakness. By continuously updating this relationship with each new price and volume data point, it provides traders with a cumulative indicator that reveals underlying market sentiment and potential trend changes before they become obvious in price alone.

Technical

  • OpenIDX - An integer representing the position of opening prices in the data sequence; determines which column contains opening values for calculation
  • HighIDX - An integer representing the position of highest prices in the data sequence; determines which column contains peak values for calculation
  • LowIDX - An integer representing the position of lowest prices in the data sequence; determines which column contains trough values for calculation
  • CloseIDX - An integer representing the position of closing prices in the data sequence; determines which column contains closing values used as the primary price reference
  • VolIDX - An integer representing the position of volume data in the data sequence; determines which column contains trading volume values for calculation
  • The function adds exactly 1 column to the rolling window matrix

Returns

Returns the updated window matrix (a list of lists) with the Volume Price Trend value appended as a new column to the most recent data row. This is the same window object that was passed to the function, modified in place.


def VWAP(self, OpenIDX=1, HighIDX=2, LowIDX=3, CloseIDX=4, VolIDX=5):

Non-technical

This function calculates a special kind of average price that considers both how much prices moved and how actively trading occurred at different price levels throughout the day. Unlike a simple average that treats all prices equally, it gives more weight to prices where more buying and selling happened, creating a more meaningful reference point that reflects the true market activity. As new price and volume information arrives, it continuously updates this calculation, building a running picture of where the majority of trading has taken place, which helps traders understand whether current prices represent good value compared to the day's overall trading activity.

Technical

  • OpenIDX: An integer representing the position of opening prices in the data window; determines which column contains starting price values for each trading period.
  • HighIDX: An integer representing the position of highest prices in the data window; determines which column contains peak price values for each trading period.
  • LowIDX: An integer representing the position of lowest prices in the data window; determines which column contains bottom price values for each trading period.
  • CloseIDX: An integer representing the position of closing prices in the data window; determines which column contains ending price values for each trading period.
  • VolIDX: An integer representing the position of volume data in the data window; determines which column contains trading activity measurements that weight the importance of each price level.
  • The function adds exactly 3 columns to the rolling window matrix.

Returns

Returns the updated rolling window matrix (a list of lists) containing the cumulative price-volume product, cumulative volume, and the calculated VWAP value for each row. The function modifies the internal window structure and returns this same structure as its output.


def Vortex(self, OpenIDX=1, HighIDX=2, LowIDX=3, CloseIDX=4, period=14):

Non-technical

This function helps identify the direction and strength of price movements in financial markets by analyzing how prices have been moving over time. It creates two lines that show whether buying pressure or selling pressure is dominating the market, along with a measure of overall price volatility. When one line crosses above the other, it can signal potential changes in market direction that traders might use to make decisions about entering or exiting positions. The calculation considers both the size of price movements and how they relate to each other, providing a clearer picture of whether the market is likely to continue moving in its current direction or might be changing course, with the time period analyzed being adjustable to suit different trading styles and market conditions.

Technical

  • OpenIDX - An integer representing the column index where opening prices are stored in the data window; defaults to 1; determines which column of price data is used as the opening price reference
  • HighIDX - An integer representing the column index where highest prices are stored in the data window; defaults to 2; determines which column of price data is used as the high price reference
  • LowIDX - An integer representing the column index where lowest prices are stored in the data window; defaults to 3; determines which column of price data is used as the low price reference
  • CloseIDX - An integer representing the column index where closing prices are stored in the data window; defaults to 4; determines which column of price data is used as the closing price reference
  • period - An integer representing the number of periods (candles) to include in the calculation; defaults to 14; larger values make the indicator smoother but less responsive, while smaller values make it more sensitive to recent price movements
  • The function adds 3 new columns to the rolling window matrix.

Returns

Returns the updated rolling window matrix (a list of lists) with the Vortex Indicator values appended as new columns to the most recent row; the function modifies the internal state of the object by adding columns to the rolling window rather than returning a separate value.


def Aroon(self, HighIDX=2, LowIDX=3, period=14):

Non-technical

This function helps identify whether a market is trending and in which direction by analyzing recent price movements. It examines a specific window of time to determine how recently the highest and lowest prices occurred, then converts these observations into two easy-to-interpret values that range from 0 to 100. When the value indicating recent highs is significantly higher than the value for recent lows, it suggests an upward trend is developing, while the opposite pattern indicates a potential downward movement. The tool essentially translates the timing of price extremes into a clear signal about market momentum without requiring complex interpretation.

Technical

  • HighIDX: Specifies which column in the data contains the high prices, expected as an integer. A higher value would point to a different column in the dataset, potentially using a different price series for the calculation.
  • LowIDX: Indicates which column in the data contains the low prices, expected as an integer. Changing this value would select a different price series to identify the lowest points in the calculation.
  • period: Determines the lookback window size for the analysis, expected as an integer. Larger values make the indicator more sensitive to longer-term trends while smaller values focus on recent price action.
  • The function adds exactly 2 new columns to the rolling window matrix (Aroon Up and Aroon Down).

Returns

Returns the updated rolling window matrix (self.window) with two additional columns containing the Aroon Up and Aroon Down values. The return type is a list of lists representing the windowed market data with the new indicator values appended.


def IchimokuCloud(self, tenkan_idx, kijun_idx, senkouA_idx, senkouB_idx, chikou_idx, close_idx=4):

Non-technical

This function analyzes market price movements to identify potential trend directions and trading opportunities by examining the relationship between current prices and various reference points. It creates visual signals that help determine whether the market is showing strength, weakness, or indecision, and whether recent price action confirms these conditions. The analysis considers multiple aspects of market behavior to provide a comprehensive view that can guide decision-making about when to enter or exit positions, with special attention to how current prices interact with historical reference zones and delayed price observations that trail behind the current market action.

Technical

  • tenkan_idx - An integer representing the column index for the conversion line, which affects the calculation of short-term trend direction and crossover signals
  • kijun_idx - An integer representing the column index for the base line, which affects the calculation of medium-term trend direction and crossover signals
  • senkouA_idx - An integer representing the column index for the first cloud boundary, which defines one edge of the Ichimoku cloud formation
  • senkouB_idx - An integer representing the column index for the second cloud boundary, which defines the opposite edge of the Ichimoku cloud formation
  • chikou_idx - An integer representing the column index for the lagging span, which provides confirmation of current price action against historical prices
  • close_idx - An integer representing the column index for the closing price, with a default value of 4, which serves as the reference point for comparison with other elements
  • The function adds 4 columns to the rolling window matrix under normal operation.

Returns

Returns the updated self.window, which is a list of lists representing the rolling window of price data with additional columns for Ichimoku Cloud signals appended.


def GannFan(self, HighIDX=2, LowIDX=3, lookback=50, scale=None, direction=long):

Non-technical

This function creates a visual tool that helps traders understand the strength and direction of market trends by drawing angled lines from a significant price point. It automatically identifies an important low point for upward trends or a high point for downward trends within a recent timeframe, then calculates three different trend lines that project from that point at varying steepness. These lines help traders see whether prices are moving strongly with the trend, weakening, or potentially reversing, providing guidance on when market momentum might be shifting. The tool adjusts itself based on the natural price movements of the specific asset being analyzed, making it adaptable across different markets without requiring manual calibration.

Technical

  • HighIDX: Integer parameter specifying which column in the data contains high prices; affects which price values are used to find the highest points for short direction analysis
  • LowIDX: Integer parameter specifying which column in the data contains low prices; affects which price values are used to find the lowest points for long direction analysis
  • lookback: Integer parameter determining how many recent price bars to examine when finding the anchor point; larger values consider a longer historical period
  • scale: Optional numeric parameter or string 'auto' that controls the geometric relationship between price movement and time; when None, the function automatically calculates an appropriate scale based on recent price range
  • direction: String parameter that can be 'long' or 'short', determining whether the tool anchors to lows (for upward trends) or highs (for downward trends)
  • The function adds 5 columns to the rolling window.

Returns

Returns the updated rolling window (a list of lists) with 5 additional columns appended to the most recent row containing the Gann Fan calculations: anchor price, time delta, 2x1 angle, 1x1 angle, and 1x2 angle values.


def GannHiLoActivator(self, HighIDX=2, LowIDX=3, CloseIDX=4, period=3):

Non-technical

This function helps identify market trends by analyzing price movements over a specific timeframe. It creates a dynamic signal line that adjusts based on whether prices are trending upward or downward. When prices consistently stay above a certain threshold, the system identifies an upward trend and sets a support line; when prices consistently fall below another threshold, it identifies a downward trend and sets a resistance line. This signal line moves with the market, providing traders with visual cues about potential entry and exit points as market conditions change. The system automatically updates these signals as new price data becomes available, helping users track trend direction without constant manual adjustment.

Technical

  • HighIDX - An integer representing the position of high prices in the data window; determines which column contains the highest price values for each time period; higher values would reference different data columns
  • LowIDX - An integer representing the position of low prices in the data window; determines which column contains the lowest price values for each time period; higher values would reference different data columns
  • CloseIDX - An integer representing the position of closing prices in the data window; determines which column contains the ending price values for each time period; higher values would reference different data columns
  • period - An integer specifying how many recent time periods to analyze when calculating the trend signals; larger values make the indicator smoother but slower to respond to price changes, while smaller values make it more sensitive but potentially noisier
  • The function adds exactly 4 new columns to the rolling window matrix.

Returns

Returns the updated rolling window data structure (a list of lists) with 4 additional columns appended to the most recent row containing the calculated Simple Moving Average of highs, Simple Moving Average of lows, trend direction value, and the activator line value.


def GannSquareOfNine(self, HighIDX=2, LowIDX=3, CloseIDX=4, period=100, direction=long):

Non-technical

This function helps traders identify potential price targets and stop levels by applying a geometric approach to market movements, where it examines recent price extremes to establish reference points and then calculates future price levels based on mathematical relationships that follow specific angular patterns, providing guidance on where prices might find support or resistance as they move through different phases of the market cycle.

Technical

  • HighIDX is an integer representing the column position where high prices are stored in the data window; determines which price data to use when identifying the highest price points; larger values would reference different data columns.
  • LowIDX is an integer representing the column position where low prices are stored in the data window; determines which price data to use when identifying the lowest price points; larger values would reference different data columns.
  • CloseIDX is an integer representing the column position where closing prices are stored in the data window; determines which price data to use as the current reference point for calculations; larger values would reference different data columns.
  • period is an integer representing how many recent price bars to analyze when determining the reference price point; larger values consider more historical data while smaller values focus on recent movements.
  • direction is a string specifying whether to analyze for upward ("long") or downward ("short") market movements; affects whether the indicator looks for the lowest low or highest high as the reference point; must be either "long" or "short".
  • The function adds 4 columns to the rolling window (matrix).

Returns

Returns the updated rolling window (a list of lists) with four additional columns appended to the most recent row containing the anchor price, degrees of rotation, next target level, and major support/resistance level.


def Doji(self,OpenIDX=1,HighIDX=2,LowIDX=3,CloseIDX=4,threshold=0.1):

Non-technical

This function examines the most recent price movement to identify a specific pattern where the starting and ending prices are nearly identical, suggesting the market is uncertain about which direction to move. It carefully measures how much the price fluctuated during the period and compares the difference between the starting and ending prices to this total movement, then determines if this difference is small enough to qualify as the special pattern that often signals a potential change in market direction.

Technical

  • OpenIDX - Integer representing the column position where opening prices are stored; higher values would look at different data points instead of openings, affecting which price is used as the starting point for comparison
  • HighIDX - Integer representing the column position where highest prices are stored; changing this would use different values for measuring the top boundary of price movement
  • LowIDX - Integer representing the column position where lowest prices are stored; modifying this would use different values for measuring the bottom boundary of price movement
  • CloseIDX - Integer representing the column position where closing prices are stored; adjusting this would change which price is compared against the opening price
  • threshold - Floating point number between 0 and 1 that determines how small the difference between opening and closing prices must be relative to the total price movement to qualify as the pattern; lower values make the pattern detection more strict while higher values make it more lenient
  • The function adds 6 new columns to the rolling window (matrix).

Returns

Returns the updated window (a list of lists) with 6 additional columns appended to the most recent row, containing measurements related to the candlestick pattern analysis.


def TriStarDoji(self,OpenIDX=1,HighIDX=2,LowIDX=3,CloseIDX=4,threshold1=0.1,threshold2=0.1,threshold3=0.1):

Non-technical

This function identifies a rare candlestick pattern called the Tri-Star Doji, which appears when three consecutive price candles all have extremely small bodies where opening and closing prices are nearly identical, creating what looks like three small crosses on the chart. When this distinctive three-candle formation appears after a strong trend, it often signals that market momentum is weakening and a potential price reversal might be approaching, helping traders recognize important turning points where the direction of price movement could change significantly.

Technical

  • OpenIDX is an integer specifying which column in the price data contains opening values; this determines where to find the starting price for each candle and defaults to 1
  • HighIDX is an integer specifying which column contains the highest prices; this identifies the peak value for each candle and defaults to 2
  • LowIDX is an integer specifying which column contains the lowest prices; this identifies the bottom value for each candle and defaults to 3
  • CloseIDX is an integer specifying which column contains closing values; this determines where to find the ending price for each candle and defaults to 4
  • threshold1 is a float between 0 and 1 that sets how strict the first candle must be to qualify as a doji; smaller values require tighter alignment between open and close prices and defaults to 0.1
  • threshold2 is a float between 0 and 1 that sets the strictness for the second candle to qualify as a doji; smaller values create stricter requirements and defaults to 0.1
  • threshold3 is a float between 0 and 1 that sets the strictness for the third candle to qualify as a doji; smaller values create stricter requirements and defaults to 0.1
  • The function adds 1 column to the rolling window matrix when successful

Returns

Returns the updated window as a list of lists containing the price data with the Tri-Star Doji indicator value appended to the most recent row.


def Hammer(self,OpenIDX=1,HighIDX=2,LowIDX=3,CloseIDX=4):

Non-technical

This function examines the most recent price movement to identify a specific pattern known as a hammer, which often signals a potential reversal from a downward trend to an upward trend. It carefully analyzes the relationship between the opening price, closing price, highest price, and lowest price during a trading period to determine if the visual shape of this price movement matches the distinctive characteristics of a hammer pattern. When the pattern is detected, the function marks it clearly so traders can recognize this potential turning point in market direction, helping them make more informed decisions about possible entry points for buying opportunities after a period of decline.

Technical

  • OpenIDX - An integer representing the position of opening price data within each row of historical market data; determines which column contains opening prices and affects pattern detection accuracy based on correct data alignment
  • HighIDX - An integer representing the position of highest price data within each row of historical market data; determines which column contains peak prices for the period and influences the upper shadow calculation
  • LowIDX - An integer representing the position of lowest price data within each row of historical market data; determines which column contains bottom prices for the period and affects the lower shadow measurement
  • CloseIDX - An integer representing the position of closing price data within each row of historical market data; determines which column contains ending prices and impacts the body size calculation
  • The function adds exactly 1 column to the rolling window matrix.

Returns

Returns the updated rolling window matrix (a list of lists) with the hammer pattern detection result appended as a new column to the most recent data row, where the value is 1 if a hammer pattern was identified or 0 if no hammer pattern was found.


def InvertedHammer(self,OpenIDX=1,HighIDX=2,LowIDX=3,CloseIDX=4):

Non-technical

This function identifies a specific candlestick pattern known as the Inverted Hammer, which often signals a potential upward reversal in price movement after a downtrend. It examines the most recent price bar to determine if the upper shadow is significantly longer than the main body while the lower shadow remains relatively short, characteristics that suggest buyers attempted to push prices higher but faced resistance. When these conditions are met, the function marks the pattern with a clear signal that traders can use to anticipate possible bullish momentum developing in the market.

Technical

  • OpenIDX - An integer representing the position of opening prices within each data row; changing this value directs the function to use a different column for opening price analysis which affects pattern recognition accuracy
  • HighIDX - An integer representing the position of highest prices within each data row; modifying this value adjusts which column is examined for price peaks affecting the upper shadow measurement
  • LowIDX - An integer representing the position of lowest prices within each data row; altering this value changes which column is used for price bottoms affecting the lower shadow calculation
  • CloseIDX - An integer representing the position of closing prices within each data row; adjusting this value determines which column is compared against opening prices to calculate the candle body size
  • The function adds exactly 1 column to the rolling window (matrix)

Returns

Returns the updated window (list of lists) with the Inverted Hammer detection result added as a new column to the most recent row; the result is either 1 (pattern detected) or 0 (pattern not detected).


def SpinningTop(self,OpenIDX=1,HighIDX=2,LowIDX=3,CloseIDX=4):

Non-technical

This function identifies a specific candlestick pattern called the Spinning Top, which appears when price movement creates a small central body with relatively long upper and lower shadows. It examines the most recent price data to determine if the current formation matches this pattern, which often signals market indecision or a potential trend reversal. When the pattern is detected, the function marks it clearly in the analysis system, helping traders recognize moments when buying and selling pressures are nearly balanced before a potential directional move.

Technical

  • OpenIDX - An integer representing the position of opening prices in the data sequence; determines which column contains opening values for pattern detection; higher values would point to different data columns
  • HighIDX - An integer representing the position of highest prices in the data sequence; determines which column contains peak values for pattern detection; higher values would point to different data columns
  • LowIDX - An integer representing the position of lowest prices in the data sequence; determines which column contains trough values for pattern detection; higher values would point to different data columns
  • CloseIDX - An integer representing the position of closing prices in the data sequence; determines which column contains closing values for pattern detection; higher values would point to different data columns Adds exactly 1 column to the rolling window (matrix)

Returns

Returns the updated window data structure with an additional column containing either 1 (indicating a Spinning Top pattern was detected) or 0 (no pattern detected).


def HangingMan(self,OpenIDX=1,HighIDX=2,LowIDX=3,CloseIDX=4):

Non-technical

This function examines the most recent price movement to identify a specific warning pattern that often appears at the top of an upward trend. It carefully analyzes the relationship between the opening price, highest price, lowest price, and closing price of the current time period to determine if they form a particular shape that resembles a person hanging from a noose. When this pattern emerges after a sustained rise in prices, it serves as a potential signal that the upward momentum may be weakening and a downward reversal could be approaching. The function provides a simple yes-or-no indication of whether this cautionary pattern is present in the latest market data.

Technical

  • OpenIDX is an integer representing the position of opening prices in the data window; changing this value selects which column contains opening price information for pattern detection
  • HighIDX is an integer representing the position of highest prices in the data window; determines which column provides the peak price values needed to identify the pattern's upper boundary
  • LowIDX is an integer representing the position of lowest prices in the data window; specifies which column contains the lowest price values required to measure the pattern's lower shadow
  • CloseIDX is an integer representing the position of closing prices in the data window; identifies which column holds the closing price values used to calculate the candle body size
  • The function adds exactly 1 column to the rolling window matrix containing the pattern detection result

Returns

Returns the updated rolling window matrix (a list of lists) with the Hanging Man detection result added as a new column, where the value is either 1 (indicating the pattern was detected) or 0 (indicating it was not detected).


def ShootingStar(self,OpenIDX=1,HighIDX=2,LowIDX=3,CloseIDX=4):

Non-technical

This function identifies a specific candlestick pattern known as the Shooting Star, which often signals a potential reversal from an uptrend to a downtrend. It examines the most recent price movement to determine if the pattern's distinctive shape is present - characterized by a small body near the bottom of the trading range with a long upper shadow and little to no lower shadow. When this pattern appears after an uptrend, it suggests that buyers initially pushed prices higher but were overwhelmed by sellers who drove prices back down toward the opening level, potentially indicating weakening bullish momentum. The function provides a clear signal that this pattern has formed, helping traders recognize potential turning points in market direction.

Technical

  • OpenIDX - Represents the column position where opening prices are stored in the data matrix; expected to be an integer; determines which column of the price data is used to identify the starting price of each trading period; affects the calculation of the candle body size
  • HighIDX - Represents the column position where highest prices are stored in the data matrix; expected to be an integer; determines which column of the price data is used to identify the peak price of each trading period; affects the calculation of the upper shadow length
  • LowIDX - Represents the column position where lowest prices are stored in the data matrix; expected to be an integer; determines which column of the price data is used to identify the lowest price of each trading period; affects the calculation of the lower shadow length
  • CloseIDX - Represents the column position where closing prices are stored in the data matrix; expected to be an integer; determines which column of the price data is used to identify the ending price of each trading period; affects the calculation of the candle body size
  • The function adds exactly 1 column to the rolling window matrix.

Returns

Returns the updated rolling window data structure (a list of lists) with the Shooting Star detection result appended as a new column. The result value is either 1 (indicating a Shooting Star pattern was detected) or 0 (indicating no pattern was detected).


def BullishMarubozu(self,OpenIDX=1,HighIDX=2,LowIDX=3,CloseIDX=4,threshold=0.1):

Non-technical

This function identifies a specific candlestick pattern called a Bullish Marubozu, which occurs when the market opens and closes with strong upward momentum throughout the entire trading period, showing minimal hesitation or retracement. It examines the most recent price movement to determine if the opening and closing prices are near the extreme boundaries of the trading range, indicating sustained buying pressure from start to finish. When this pattern appears, it suggests potential continuation of an upward trend, helping traders recognize moments of strong market conviction that might signal good entry points for bullish positions.

Technical

  • OpenIDX - An integer specifying which position in each data row contains opening prices; changing this value would cause the function to analyze different price points for pattern detection
  • HighIDX - An integer specifying which position in each data row contains highest prices; modifying this affects which price extremes are considered when identifying the pattern
  • LowIDX - An integer specifying which position in each data row contains lowest prices; different values would change which price lows are evaluated for the pattern recognition
  • CloseIDX - An integer specifying which position in each data row contains closing prices; altering this would cause the function to use alternative price points for confirmation
  • threshold - A floating-point number between 0 and 1 that controls the strictness of pattern recognition; smaller values require nearly perfect Marubozu formations while larger values allow for slightly longer wicks
  • The function adds exactly 1 column to the rolling window (matrix).

Returns

Returns a list of lists representing the updated price data window with the Bullish Marubozu detection result (1 for pattern present, 0 for absent) added as a new column.


def BearishMarubozu(self,OpenIDX=1,HighIDX=2,LowIDX=3,CloseIDX=4,threshold=0.1):

Non-technical

This function identifies a specific candlestick pattern known as a Bearish Marubozu, which signals strong downward price movement in financial markets. It examines the most recent price data to determine if there's been consistent selling pressure throughout the trading period with minimal price fluctuations above the opening price or below the closing price. When the pattern is detected, the function marks it clearly so traders can recognize this potential signal of bearish momentum. The sensitivity of the pattern detection can be adjusted to account for minor variations in real market data while still capturing the essential characteristics of this significant candlestick formation.

Technical

  • OpenIDX: Integer representing the column position where opening prices are stored; higher values shift which data point is considered the opening price and affects pattern recognition accuracy.
  • HighIDX: Integer representing the column position where highest prices are stored; determines which data point is evaluated as the peak price during the period.
  • LowIDX: Integer representing the column position where lowest prices are stored; identifies which data point is considered the lowest price point for analysis.
  • CloseIDX: Integer representing the column position where closing prices are stored; specifies which value indicates the final price of the trading period.
  • threshold: Float between 0 and 1 that controls how strict the pattern recognition is; smaller values require nearly perfect Marubozu formation while larger values allow for more shadow relative to the body size.
  • The function adds exactly 1 column to the rolling window matrix.

Returns

Returns the updated rolling window matrix (a list of lists) with the new column containing either 1 (indicating a Bearish Marubozu pattern was detected) or 0 (indicating no pattern was found).


def HighWave(self,OpenIDX=1,HighIDX=2,LowIDX=3,CloseIDX=4,threshold=2):

Non-technical

This function identifies a specific candlestick pattern known as a High Wave, which occurs when price movement during a trading period shows significant volatility in both directions but ultimately settles near its starting point. It examines the most recent price data to determine if the upper and lower shadows of the candle are substantially longer than the central body, indicating market indecision where neither buyers nor sellers could maintain control throughout the period. When this pattern appears, it suggests a potential shift in market sentiment or a pause in the current trend, helping traders recognize moments when the market is uncertain about its next direction.

Technical

  • OpenIDX: Integer representing the column position of opening prices in the data matrix; affects pattern detection by determining which values are used as opening prices; default value is 1
  • HighIDX: Integer representing the column position of highest prices in the data matrix; affects pattern detection by determining which values are used as peak prices; default value is 2
  • LowIDX: Integer representing the column position of lowest prices in the data matrix; affects pattern detection by determining which values are used as trough prices; default value is 3
  • CloseIDX: Integer representing the column position of closing prices in the data matrix; affects pattern detection by determining which values are used as closing prices; default value is 4
  • threshold: Float or integer specifying how many times longer the wicks must be compared to the body to qualify as a High Wave pattern; higher values make the pattern detection more strict; default value is 2
  • The function adds 1 column to the rolling window (matrix).

Returns

Returns the updated window matrix (list of lists) with a new column added containing either 1 (indicating a High Wave pattern was detected) or 0 (indicating no High Wave pattern).


def BullishBeltHold(self,OpenIDX=1,HighIDX=2,LowIDX=3,CloseIDX=4,threshold=0.1):

Non-technical

This function identifies a specific bullish candlestick pattern that often signals a potential reversal from a downtrend to an uptrend by examining the most recent price movement. It checks if the price opened near the lowest point of the trading period and then moved strongly upward throughout the session, creating a candle with minimal weakness at the bottom. When this distinctive pattern appears, the function marks it clearly so traders can recognize this potential turning point in market direction. The identification process is adjustable to account for different market conditions, allowing users to set how strictly the pattern must match the ideal formation before being recognized as a valid signal.

Technical

  • OpenIDX - An integer representing the position of opening prices in the data array; higher values would examine different price series but typically remains at default; determines which column contains opening price values for pattern detection
  • HighIDX - An integer representing the position of highest prices in the data array; higher values would examine different price series but typically remains at default; determines which column contains peak price values for pattern detection
  • LowIDX - An integer representing the position of lowest prices in the data array; higher values would examine different price series but typically remains at default; determines which column contains lowest price values for pattern detection
  • CloseIDX - An integer representing the position of closing prices in the data array; higher values would examine different price series but typically remains at default; determines which column contains closing price values for pattern detection
  • threshold - A decimal number between 0 and 1 that controls pattern strictness; smaller values require virtually no lower shadow while larger values allow slightly more imperfection; affects how precisely the candle must match the ideal pattern formation Adds 1 column to the rolling window (matrix)

Returns

Returns the updated window (a list of lists) with an additional column containing either 1 (indicating the Bullish Belt Hold pattern was detected) or 0 (indicating it was not detected). The function modifies the existing window object in place and returns this same object with the new pattern identification column appended.


def BearishBeltHold(self,OpenIDX=1,HighIDX=2,LowIDX=3,CloseIDX=4,threshold=0.1):

Non-technical

This function identifies a specific price pattern that often signals a potential shift from an upward trend to a downward movement in the market. It examines the most recent trading period to detect when prices opened near the high point and closed significantly lower with minimal upward movement during the session, indicating strong selling pressure that overwhelmed buyers throughout the trading period. When this distinctive formation appears, it suggests that market sentiment may be changing from bullish to bearish, helping traders recognize possible turning points before they become obvious to the broader market. The function automatically evaluates this pattern using customizable sensitivity settings to filter out weaker signals and focus on the most reliable formations that align with traditional technical analysis principles.

Technical

  • OpenIDX: Integer specifying which position in the price data represents opening values; typically corresponds to the standard opening price column; affects which price point is considered the starting level for pattern detection
  • HighIDX: Integer specifying which position in the price data represents highest values; typically corresponds to the standard high price column; determines which price point defines the upper boundary for the pattern's shadow measurement
  • LowIDX: Integer specifying which position in the price data represents lowest values; typically corresponds to the standard low price column; determines which price point defines the lower boundary for pattern analysis
  • CloseIDX: Integer specifying which position in the price data represents closing values; typically corresponds to the standard closing price column; affects which price point is considered the ending level for pattern detection
  • threshold: Floating-point number between 0 and 1 that controls pattern strictness; smaller values require the upper shadow to be proportionally smaller relative to the candle body; default value of 0.1 means the upper shadow must be no more than 10% of the body size for pattern recognition
  • The function adds exactly 1 column to the rolling window matrix containing the pattern detection result.

Returns

Returns the updated rolling window matrix (a list of lists) with one additional column containing either 1 (indicating the bearish belt hold pattern was detected) or 0 (indicating it was not detected).


def BullishEngulfing(self, OpenIDX=1, HighIDX=2, LowIDX=3, CloseIDX=4):

Non-technical

This function identifies a specific price pattern that often signals a potential shift from a downward trend to an upward trend in the market. It examines the most recent two price intervals, checking if the first shows prices moving down and the second shows prices moving up with such strength that it completely overtakes the previous interval's price movement. When this pattern appears, it suggests that buying pressure has overcome selling pressure, potentially indicating a good opportunity for the market to start moving higher. The function automatically marks this pattern when it occurs, helping traders recognize this potentially valuable signal without having to manually inspect each price movement.

Technical

  • OpenIDX - An integer representing the column index where opening prices are stored; it determines which column in the data matrix contains the opening values for each time period.
  • HighIDX - An integer representing the column index where highest prices are stored; it identifies which column contains the peak price values for each time period.
  • LowIDX - An integer representing the column index where lowest prices are stored; it specifies which column holds the lowest price values for each time period.
  • CloseIDX - An integer representing the column index where closing prices are stored; it indicates which column contains the ending price values for each time period.
  • The function adds exactly 1 column to the rolling window matrix.

Returns

Returns the updated window matrix (list of lists) with the Bullish Engulfing pattern detection result appended as a new column to the most recent row; the result is either 1 (pattern detected) or 0 (pattern not detected).


def BearishEngulfing(self, OpenIDX=1, HighIDX=2, LowIDX=3, CloseIDX=4):

Non-technical

This function identifies a specific price pattern in financial markets that often signals a potential shift from an upward trend to a downward trend. It examines the most recent two price periods on a chart, looking for a situation where the first period shows prices moving up, followed by a second period where prices open higher but close significantly lower, completely "engulfing" the range of the previous period. When this pattern appears after a sustained upward movement, it suggests that selling pressure has overcome buying pressure, potentially indicating that the market sentiment is changing from optimistic to pessimistic. The function automatically analyzes these price movements and provides a clear signal when this particular reversal pattern is detected, helping traders make more informed decisions about potential market direction changes.

Technical

  • OpenIDX - An integer representing the column position where opening prices are stored in the data matrix; higher values would look at different price series but typically stays at default; affects which price data is used to identify the pattern
  • HighIDX - An integer representing the column position where highest prices are stored in the data matrix; higher values would look at different price series but typically stays at default; affects which price data is used to identify the pattern
  • LowIDX - An integer representing the column position where lowest prices are stored in the data matrix; higher values would look at different price series but typically stays at default; affects which price data is used to identify the pattern
  • CloseIDX - An integer representing the column position where closing prices are stored in the data matrix; higher values would look at different price series but typically stays at default; affects which price data is used to identify the pattern
  • Adds 1 column to the rolling window (matrix)

Returns

Returns the updated rolling window (self.window) with a new column added that contains either 1 (indicating a bearish engulfing pattern was detected) or 0 (indicating no pattern was detected), with the return type being a list of lists representing the price data matrix.


def TweezerTops(self, OpenIDX=1, HighIDX=2, LowIDX=3, CloseIDX=4, tol=0.001):

Non-technical

This function identifies a specific price pattern that often signals a potential shift from an upward trend to a downward trend in financial markets. It carefully examines the most recent two price periods on a chart, looking for a situation where the first period shows prices moving up while the second shows prices moving down, with both periods reaching nearly identical highest price points. When these conditions align within a small margin of error, the function recognizes this formation as a meaningful signal that the current upward movement may be losing strength and a downward trend could be beginning, helping traders anticipate potential changes in market direction before they become obvious to most participants.

Technical

  • OpenIDX: Integer representing the column position where opening prices are stored; defaults to 1; determines which data column contains the starting price values for each period
  • HighIDX: Integer representing the column position where highest prices are stored; defaults to 2; determines which data column contains the peak price values for pattern recognition
  • LowIDX: Integer representing the column position where lowest prices are stored; defaults to 3; determines which data column contains the lowest price values for each period
  • CloseIDX: Integer representing the column position where closing prices are stored; defaults to 4; determines which data column contains the ending price values for each period
  • tol: Float representing the acceptable percentage difference between high prices; defaults to 0.001 (0.1%); controls how precisely the highest points of the two periods must match to qualify as the pattern Adds 1 column to the rolling window (matrix)

Returns

Returns the updated rolling window (list of lists) with a new column added containing either 1 (indicating a Tweezer Tops pattern was detected) or 0 (indicating no pattern was detected).


def TweezerBottoms(self, OpenIDX=1, HighIDX=2, LowIDX=3, CloseIDX=4, tol=0.001):

Non-technical

This function identifies a specific candlestick pattern called "Tweezer Bottoms" which often signals a potential reversal from a downtrend to an uptrend. It examines the most recent two price candles to determine if they form this pattern by checking if the first candle shows selling pressure while the second candle shows buying pressure, with both candles reaching nearly the same lowest price point. When this pattern appears, it suggests that sellers tried to push the price down to the same level twice but were unable to break below it, potentially indicating that buyers are stepping in at that support level. The function automatically marks whether this pattern exists in the current market data, helping traders spot potential turning points in price movement without requiring manual chart analysis.

Technical

  • OpenIDX - An integer representing which column in the price data contains the opening prices; changing this value directs the function to look at different parts of the data structure for opening prices
  • HighIDX - An integer representing which column in the price data contains the highest prices; changing this value directs the function to look at different parts of the data structure for high prices
  • LowIDX - An integer representing which column in the price data contains the lowest prices; changing this value directs the function to look at different parts of the data structure for low prices
  • CloseIDX - An integer representing which column in the price data contains the closing prices; changing this value directs the function to look at different parts of the data structure for closing prices
  • tol - A floating-point number representing the acceptable percentage difference between the lowest prices of the two candles; smaller values make the pattern recognition more strict while larger values make it more flexible
  • The function adds exactly 1 column to the rolling window matrix

Returns

Returns the updated rolling window matrix (a list of lists) with a new column added that contains either 1 (indicating a Tweezer Bottoms pattern was detected) or 0 (indicating no pattern was detected).


def PiercingLine(self, OpenIDX=1, HighIDX=2, LowIDX=3, CloseIDX=4):

Non-technical

This function identifies a specific bullish reversal pattern in price movements known as the Piercing Line, which helps traders spot potential turning points in a declining market. It examines the most recent two price periods to determine if the first shows a clear downward movement followed by a strong recovery where the second period opens even lower but then climbs significantly to close more than halfway up the previous period's range. When this distinctive pattern appears, it signals that buying pressure is building and could potentially reverse the downward trend, providing traders with an early indication that market sentiment might be shifting from bearish to bullish as the balance between buyers and sellers begins to change.

Technical

  • OpenIDX: Integer representing the column position where opening prices are stored in the data matrix. Determines which values are used as starting points for each price period.
  • HighIDX: Integer representing the column position where highest prices are stored in the data matrix. Determines which values define the upper boundaries of each price period.
  • LowIDX: Integer representing the column position where lowest prices are stored in the data matrix. Determines which values define the lower boundaries of each price period.
  • CloseIDX: Integer representing the column position where closing prices are stored in the data matrix. Determines which values are used as ending points for each price period.
  • The function adds exactly 1 column to the rolling window matrix.

Returns

Returns the updated rolling window as a list of lists with the new column containing either 1 (indicating the Piercing Line pattern was detected) or 0 (indicating it was not detected).


def DarkCloudCover(self, OpenIDX=1, HighIDX=2, LowIDX=3, CloseIDX=4):

Non-technical

This function identifies a specific price pattern that often signals a potential shift from an upward trend to a downward trend in the market. It examines the most recent two price periods, checking if the first period shows strong upward movement followed by a second period that opens higher but then drops significantly, closing well below the midpoint of the first period's range. When this pattern appears, it suggests that buying pressure may be weakening and sellers could be gaining control, which could indicate a good time to consider reducing positions or preparing for a potential price decline. The function simply marks whether this specific warning signal is present in the current market data.

Technical

  • OpenIDX - An integer representing the column position where opening prices are stored; affects which price data is used to determine if a candle is bullish or bearish
  • HighIDX - An integer representing the column position where highest prices are stored; affects the upper boundary of price movement analysis
  • LowIDX - An integer representing the column position where lowest prices are stored; affects the lower boundary of price movement analysis
  • CloseIDX - An integer representing the column position where closing prices are stored; affects the determination of candle direction and pattern completion
  • The function adds 1 column to the rolling window (matrix)

Returns

Returns the updated window (self.window), which is a list of lists containing the historical price data plus the newly added column indicating whether the Dark Cloud Cover pattern is present (1) or not (0).


def BullishHarami(self, OpenIDX=1, HighIDX=2, LowIDX=3, CloseIDX=4):

Non-technical

This function automatically identifies a specific candlestick pattern known as the Bullish Harami, which serves as a potential early warning that a downward price movement might be losing momentum and preparing to reverse direction. It carefully examines the most recent two price bars on a chart, looking for a distinctive formation where a large downward-moving bar is immediately followed by a smaller upward-moving bar that fits entirely within the body of the previous bar. When this pattern emerges after a sustained decline, it suggests that selling pressure may be weakening and buyers could be stepping in, potentially signaling a favorable moment to consider entering a long position or closing a short position. The function continuously monitors price action so traders don't need to manually scan charts for this subtle but meaningful formation, providing an objective signal that helps identify potential turning points in market direction.

Technical

  • OpenIDX - An integer representing the position of opening prices within each price data row; determines which column contains opening values for pattern detection
  • HighIDX - An integer representing the position of highest prices within each price data row; determines which column contains high values for pattern detection
  • LowIDX - An integer representing the position of lowest prices within each price data row; determines which column contains low values for pattern detection
  • CloseIDX - An integer representing the position of closing prices within each price data row; determines which column contains closing values for pattern detection
  • The function adds exactly 1 column to the rolling window matrix

Returns

Returns the updated rolling window matrix (a list of lists) with the Bullish Harami detection result added as a new column to the most recent row, where the value is either 1 (indicating the pattern was detected) or 0 (indicating it was not detected).


def BearishHarami(self, OpenIDX=1, HighIDX=2, LowIDX=3, CloseIDX=4):

Non-technical

This function identifies a specific price pattern that suggests a potential shift from a rising market to a falling one, helping traders recognize when an upward trend might be losing strength. It carefully examines the most recent two price periods on a chart, looking for a scenario where the first period shows a strong upward movement followed by a much smaller downward movement that fits entirely within the range of the first period. When this distinctive pattern appears, it serves as an early warning sign that the current upward momentum could be weakening and a downward trend might be beginning, allowing traders to make more informed decisions about when to adjust their positions before a significant market reversal occurs.

Technical

  • OpenIDX - An integer specifying which column in the data contains opening prices; changing this value would analyze different price series but typically corresponds to standard opening price data
  • HighIDX - An integer specifying which column in the data contains high prices; changing this value would analyze different price series but typically corresponds to standard high price data
  • LowIDX - An integer specifying which column in the data contains low prices; changing this value would analyze different price series but typically corresponds to standard low price data
  • CloseIDX - An integer specifying which column in the data contains closing prices; changing this value would analyze different price series but typically corresponds to standard closing price data
  • The function adds exactly 1 column to the rolling window (matrix) containing the pattern detection result.

Returns

Returns the updated window (a list of lists) with an additional column containing either 1 (indicating the Bearish Harami pattern was detected) or 0 (indicating the pattern was not detected).


def BullishHaramiCross(self, OpenIDX=1, HighIDX=2, LowIDX=3, CloseIDX=4, tol=0.001):

Non-technical

This function identifies a specific candlestick pattern known as the Bullish Harami Cross, which serves as a potential signal that a downward price trend might be reversing direction. It carefully examines the most recent two price bars on a chart, looking for a situation where the first bar shows a clear downward movement followed by a second bar that opens and closes at nearly the same price level, forming what's called a "doji." The function checks that this second bar is completely contained within the price range of the first bar. When this pattern appears after a sustained downtrend, it suggests that selling pressure may be diminishing and buyers could be starting to take control, potentially signaling a good opportunity to consider entering a long position. The function automatically analyzes the price data and marks when this specific pattern occurs, helping traders spot potential turning points in the market without requiring manual chart inspection.

Technical

  • OpenIDX - An integer representing the column index where opening prices are stored in the data window; determines which price series is analyzed for the open values of candlesticks
  • HighIDX - An integer representing the column index where high prices are stored in the data window; specifies which price series identifies the upper price boundary for pattern detection
  • LowIDX - An integer representing the column index where low prices are stored in the data window; specifies which price series identifies the lower price boundary for pattern detection
  • CloseIDX - An integer representing the column index where closing prices are stored in the data window; determines which price series is used to identify the closing price for pattern detection
  • tol - A floating-point number representing the tolerance threshold for identifying a doji candle; smaller values require the open and close to be more precisely equal to qualify as a doji
  • The function adds 1 column to the rolling window (matrix).

Returns

Returns the updated window (list of lists) with the Bullish Harami Cross signal added as a new column to the last row; the signal value is either 1 (indicating the pattern was detected) or 0 (indicating the pattern was not detected).


def BearishHaramiCross(self, OpenIDX=1, HighIDX=2, LowIDX=3, CloseIDX=4, tol=0.001):

Non-technical

This function identifies a specific candlestick pattern called the Bearish Harami Cross, which serves as an early warning that an upward price trend might be losing momentum and preparing to reverse direction. It carefully examines the most recent two price bars on a chart, checking whether the first bar shows strong upward movement with prices closing significantly higher than they opened, while the second bar reveals market indecision where prices opened and closed at nearly identical levels. When both conditions align with the second bar completely contained within the price range of the first bar's body, the function signals that buyers are potentially losing control and sellers may be gaining strength, offering traders valuable insight about a possible shift from a bullish to bearish market sentiment without requiring them to manually inspect each price movement.

Technical

  • OpenIDX - An integer representing the column position containing opening prices in the data window; determines which price values are used to identify the start of each candlestick and affects pattern recognition accuracy
  • HighIDX - An integer representing the column position containing highest prices in the data window; establishes the upper price boundary for each candlestick and influences the pattern's visual structure detection
  • LowIDX - An integer representing the column position containing lowest prices in the data window; establishes the lower price boundary for each candlestick and influences the pattern's visual structure detection
  • CloseIDX - An integer representing the column position containing closing prices in the data window; determines the ending price values critical for identifying candlestick body formation and reversal signals
  • tol - A floating-point number representing the acceptable difference between open and close prices to qualify as a Doji candle; smaller values require near-perfect equality while larger values allow more variation in identifying market indecision
  • The function adds exactly 1 column to the rolling window matrix.

Returns

Returns the updated window matrix (a list of lists) with the Bearish Harami Cross detection result appended as a new column to the most recent row, where the value is either 1 (indicating the pattern was detected) or 0 (indicating the pattern was not present).


def MatchingLow(self, OpenIDX=1, HighIDX=2, LowIDX=3, CloseIDX=4, tol=0.001):

Non-technical

This function identifies when two consecutive price candles both show downward movement and reach nearly the same lowest point, which can signal a potential reversal in a declining market trend. It carefully examines the most recent two price periods to determine if they've formed this specific pattern where prices dipped to approximately the same level despite continuing to close lower than they opened, helping traders recognize possible turning points where selling pressure might be exhausting itself.

Technical

  • OpenIDX - An integer representing the position of opening prices in the data series; higher values shift which price points are analyzed as openings, affecting pattern detection
  • HighIDX - An integer representing the position of highest prices in the data series; changing this value adjusts which price points are considered peaks for pattern recognition
  • LowIDX - An integer representing the position of lowest prices in the data series; this determines which price points are evaluated as potential matching lows in the pattern detection
  • CloseIDX - An integer representing the position of closing prices in the data series; this affects how bearish candles are identified in the pattern recognition process
  • tol - A decimal number between 0 and 1 that sets how closely the lows must match; smaller values require more precise alignment of low points while larger values allow for more variation
  • The function adds one column to the rolling window matrix.

Returns

Returns the updated rolling window matrix with an additional column containing either 1 (indicating a matching low pattern was detected) or 0 (indicating no matching low pattern was found).


def BullishMatHold3(self, OpenIDX=1, HighIDX=2, LowIDX=3, CloseIDX=4, tol=0.001):

Non-technical

This function identifies a specific three-candle pattern in price charts that suggests a potential upward trend continuation after a brief pause. It examines the most recent three price bars to determine if they form a particular arrangement where the first bar shows strong upward movement, the next two bars consolidate within the range of the first bar without breaking below its low point, and the final bar resumes the upward momentum by closing higher than the first bar's closing price. When this pattern is detected, the function marks it with a clear signal that traders can use to identify potential buying opportunities in the market.

Technical

  • OpenIDX: Integer representing the position of opening prices in the data structure; higher values shift which column is used for opening prices, affecting pattern detection
  • HighIDX: Integer representing the position of highest prices in the data structure; higher values shift which column is used for highest prices, affecting pattern detection
  • LowIDX: Integer representing the position of lowest prices in the data structure; higher values shift which column is used for lowest prices, affecting pattern detection
  • CloseIDX: Integer representing the position of closing prices in the data structure; higher values shift which column is used for closing prices, affecting pattern detection
  • tol: Floating-point number representing the acceptable margin of error for price comparisons; smaller values make the pattern recognition more precise but less likely to trigger, while larger values make it more forgiving but potentially less accurate
  • The function adds 1 column to the rolling window (matrix).

Returns

Returns the updated window (a list of lists) with an additional column containing either 1 (indicating the Bullish Mat Hold pattern was detected) or 0 (indicating the pattern was not detected).


def BearishMatHold(self, OpenIDX=1, HighIDX=2, LowIDX=3, CloseIDX=4, tol=0.001):

Non-technical

This function identifies a specific three-candle pattern in price charts that suggests a potential continuation of a downward trend after a brief pause. It examines the most recent three price bars to determine if they form this particular arrangement where the first bar shows a clear downward movement, the next bar moves within the range of the first without breaking its boundaries, and the final bar resumes the downward movement by closing lower than the first bar. When this pattern appears, it adds a marker to the chart data indicating the presence of this signal, which traders might use as a warning that prices could continue falling after a temporary consolidation period.

Technical

  • OpenIDX - Integer representing the column position where opening prices are stored; higher values shift which data column is used for open prices, affecting pattern detection
  • HighIDX - Integer representing the column position where high prices are stored; higher values shift which data column is used for high prices, affecting pattern detection
  • LowIDX - Integer representing the column position where low prices are stored; higher values shift which data column is used for low prices, affecting pattern detection
  • CloseIDX - Integer representing the column position where closing prices are stored; higher values shift which data column is used for close prices, affecting pattern detection
  • tol - Floating-point number representing the tolerance for price comparisons; smaller values make the pattern detection more strict, larger values make it more lenient Adds exactly 1 column to the rolling window (matrix)

Returns

Returns the updated rolling window (a list of lists) with an additional column containing either 1 (indicating the bearish mat hold pattern was detected) or 0 (indicating the pattern was not detected).


def BullishMatHold5(self, OpenIDX=1, HighIDX=2, LowIDX=3, CloseIDX=4, tol=0.001):

Non-technical

This function identifies a specific five-candle bullish pattern in price charts that suggests a potential upward trend continuation after a brief consolidation period, helping traders recognize when market momentum might be shifting in a favorable direction for buying opportunities by examining how recent price movements relate to each other in a particular sequence.

Technical

  • OpenIDX is an integer representing the position of opening price data in the chart records; higher values might cause incorrect pattern detection if mismatched with actual data structure.
  • HighIDX is an integer indicating where high price values are stored in the chart records; must correctly align with the data format to properly identify the pattern's upper boundaries.
  • LowIDX is an integer specifying the location of low price values in the chart records; accurate positioning is essential for determining the pattern's lower boundaries.
  • CloseIDX is an integer showing where closing price data resides in the chart records; critical for assessing the relationship between opening and closing values that defines candlestick patterns.
  • tol is a floating-point number representing the acceptable margin of error when comparing price levels; smaller values make the pattern detection more precise but potentially less flexible to minor price variations.
  • Adds exactly 1 column to the rolling window matrix containing the pattern detection result (1 if pattern exists, 0 otherwise).

Returns

Returns the updated self.window object, which is a list of lists containing the rolling price data with an additional column appended that indicates whether the Bullish Mat Hold 5-candle pattern was detected (1) or not (0).


def BearishMatHold5(self, OpenIDX=1, HighIDX=2, LowIDX=3, CloseIDX=4, tol=0.001):

Non-technical

This function identifies a specific five-candle pattern in price charts that suggests a temporary pause in a downward trend before the decline continues, helping traders recognize potential selling opportunities by examining how the middle three candles stay within the boundaries of the first candle before the price breaks lower again with the final candle.

Technical

  • OpenIDX is an integer representing the position of opening prices in the data structure; it determines which column contains opening values and affects pattern recognition accuracy when set incorrectly.
  • HighIDX is an integer representing the position of highest prices in the data structure; it determines which column contains peak values and influences how the pattern's upper boundaries are evaluated.
  • LowIDX is an integer representing the position of lowest prices in the data structure; it determines which column contains bottom values and affects how the pattern's lower boundaries are assessed.
  • CloseIDX is an integer representing the position of closing prices in the data structure; it determines which column contains closing values and is critical for identifying the bearish nature of each candle.
  • tol is a floating-point number representing the acceptable margin of error in price comparisons; smaller values make the pattern detection more precise while larger values allow for more flexibility in matching the pattern.
  • The function adds exactly 1 column to the rolling window matrix.

Returns

Returns the updated rolling window matrix (list of lists) with a new column appended containing either 1 (indicating the bearish five-candle pattern was detected), 0 (pattern not present), or None (insufficient data available for analysis).


def BullishKickingByLength(self, OpenIDX=1, HighIDX=2, LowIDX=3, CloseIDX=4, tol=0.001):

Non-technical

This function identifies a specific candlestick pattern that signals a potential upward trend reversal in price movements. It examines the most recent two price bars to detect when a strong downward movement is immediately followed by a strong upward movement with a noticeable gap between them, which often indicates a shift in market sentiment from bearish to bullish. When this distinctive pattern appears, the function marks it clearly so traders can recognize this potential buying opportunity based on historical price action behavior.

Technical

  • OpenIDX - An integer representing which column in the price data contains the opening prices; higher values would look at different data columns but might not contain valid price information
  • HighIDX - An integer representing which column in the price data contains the highest prices; changing this would affect which price highs are considered in the pattern detection
  • LowIDX - An integer representing which column in the price data contains the lowest prices; incorrect values would lead to inaccurate low price assessments
  • CloseIDX - An integer representing which column in the price data contains the closing prices; this is critical as the pattern relies on the relationship between opening and closing prices
  • tol - A decimal number that determines how strict the pattern recognition should be; smaller values make the detection more precise but less likely to trigger, while larger values make it more forgiving but potentially less reliable
  • The function adds exactly 1 column to the rolling window (matrix).

Returns

Returns the updated window data structure (a list of lists) with an additional column containing either 1 (indicating the Bullish Kicking pattern was detected) or 0 (indicating it was not detected).


def BearishKickingByLength(self, OpenIDX=1, HighIDX=2, LowIDX=3, CloseIDX=4, tol=0.001):

Non-technical

This function identifies a specific price pattern where the market suddenly shifts from an upward trend to a downward trend with a noticeable gap between the two movements. It looks for situations where the price moves strongly upward in one period, followed immediately by a period where the price opens significantly lower than the previous close, creating a visual "kick" downward in the price chart. When this pattern is detected, it signals a potential reversal from a bullish to a bearish market sentiment. The function carefully checks the relationship between these two consecutive price movements to confirm the pattern exists before signaling its detection, helping traders recognize this important reversal signal in market behavior.

Technical

  • OpenIDX: Integer representing the column position where opening prices are stored; determines which data column is analyzed for the pattern's starting point
  • HighIDX: Integer representing the column position where highest prices are stored; affects which data column is analyzed for price extremes
  • LowIDX: Integer representing the column position where lowest prices are stored; affects which data column is analyzed for price extremes
  • CloseIDX: Integer representing the column position where closing prices are stored; determines which data column is analyzed for the pattern's confirmation point
  • tol: Float representing the minimum price movement threshold; smaller values require more pronounced price movements to qualify as the pattern Adds exactly 1 column to the rolling window

Returns

Returns the updated rolling window as a list of lists with an additional column containing either 1 (indicating the bearish kicking pattern was detected) or 0 (indicating the pattern was not detected).


def BullishSeparatingLines(self, OpenIDX=1, HighIDX=2, LowIDX=3, CloseIDX=4, tol=0.001):

Non-technical

This function identifies a specific price pattern that suggests a potential shift from a downward trend to an upward movement in the market. It examines the most recent two price periods to detect when a downward-moving period is immediately followed by an upward-moving period that begins at nearly the same starting price as the previous period. When this pattern appears, it signals that selling pressure may be weakening and buying interest could be increasing, potentially indicating a good opportunity to consider entering a long position or exiting a short position. The function automatically analyzes the latest price data and provides a clear signal when this particular market condition is met, helping traders make more informed decisions based on historical price behavior patterns.

Technical

  • OpenIDX is an integer representing the column position of opening prices in the data window; affects which price data is used to determine the starting point of each period.
  • HighIDX is an integer representing the column position of highest prices in the data window; affects which price data is used to determine the peak of each period.
  • LowIDX is an integer representing the column position of lowest prices in the data window; affects which price data is used to determine the bottom of each period.
  • CloseIDX is an integer representing the column position of closing prices in the data window; affects which price data is used to determine the ending point of each period.
  • tol is a float representing the acceptable price difference tolerance; smaller values require more precise alignment of opening prices to trigger the signal.
  • The function adds 1 column to the rolling window (matrix).

Returns

Returns self.window, which is the updated rolling window data structure (a list of lists) with the new bullish separating lines signal column appended to the most recent row.


def BearishSeparatingLines(self, OpenIDX=1, HighIDX=2, LowIDX=3, CloseIDX=4, tol=0.001):

Non-technical

This function identifies a specific price pattern that suggests a potential shift from an upward trend to a downward movement in the market. It carefully examines two consecutive price bars to determine if the first bar shows upward momentum by closing higher than it opened, followed immediately by a second bar that opens at nearly the same level but then moves decisively downward, closing lower than it opened. When these conditions align precisely, the function recognizes this formation as a potential signal that the upward momentum may be ending and a downward trend could be beginning, helping traders spot possible turning points where the direction of price movement might be changing without requiring complex calculations or external indicators.

Technical

  • OpenIDX is an integer specifying which column in the price data contains opening values; smaller values would reference earlier columns in the dataset and affect which prices determine candle direction
  • HighIDX is an integer specifying which column contains highest price values; though not directly used in this pattern detection, it maintains consistency with other candlestick pattern functions
  • LowIDX is an integer specifying which column contains lowest price values; though not directly used in this pattern detection, it maintains consistency with other candlestick pattern functions
  • CloseIDX is an integer specifying which column contains closing values; smaller values would reference earlier columns and affect which prices determine candle direction
  • tol is a floating-point number representing the acceptable difference between opening prices of consecutive candles; smaller values make the pattern recognition more strict while larger values allow more variation
  • Adds exactly 1 column to the rolling window matrix containing the pattern detection result

Returns

Returns the updated rolling window (a list of lists) with an additional column containing either 1 (indicating the bearish separating lines pattern was detected) or 0 (indicating the pattern was not detected).


def BullishKicker(self, OpenIDX=1, HighIDX=2, LowIDX=3, CloseIDX=4):

Non-technical

This function identifies a specific price pattern in financial markets where a sudden shift in momentum occurs. It looks for a situation where prices were trending downward, then unexpectedly jump higher with strong buying pressure, creating a visible gap between the previous day's highest price and the current day's opening price. When this distinctive pattern appears, the function marks it as a potential signal that the market sentiment may be shifting from bearish to bullish, which could indicate a good opportunity for traders who are watching for reversals in price direction.

Technical

  • OpenIDX - An integer representing the position of opening prices in the data structure; determines which column contains opening values and affects pattern detection accuracy
  • HighIDX - An integer representing the position of highest prices in the data structure; determines which column contains peak values and is critical for identifying the gap in the pattern
  • LowIDX - An integer representing the position of lowest prices in the data structure; determines which column contains bottom values and helps verify the integrity of the price pattern
  • CloseIDX - An integer representing the position of closing prices in the data structure; determines which column contains closing values and is essential for determining candle direction
  • The function adds exactly 1 column to the rolling window matrix.

Returns

Returns the updated window matrix as a list of lists containing the original data plus the new column with the Bullish Kicker pattern detection result (1 if pattern is present, 0 otherwise).


def BearishKicker(self, OpenIDX=1, HighIDX=2, LowIDX=3, CloseIDX=4):

Non-technical

This function identifies a specific market reversal pattern where a strong upward trend suddenly shifts to a downward direction. It looks for two consecutive price movements where the first shows confidence in rising prices, but the second opens with a significant drop below the previous low, indicating sellers have taken control. When this pattern appears, it suggests the market sentiment has quickly changed from optimistic to pessimistic, potentially signaling a good time to consider selling or avoiding new purchases. The function automatically analyzes recent price movements and provides a clear signal when this particular reversal pattern is detected.

Technical

  • OpenIDX - An integer representing the position of opening prices in the data structure; higher values would look at different price points but could miss the pattern if set incorrectly
  • HighIDX - An integer representing the position of highest prices in the data structure; changing this would affect which price highs are considered in the pattern detection
  • LowIDX - An integer representing the position of lowest prices in the data structure; this determines which price lows are used to identify the gap-down opening
  • CloseIDX - An integer representing the position of closing prices in the data structure; this affects how bullish or bearish candles are identified
  • The function adds exactly 1 column to the rolling window (matrix).

Returns

Returns the updated rolling window as a list of lists, where the last row contains an additional column with the Bearish Kicker signal (1 if the pattern is detected, 0 otherwise).