OPEN-SOURCE SCRIPT
Automatic Quadrant Lines

📊 DETAILED EXPLANATION
Overview:
Automatic Quadrant Lines is a sophisticated pivot-based trading system that identifies key support and resistance levels, entry points, and price targets automatically. Based on fractal pivot analysis, this indicator creates a complete trading framework by mapping out potential long and short opportunities with precise entry and exit levels.
What Each Line Means:
Pivot Lines (Dark Red - Solid):
R1 (Resistance 1): The most recent pivot high - a key resistance level where price previously reversed downward
S1 (Support 1): The most recent pivot low - a key support level where price previously reversed upward. This line is thicker (weight 3) to emphasize its importance as the foundation for long setups
Entry Lines (Green/Red - Dashed or Solid):
L/E (Long Entry - Green Dashed): The trigger price for entering long positions. This is set at a strategic point above the pivot low, marking where bullish momentum is confirmed
S/E (Short Entry - Red Solid): The trigger price for entering short positions. This is set at a strategic point below the pivot high, marking where bearish momentum is confirmed
Long Target Lines (Green/Yellow/Cyan - Dashed):
Short Target Lines (Red/Yellow/Cyan):
Additional Lines:
Technical Components:
The indicator uses a configurable length (default 20) to identify swing highs and lows. A pivot high forms when the current high is the highest value over the specified length period on both sides. A pivot low forms when the current low is the lowest value over the specified period on both sides.
Entry points are not placed at the pivot itself, but at strategic exit points of the pivot candle pattern. For long entries, the system identifies the high of the candle that preceded the pivot low. For short entries, it identifies the low of the candle that preceded the pivot high. This ensures entries occur on momentum confirmation rather than at turning points.
The indicator calculates targets based on the range between the entry and the pivot (S1 for longs, R1 for shorts). It then projects this range upward (for longs) or downward (for shorts) in equal increments:
1x range = 50% target
2x range = 75% target
3x range = 100% target (Final Target)
Fractal Energy Filter:
The indicator incorporates a Fractal Energy (FE) calculation that measures market efficiency and trend strength. This helps filter entry signals, ensuring trades are taken only when market structure supports directional movement. The FE threshold can be adjusted in settings.
🎯 HOW TO USE (TRADER-FRIENDLY GUIDE)
📌 QUICK START GUIDE (IMPORTANT - Read This First!)
For optimal label visibility:
After adding this indicator to your chart for the first time, follow these ONE-TIME steps to ensure L/E and S/E labels are always visible:
Wait for the indicator to load and display L/E or S/E labels
Hover your mouse over any L/E or S/E label
Right-click on the label
Select "Bring to Front" or adjust "Visual Order" to bring it above price bars
Repeat for the other label type if needed
✅ You only need to do this ONCE - TradingView will remember this setting for all future labels!
If you ever want the labels to appear behind price bars again, simply right-click and select "Send to Back".
📈 For Long Trades:
Stop Loss: Place your stop loss below the S1 level (thick dark red line). If price breaks below the dark green "Breakdown Target" line, consider exiting immediately
📉 For Short Trades:
Wait for Setup:
The indicator automatically identifies a pivot high (R1 - dark red line) and calculates a short entry level (S/E - red solid line with red label)
First target: Yellow line (take 1/3 profit)
Second target: Cyan line (take another 1/3 profit)
Final target: Red line with "SHORT TARGET" label (exit remaining position)
Stop Loss: Place your stop loss above the R1 level (dark red line)
💡 Key Trading Tips:
🔧 TROUBLESHOOTING
Q: My L/E or S/E labels are hidden behind candles
A: Right-click the label → "Bring to Front". This is a TradingView chart setting, not a script limitation. You only need to do this once.
Q: Can I hide the labels?
A: Yes! Uncheck "Show Labels" in the indicator settings.
Q: Can I adjust the label sizes?
A: Yes! Use the "Target Label Size" setting to adjust LONG/SHORT TARGET labels between Small, Normal, and Large.
Q: The labels moved when I clicked them
A: Labels are positioned automatically. If you accidentally moved them, simply refresh your chart.
Q: No signals are appearing
A: The indicator requires sufficient price history to detect pivots. Make sure you have at least 20+ bars on your chart. Try adjusting the Pivot Length setting.
Overview:
Automatic Quadrant Lines is a sophisticated pivot-based trading system that identifies key support and resistance levels, entry points, and price targets automatically. Based on fractal pivot analysis, this indicator creates a complete trading framework by mapping out potential long and short opportunities with precise entry and exit levels.
What Each Line Means:
Pivot Lines (Dark Red - Solid):
R1 (Resistance 1): The most recent pivot high - a key resistance level where price previously reversed downward
S1 (Support 1): The most recent pivot low - a key support level where price previously reversed upward. This line is thicker (weight 3) to emphasize its importance as the foundation for long setups
Entry Lines (Green/Red - Dashed or Solid):
L/E (Long Entry - Green Dashed): The trigger price for entering long positions. This is set at a strategic point above the pivot low, marking where bullish momentum is confirmed
S/E (Short Entry - Red Solid): The trigger price for entering short positions. This is set at a strategic point below the pivot high, marking where bearish momentum is confirmed
Long Target Lines (Green/Yellow/Cyan - Dashed):
- Yellow Dashed Line (50%): First profit target for long positions - equal to one full range above the long entry
- Cyan Dashed Line (75%): Second profit target for long positions - two full ranges above the long entry
- Green Dashed Line (Long Target): Final profit target for long positions - three full ranges above the long entry, displayed with a dark green label showing the exact price
Short Target Lines (Red/Yellow/Cyan):
- Yellow Line (50%): First profit target for short positions - equal to one full range below the short entry
- Cyan Line (75%): Second profit target for short positions - two full ranges below the short entry
- Red Line (Short Target): Final profit target for short positions - three full ranges below the short entry, displayed with a deep red label showing the exact price
Additional Lines:
- Breakdown Target (Dark Green - Dashed): A support breakdown level located one range below S1, useful for managing risk if long positions fail
Technical Components:
- Pivot Detection:
The indicator uses a configurable length (default 20) to identify swing highs and lows. A pivot high forms when the current high is the highest value over the specified length period on both sides. A pivot low forms when the current low is the lowest value over the specified period on both sides.
- *Entry Point Calculation:
Entry points are not placed at the pivot itself, but at strategic exit points of the pivot candle pattern. For long entries, the system identifies the high of the candle that preceded the pivot low. For short entries, it identifies the low of the candle that preceded the pivot high. This ensures entries occur on momentum confirmation rather than at turning points.
- *Target Calculation (Quadrant System):
The indicator calculates targets based on the range between the entry and the pivot (S1 for longs, R1 for shorts). It then projects this range upward (for longs) or downward (for shorts) in equal increments:
1x range = 50% target
2x range = 75% target
3x range = 100% target (Final Target)
Fractal Energy Filter:
The indicator incorporates a Fractal Energy (FE) calculation that measures market efficiency and trend strength. This helps filter entry signals, ensuring trades are taken only when market structure supports directional movement. The FE threshold can be adjusted in settings.
🎯 HOW TO USE (TRADER-FRIENDLY GUIDE)
📌 QUICK START GUIDE (IMPORTANT - Read This First!)
For optimal label visibility:
After adding this indicator to your chart for the first time, follow these ONE-TIME steps to ensure L/E and S/E labels are always visible:
Wait for the indicator to load and display L/E or S/E labels
Hover your mouse over any L/E or S/E label
Right-click on the label
Select "Bring to Front" or adjust "Visual Order" to bring it above price bars
Repeat for the other label type if needed
✅ You only need to do this ONCE - TradingView will remember this setting for all future labels!
If you ever want the labels to appear behind price bars again, simply right-click and select "Send to Back".
📈 For Long Trades:
- Wait for Setup: The indicator automatically identifies a pivot low (S1 - thick dark red line) and calculates a long entry level (L/E - green dashed line with green label)
- Entry Signal: When price crosses above the green L/E line, consider entering a long position. The system has confirmed bullish momentum
- Profit Targets: Scale out of your position at the three target levels:
- First target: Yellow dashed line (take 1/3 profit)
- Second target: Cyan dashed line (take another 1/3 profit)
- Final target: Green dashed line with "LONG TARGET" label (exit remaining position)
Stop Loss: Place your stop loss below the S1 level (thick dark red line). If price breaks below the dark green "Breakdown Target" line, consider exiting immediately
📉 For Short Trades:
Wait for Setup:
The indicator automatically identifies a pivot high (R1 - dark red line) and calculates a short entry level (S/E - red solid line with red label)
First target: Yellow line (take 1/3 profit)
Second target: Cyan line (take another 1/3 profit)
Final target: Red line with "SHORT TARGET" label (exit remaining position)
Stop Loss: Place your stop loss above the R1 level (dark red line)
💡 Key Trading Tips:
- Color Coding: Remember GREEN = LONG, RED = SHORT throughout the entire system
- Scaling Out: The three-target system allows you to lock in profits progressively while letting winners run
- New Signals: When a new pivot forms, the indicator recalculates all levels. Old setups become invalid
- Labels: The L/E and S/E labels mark the exact starting point of each entry line for easy identification
- Price Display: Target labels show exact prices with proper comma formatting for easy reference
- Timeframe: Works on any timeframe, but higher timeframes (4H, Daily) tend to produce more reliable signals
- Customization: Adjust the Pivot Length (default 20) to make the system more responsive (lower number) or more stable (higher number)
- ⚠️ Risk Management:
- Never risk more than 1-2% of your account per trade
- The distance from entry to S1/R1 gives you a natural stop loss distance
- Consider the full target distance when calculating position size
- Not all setups will reach the final target - scaling out helps lock in profits
🔧 TROUBLESHOOTING
Q: My L/E or S/E labels are hidden behind candles
A: Right-click the label → "Bring to Front". This is a TradingView chart setting, not a script limitation. You only need to do this once.
Q: Can I hide the labels?
A: Yes! Uncheck "Show Labels" in the indicator settings.
Q: Can I adjust the label sizes?
A: Yes! Use the "Target Label Size" setting to adjust LONG/SHORT TARGET labels between Small, Normal, and Large.
Q: The labels moved when I clicked them
A: Labels are positioned automatically. If you accidentally moved them, simply refresh your chart.
Q: No signals are appearing
A: The indicator requires sufficient price history to detect pivots. Make sure you have at least 20+ bars on your chart. Try adjusting the Pivot Length setting.
Skrypt open-source
W zgodzie z duchem TradingView twórca tego skryptu udostępnił go jako open-source, aby użytkownicy mogli przejrzeć i zweryfikować jego działanie. Ukłony dla autora. Korzystanie jest bezpłatne, jednak ponowna publikacja kodu podlega naszym Zasadom serwisu.
Wyłączenie odpowiedzialności
Informacje i publikacje nie stanowią i nie powinny być traktowane jako porady finansowe, inwestycyjne, tradingowe ani jakiekolwiek inne rekomendacje dostarczane lub zatwierdzone przez TradingView. Więcej informacji znajduje się w Warunkach użytkowania.
Skrypt open-source
W zgodzie z duchem TradingView twórca tego skryptu udostępnił go jako open-source, aby użytkownicy mogli przejrzeć i zweryfikować jego działanie. Ukłony dla autora. Korzystanie jest bezpłatne, jednak ponowna publikacja kodu podlega naszym Zasadom serwisu.
Wyłączenie odpowiedzialności
Informacje i publikacje nie stanowią i nie powinny być traktowane jako porady finansowe, inwestycyjne, tradingowe ani jakiekolwiek inne rekomendacje dostarczane lub zatwierdzone przez TradingView. Więcej informacji znajduje się w Warunkach użytkowania.