Pine Scripts Library
Use a ready-made script or generate one with AI in seconds.
Scripts on this page are educational templates, not guarantees of profit, designed for customization through experimentation with trading pairs, inputs, timeframes, and logic.
All Scripts
1 Minute Webhook Test Strategy
This utility strategy is designed to help verify that TradingView alerts and TurboBridge webhook integration are working correctly. It automatically opens either a long or short trade, depending on the selected direction, then closes the position on the very next candle. Because it generates predictable BUY, SELL and EXIT signals, it is useful for testing webhook delivery, exchange connectivity and order execution before using live trading strategies.
SMA Cross with Slope Exit
A Simple Moving Average (SMA) calculates the average price over a chosen number of candles, making it easier to see the overall market trend by smoothing out short-term price movements. This strategy uses a fast SMA and a slow SMA. A long trade is opened when the fast SMA crosses above the slow SMA, while a short trade is opened when it crosses below. Instead of waiting for another crossover, the strategy closes the trade as soon as the fast SMA starts turning in the opposite direction, helping protect profits when the trend begins to weaken.
RSI Reversal Strategy
The Relative Strength Index (RSI) is a momentum indicator that measures how strong recent price movements have been. It can help identify when a market may have fallen too far (oversold) or risen too far (overbought). This strategy looks for signs that the price is starting to reverse after reaching one of these extremes. It opens long or short trades as momentum changes direction and closes the position once the RSI shows that the move is beginning to lose strength.
Simple Moving Average Cross (ATR Exit)
A Simple Moving Average (SMA) calculates the average price over a chosen number of candles, helping smooth out short-term price movements and reveal the overall trend. This strategy uses a fast SMA and a slow SMA to identify when the market may be changing direction. A long trade is opened when the fast SMA crosses above the slow SMA, while a short trade is opened when it crosses below. Instead of using another crossover to exit, it uses the Average True Range (ATR), a measure of market volatility, to trail the price and close the trade if the market reverses by a configurable amount.
Simple Moving Average Cross (Spread Pullback Exit)
A Simple Moving Average (SMA) calculates the average price over a chosen number of candles, making it easier to identify the overall market trend. This strategy uses a fast SMA and a slow SMA to detect when the trend may be changing, opening a long trade when the fast SMA crosses above the slow SMA and a short trade when it crosses below. After entering a trade, it measures the distance, or spread, between the two moving averages. The position stays open while the trend continues to strengthen and is closed when that spread shrinks by a configurable percentage, signalling that the trend may be losing momentum.
Simple Moving Average Cross (Spread check-Entry on Pullback-Exit)
A Simple Moving Average (SMA) calculates the average price over a chosen number of candles, helping smooth out short-term price movements and reveal the overall market trend. This strategy waits for a crossover between a fast SMA and a slow SMA, but only enters a trade if the distance, or spread, between the two moving averages continues to increase by a configurable percentage. This extra confirmation helps filter out weaker signals and focuses on trends that are gaining strength. Once in a trade, the position is closed when the spread begins to shrink by a configurable amount, indicating that the trend may be losing momentum.
EMA Pullback Short Strategy
An Exponential Moving Average (EMA) is similar to a Simple Moving Average, but it gives more weight to recent prices, allowing it to react more quickly to market changes. This strategy looks for a strong downtrend using a long-term EMA, then waits for the price to temporarily move higher before falling back below a shorter-term EMA. This pullback can provide an opportunity to join the existing trend rather than entering after a large move has already happened. The strategy calculates stop loss and take profit levels using the Average True Range (ATR) and a configurable risk-to-reward ratio, and will also exit early if the long-term trend turns bullish.
RSI Reversal with ATR Trailing Exit
The Relative Strength Index (RSI) is a momentum indicator that helps identify when a market may have fallen too far (oversold) or risen too far (overbought). This strategy looks for signs that the price is beginning to reverse by entering long trades when the RSI recovers from oversold conditions and short trades when it falls from overbought conditions. Once a trade is open, it uses the Average True Range (ATR), a measure of market volatility, to trail the stop loss as the trade moves in your favour. The position is closed if the RSI returns to its neutral level or if the ATR trailing stop is reached, helping protect profits while allowing strong trends to continue.
Signal Deduplicator
Wraps any entry condition to ensure the alert fires only once per position — prevents duplicate signals from rapid bar closes.
Signal Deduplicator
Wraps any entry condition to ensure the alert fires only once per position — prevents duplicate signals from rapid bar closes.
Want to create your own?
👉 Generate using AI