Indicator · Pine Script v6 · On the chart

TR KAP Marker

by Enesp4rl4k

This indicator overlays labels on a BIST equity price chart at bars whose time window contains a material KAP disclosure.

View on GitHub

GitHub stars7on the repository
Pine versionv6current
Lines of code56
Settings0inputs
LicenceMIT
Last update7 days ago23 Oct 2026

Add It to Your TradingView Chart

  1. 1Copy the scriptPress Copy script above, or the copy button on the code below.
  2. 2Open the Pine EditorOpen a TradingView chart and choose Pine Editor at the bottom of the screen.
  3. 3Paste over the templateCreate a new indicator, select all of the template text and paste. Press Save and give it a name.
  4. 4Add it to the chartPress Add to chart, then adjust the settings with the gear icon next to its name.

Source Code

56 lines of Pine Script v6 from src/bist_trader_mcp/pine_recipes/tr_kap_marker.pine, published under MIT. Keep the author's credit and licence lines when you reuse it.

tr_kap_marker.pine
//@version=6
// =============================================================================
// TR KAP Marker — overlay material KAP disclosures as labels on the chart.
//
// Place this Pine on any BIST stock chart and it will render a label at each
// timestamp where KAP filed a "material" disclosure for the ticker (or any
// ticker if a global event such as a board decision is on the list).
//
// Placeholders filled by the MCP at generation time:
//   {{TICKER}}            — equity code, e.g. "GARAN"
//   {{KAP_EVENTS_JSON}}   — JSON array of {date, title, category}
//   {{AS_OF_DATE}}        — YYYY-MM-DD snapshot
// =============================================================================
indicator("TR KAP Marker — {{TICKER}} ({{AS_OF_DATE}})", overlay = true,
          max_labels_count = 200)

// Snapshot list of material events. Each event is a tuple of (timestamp, label).
// The MCP renders this as an inline Pine array; Pine v6 has no JSON parser so we
// use a simple parallel-array convention.
var int[]    eventTimes    = array.new<int>(0)
var string[] eventTitles   = array.new<string>(0)
var string[] eventCategory = array.new<string>(0)

if barstate.isfirst
    // {{KAP_EVENTS_JSON}} expands to a sequence of array.push(...) calls when
    // rendered by recipes.render_recipe — see the loader below for the format.
    {{KAP_EVENTS_LOADER}}

// --- Per-bar: did any event fall inside this bar's window? -------------------
barOpenMs  = time
barCloseMs = time_close

if array.size(eventTimes) > 0
    for i = 0 to array.size(eventTimes) - 1
        evTs = array.get(eventTimes, i)
        if evTs >= barOpenMs and evTs <= barCloseMs
            title = array.get(eventTitles, i)
            cat   = array.get(eventCategory, i)
            label.new(
                x          = bar_index,
                y          = high,
                text       = "📌 " + cat + "\n" + title,
                style      = label.style_label_down,
                color      = color.new(color.orange, 20),
                textcolor  = color.white,
                size       = size.small,
                yloc       = yloc.abovebar
            )

// --- Alert: fires when a new event lands on the latest bar -------------------
alertCondition = false
if barstate.islast and array.size(eventTimes) > 0
    lastEv = array.get(eventTimes, array.size(eventTimes) - 1)
    alertCondition := lastEv >= barOpenMs and lastEv <= barCloseMs
alertcondition(alertCondition, title = "KAP Material Event",
               message = "{{TICKER}}: material disclosure on this bar")

Overview

Event times, titles, and categories come from a static snapshot written into parallel arrays when the recipe is generated, not from a live feed inside Pine. When a timestamp falls between the bar open and close, it draws a small orange label above the high showing the category and title. An alert condition fires if the last listed event lands on the latest bar. There are no user inputs, and unfilled template placeholders leave the event list empty.

Details

Published by

Enesp4rl4k on GitHub

Draws

On the price chart

Markets

Stocks

Timeframes

Any timeframe

Risk Notes

No repainting, lookahead or stacked entries were found in its code or README. That says nothing about how well it works: test it first.

Topics

bistborsa-istanbulclaudeevdsfinancellmmcpmodel-context-protocolpine-scriptpython

Third-party code. ForexR did not write, test or endorse this script, and the summary above was generated automatically from its code and README. Indicators describe the past, and a strategy's backtest can look better than live trading, especially when a script repaints. Check it in the Strategy Tester and on a demo account before you rely on it.

Similar Pine Scripts

947 stars

The Adaptive Laguerre Filter calculates a smoothed, dynamically adjusted trendline plotted directly on the main price chart. It dynamically adjusts its damping factor (alpha) based on recent price range variations and median percentile calculations over a spec

Indicator v4 TrendMoving averages
Updated 12 days ago · GPL-3.0 GitHub repository of Adaptive Laguerre Filter
575 stars

The indicator plots ICT displacement candles on the price chart and can switch to retracement scanning. Displacement requires a move larger than a set share of the 14-bar average high-low range, lasting at least a chosen number of bars, with optional close, pr

Indicator v6 SMC / ICT / price actionCandlestick patterns
Updated 1 year ago · MPL-2.0 GitHub repository of ICT Displacement Candles Indicator
330 stars

This script plots three moving averages on the price chart: a fast EMA or SMA with 10 periods, a slow EMA or SMA with 20 periods, and a trend EMA or SMA with 100 periods. It signals trend changes by drawing a white cross when the fast moving average crosses ab

Indicator v4 TrendMoving averages
Updated 2 months ago · None stated GitHub repository of 3 EMA/SMA + Cross [Alorse]
318 stars

This indicator calculates an ATR trailing stop line derived from the highest high minus an average true range multiple over a specified lookback period. It plots the trailing stop line directly on the price chart and colors price bars based on whether the clos

Indicator v5 TrendVolatility & bands
Updated 2 months ago · MIT GitHub repository of ATR Trailing Stoploss

1833 Tracker

by Allen1212
303 stars

1833 Tracker is an overlay indicator that visualizes historical buy and sell transactions executed by ARK Invest ETFs for the stock on the main price chart. It displays trade dates using green buy and red sell labels positioned relative to price bars, indicati

Indicator v4
Updated 2 years ago · None stated GitHub repository of 1833 Tracker

More indicators

Related on ForexR

Trade Your Charts With a Regulated Broker

Compare brokers that connect to TradingView, with spreads, minimum deposits and leverage side by side.

Compare brokers