PINE LIBRARY

FT_TV_OHLC

161
FT_TV_OHLC is a Pine Script® v6 library which provides a reusable OHLC context, pattern-evaluation engine and entry-level framework for systematic trading strategies.

The library builds and maintains structured Open, High, Low and Close data for the current market period and the previous five completed periods. On intraday charts, these periods can represent either calendar days or custom trading sessions, allowing the same strategy logic to work with session-aware market data.

This OHLC history is combined with a pre-calculated market context containing candle ranges and bodies, recent extrema, multi-period measurements and session-start references. The resulting data is used by other libraries pattern and entry-level engines.

Main exported functionality

  • Pine Script®
    — Builds and maintains the OHLC data structure used by the library. It supports both Day and custom Session aggregation modes, configurable session times and timezone-aware processing.
  • Pine Script®
    — Pre-calculates the common market context used by the pattern engine, including OHLC ranges and bodies, multi-period extrema, session bar state and session-start price references. This avoids repeatedly calculating the same data across individual pattern evaluations.
  • Pine Script®
    — Generates long and short entry-price levels from a broad collection of configurable methods. Available calculations include OHLC-derived levels, ATR and range extensions, moving-average references, recent extrema, session-start levels, percentage offsets, weekly levels and other price-based structures. A reversal mode can also swap the resulting long and short levels.
  • Pine Script®
    — Main interface to the extended pattern catalog. It evaluates more than 480 directional market conditions based on current price action, Day/Session OHLC structures, multi-period relationships, breakouts, compression/expansion, candle characteristics and session context. Positive and negative pattern IDs select the corresponding directional variants of each condition.
  • Pine Script®
    — Provides a compact subset of frequently used OHLC and price-action conditions for strategies that do not require the complete pattern catalog.
  • Pine Script®
    — Provides an optional visual diagnostic panel for selected OHLC patterns, including their current verification state, descriptions and occurrence counters, with optional chart highlighting.


Purpose

FT_TV_OHLC is designed primarily as a shared analytical dependency for other strategies. It separates OHLC aggregation, market-context calculations, pattern evaluation and entry-level generation from the individual strategy logic, providing a consistent framework that can be reused across multiple Pine Script® strategies.

Usage, attribution and intellectual property

This Pine Script® library is published open-source in accordance with TradingView's requirements for public Pine libraries.

Under TradingView's Script Publishing Rules, functions or code from a public Pine library may be reused in open-source publications without prior permission from the author. When publishing work that reuses this library, the original author must be properly credited in accordance with TradingView's rules.

Reuse of this library's functions or source code in a public Protected or Invite-only publication requires explicit permission from us.

The source code is provided under the license specified in the script header. TradingView's Script Publishing Rules govern reuse within the TradingView platform.

Отказ от ответственности

Информация и публикации не предназначены для предоставления и не являются финансовыми, инвестиционными, торговыми или другими видами советов или рекомендаций, предоставленных или одобренных TradingView. Подробнее читайте в Условиях использования.