PINE LIBRARY
AmendLogic Performance - Dynamic Matrix and Heatmap Engine

Overview
AmendLogic_perf is a high-performance analytics utility library designed for Pine Script v6 strategy scripts. It automates the calculation, compounding, and visual rendering of closed and rolling equity structures into a clean, institutional-grade monthly and yearly return matrix.By separating performance rendering from your core entry/exit logic, your scripts remain lean, scannable, and modular.
Key Features
How to Use (Quick Start)
To append this performance reporting dashboard directly to your strategy, reference the library at the top of your script and pass your live equity array at the final execution layer:
Pine Script®
AmendLogic_perf is a high-performance analytics utility library designed for Pine Script v6 strategy scripts. It automates the calculation, compounding, and visual rendering of closed and rolling equity structures into a clean, institutional-grade monthly and yearly return matrix.By separating performance rendering from your core entry/exit logic, your scripts remain lean, scannable, and modular.
Key Features
- Real-Time Compounding Engine: Continuously tracks equity variations bar-by-bar, automatically computing exact monthly and yearly percentage returns ($P\&L$) alongside raw monetary value gains.
- Smart History Reconstruction: Uses dynamic accumulators and arrays to handle historical lookback state tracking. It dynamically pushes and corrects current-period metrics on the final live bar (barstate.islast) without missing real-time fractional ticks.
- Proportional Heatmap Scaling (f_getAlpha): Evaluates overall strategic history to locate relative historical maximums and minimums. The library automatically calibrates color transparency to match performance weight: highly profitable months or deep drawdowns receive intense color depth, while neutral periods gracefully fade into a subtle tint.
- Native Ecosystem Visual Integration: Deeply integrated with the AmendLogic_css_SEC layout library. The matrix auto-adjusts its borders, cell text, and deep-space canvas framing to remain readable across both light and dark chart layouts.
How to Use (Quick Start)
To append this performance reporting dashboard directly to your strategy, reference the library at the top of your script and pass your live equity array at the final execution layer:
- Interface Layout & Output MetricsPosition: Fixed to the bottom_right quadrant of your workstation screen to maintain unobstructed viewing of historical price bars.
- Row Headers: Dynamically maps out historical years discovered within your dataset profile.
- Column Tracks: Standardized 12-month sequence (Jan – Dec) completed by a bolded cumulative "Year" metrics tracking column.
- Color Schemes: Standardizes emerald-green zones for expansion sequences and crimson-red highlights for contraction drawdowns.
Biblioteca do Pine
Em verdadeiro espírito TradingView, o autor publicou este código Pine como uma biblioteca de código aberto para que outros programadores Pine da nossa comunidade possam reutilizá-lo. Parabéns ao autor! Você pode usar esta biblioteca de forma privada ou em outras publicações de código aberto, mas a reutilização deste código em publicações é regida pelas Regras da Casa.
Aviso legal
As informações e publicações não se destinam a ser, e não constituem, conselhos ou recomendações financeiras, de investimento, comerciais ou de outro tipo fornecidos ou endossados pela TradingView. Leia mais nos Termos de Uso.
Biblioteca do Pine
Em verdadeiro espírito TradingView, o autor publicou este código Pine como uma biblioteca de código aberto para que outros programadores Pine da nossa comunidade possam reutilizá-lo. Parabéns ao autor! Você pode usar esta biblioteca de forma privada ou em outras publicações de código aberto, mas a reutilização deste código em publicações é regida pelas Regras da Casa.
Aviso legal
As informações e publicações não se destinam a ser, e não constituem, conselhos ou recomendações financeiras, de investimento, comerciais ou de outro tipo fornecidos ou endossados pela TradingView. Leia mais nos Termos de Uso.