OPEN-SOURCE SCRIPT
CS Trendline Pro

Title: CS Trendline Pro [Traffic Light System]
Description:
CS Trendline Pro is a comprehensive scalping and day-trading system designed to filter out noise and identify high-probability breakout setups. It combines the structural precision of Fractal Trendlines with a robust Dual-EMA Filter, visualized through an intuitive "Traffic Light" color system.
This tool is specifically engineered for traders who want to trade Trendline Breakouts but need a safety mechanism to avoid false signals (fakeouts) and counter-trend traps.
🚦 How the "Traffic Light" Logic Works
The core feature of this script is the dynamic coloring of the candles, which acts as a visual filter for your entries:
🟢 GREEN Zone (Safe Buy):
Condition: A Bullish Trendline Breakout has occurred AND the price is holding ABOVE the EMA 30 (Yellow Line).
Meaning: Momentum is bullish, and you are in a safe zone to look for Long entries.
🔴 RED Zone (Safe Sell):
Condition: A Bearish Trendline Breakout has occurred AND the price is holding BELOW the EMA 30 (Yellow Line).
Meaning: Momentum is bearish, and you are in a safe zone to look for Short entries.
⚪ GRAY Zone (No Trade / Wait):
Condition: A breakout occurred, but the price is on the "wrong side" of the EMA 30.
Meaning: Indecision. The market structure is conflicting with the immediate momentum. It is recommended to stay out until the color changes.
🛠️ Key Features
** automated Trendlines:** Automatically draws Support and Resistance dynamic trendlines based on pivot points (LuxAlgo engine).
Dual EMA Filter:
EMA 30 (Yellow): Acts as the immediate "Safe Zone" filter.
EMA 200 (White): Displays the macro trend. (Pro Tip: Only take Green signals if price is above the White line).
CS-BUY / CS-SELL Labels: Clear text markers appear exactly when a valid breakout occurs.
Customizable: Adjustable sensitivity (Length), EMA periods, and Slope calculation methods (ATR, Stdev, Linreg).
📉 How to Trade with CS Trendline Pro
For Scalping (5m / 15m):
Identify the Main Trend: Look at the White EMA (200).
If Price > EMA 200 → Focus on BUY signals.
If Price < EMA 200 → Focus on SELL signals.
Wait for the Signal:
Wait for the candle to turn Teal (Green) or Red.
Ensure the candle closes with the new color.
Risk Management:
Place Stop Loss below the recent swing low (for buys) or above the swing high (for sells).
Target a 1.5 Risk/Reward ratio or trail your stop using the EMA 30.
⚠️ Important Note on Backpainting
This indicator uses pivot points to draw trendlines. By nature, a pivot point can only be confirmed after a few bars have passed (Lag).
Backpaint Setting (Default ON): Keeps your historical chart clean by connecting the exact pivot points in the past.
Real-Time Behavior: In live trading, the trendline and signal will appear once the pivot is confirmed (based on your 'Length' setting). This is normal behavior for any trendline script.
Settings Recommended:
5-Minute Chart: Length 10 or 14.
15-Minute Chart: Length 14.
Enjoy trading with precision! ~ CS Trading
Description:
CS Trendline Pro is a comprehensive scalping and day-trading system designed to filter out noise and identify high-probability breakout setups. It combines the structural precision of Fractal Trendlines with a robust Dual-EMA Filter, visualized through an intuitive "Traffic Light" color system.
This tool is specifically engineered for traders who want to trade Trendline Breakouts but need a safety mechanism to avoid false signals (fakeouts) and counter-trend traps.
🚦 How the "Traffic Light" Logic Works
The core feature of this script is the dynamic coloring of the candles, which acts as a visual filter for your entries:
🟢 GREEN Zone (Safe Buy):
Condition: A Bullish Trendline Breakout has occurred AND the price is holding ABOVE the EMA 30 (Yellow Line).
Meaning: Momentum is bullish, and you are in a safe zone to look for Long entries.
🔴 RED Zone (Safe Sell):
Condition: A Bearish Trendline Breakout has occurred AND the price is holding BELOW the EMA 30 (Yellow Line).
Meaning: Momentum is bearish, and you are in a safe zone to look for Short entries.
⚪ GRAY Zone (No Trade / Wait):
Condition: A breakout occurred, but the price is on the "wrong side" of the EMA 30.
Meaning: Indecision. The market structure is conflicting with the immediate momentum. It is recommended to stay out until the color changes.
🛠️ Key Features
** automated Trendlines:** Automatically draws Support and Resistance dynamic trendlines based on pivot points (LuxAlgo engine).
Dual EMA Filter:
EMA 30 (Yellow): Acts as the immediate "Safe Zone" filter.
EMA 200 (White): Displays the macro trend. (Pro Tip: Only take Green signals if price is above the White line).
CS-BUY / CS-SELL Labels: Clear text markers appear exactly when a valid breakout occurs.
Customizable: Adjustable sensitivity (Length), EMA periods, and Slope calculation methods (ATR, Stdev, Linreg).
📉 How to Trade with CS Trendline Pro
For Scalping (5m / 15m):
Identify the Main Trend: Look at the White EMA (200).
If Price > EMA 200 → Focus on BUY signals.
If Price < EMA 200 → Focus on SELL signals.
Wait for the Signal:
Wait for the candle to turn Teal (Green) or Red.
Ensure the candle closes with the new color.
Risk Management:
Place Stop Loss below the recent swing low (for buys) or above the swing high (for sells).
Target a 1.5 Risk/Reward ratio or trail your stop using the EMA 30.
⚠️ Important Note on Backpainting
This indicator uses pivot points to draw trendlines. By nature, a pivot point can only be confirmed after a few bars have passed (Lag).
Backpaint Setting (Default ON): Keeps your historical chart clean by connecting the exact pivot points in the past.
Real-Time Behavior: In live trading, the trendline and signal will appear once the pivot is confirmed (based on your 'Length' setting). This is normal behavior for any trendline script.
Settings Recommended:
5-Minute Chart: Length 10 or 14.
15-Minute Chart: Length 14.
Enjoy trading with precision! ~ CS Trading
Script open-source
Nello spirito di TradingView, l'autore di questo script lo ha reso open source, in modo che i trader possano esaminarne e verificarne la funzionalità. Complimenti all'autore! Sebbene sia possibile utilizzarlo gratuitamente, ricordiamo che la ripubblicazione del codice è soggetta al nostro Regolamento.
Declinazione di responsabilità
Le informazioni e le pubblicazioni non sono intese come, e non costituiscono, consulenza o raccomandazioni finanziarie, di investimento, di trading o di altro tipo fornite o approvate da TradingView. Per ulteriori informazioni, consultare i Termini di utilizzo.
Script open-source
Nello spirito di TradingView, l'autore di questo script lo ha reso open source, in modo che i trader possano esaminarne e verificarne la funzionalità. Complimenti all'autore! Sebbene sia possibile utilizzarlo gratuitamente, ricordiamo che la ripubblicazione del codice è soggetta al nostro Regolamento.
Declinazione di responsabilità
Le informazioni e le pubblicazioni non sono intese come, e non costituiscono, consulenza o raccomandazioni finanziarie, di investimento, di trading o di altro tipo fornite o approvate da TradingView. Per ulteriori informazioni, consultare i Termini di utilizzo.