Skip to main content

540 posts tagged with "Pine Script"

Blog posts related to the PineScript

View All Tags

Ulcer Index: Drawdown Calculation and TradingView Interpretation

· 4 min read
Pineify Team
Pine Script and AI trading workflow research team

Ulcer Index summarizes squared percentage drawdowns from a reference high. Larger or more persistent drawdowns raise the reading, while a series repeatedly at new highs can have a low reading despite substantial upward movement. It describes the selected historical series, not a forecast of maximum future loss.

Ulcer Index shown on a TradingView chart

Global Variables in Pine Script

· 10 min read
Pineify Team
Pine Script and AI trading workflow research team
Pineify | Best Pine Script Editor

Global variables in Pine Script are declared in the script's top-level scope. Scope determines where a name can be used; declaration mode determines when its value is initialized. A global variable does not automatically preserve its value across bars. Use var when a counter, running total, or state needs that persistence.