OPEN-SOURCE SCRIPT
Aktualisiert

Strategy with Reference Lines

625
📊 Strategy with Reference Lines
Description:
This strategy uses a contrarian approach based on the analysis of the previous candle to identify entry and exit points. The strategy draws horizontal reference lines at important levels of the previous candle and generates buy/sell signals based on the candle's direction.
Key Features:
🔹 Multi-Timeframe Analysis: Configurable for 1H, 2H, 3H, 4H, 6H, 12H, and 1D
🔹 Reference Lines: High, low, close, and midpoint (50%) of the previous candle
🔹 Visual Signals: Labels with prices and actions (BUY/SELL/TP)
🔹 Optional Trading: Enable/disable automatic order execution
🔹 Complete System: Automatic entry, Take Profit, and Stop Loss
🔹 Alerts: Notifications when a new candle is detected
Strategy Logic:
When the previous candle is POSITIVE:
Signal: đź”´ SELL at the previous candle's close
Take Profit: 🎯 Midpoint (50%) of the previous candle
Stop Loss: đź”´ High of the previous candle
When the previous candle is NEGATIVE:
Signal: 🟢 BUY at the previous candle's close
Take Profit: 🎯 Midpoint (50%) of the previous candle
Stop Loss: 🟢 Low of the previous candle
Visual Elements:
Green Line: High of the previous candle (when positive)
Red Line: Low of the previous candle (when negative)
Yellow Line: Close of the previous candle (always present)
Blue Line: Midpoint (50%) of the previous candle (always present)
Labels: Prices and actions with emojis for easy identification
Settings:
Timeframe: Default 4H (configurable)
Auto Trading: Disabled by default (safety)
Alerts: Include entry prices, TP, and SL
Recommended Usage:
âś… Visual Analysis: Use with trading disabled for analysis
âś… Backtesting: Enable trading to test historically
âś… Swing Trading: Ideal for 4H or higher timeframes
âś… Risk Management: Automatic SL and TP for protection
Risk Disclaimer:
This strategy is for educational and analysis purposes only. Always test in a simulation environment before using with real capital. Trading involves significant risks and may result in losses.
Versionshinweise
adjustments
Versionshinweise
TradingView Indicator Update Description
Indicator Name
Strategy with Reference Lines
Version
v2.0
General Description
Indicator that creates reference lines based on the previous candle of the configured timeframe, providing objective entry points and technical analysis.
Main Features
1. Timeframe Configuration
Selection between: 1H, 2H, 3H, 4H, 6H, 12H, 1D
Analysis based on chosen timeframe, regardless of current chart timeframe
2. Automatic Reference Lines
Green Line: Previous candle high (when candle was bullish)
Red Line: Previous candle low (when candle was bearish)
Yellow Line: Previous candle close (always present)
Blue Line: Midpoint (50% between open and close)
3. Informative Labels
Exact prices of reference lines
Temporal observation: "Wait for 1H elapsed from candle"
Configured timeframe information
4. Smart Alerts
Notification when new timeframe candle closes
Complete previous candle data
Temporal guidance for analysis
5. Automatic Trading (Optional)
Automatic entry based on previous candle direction
Take Profit at midpoint (50%)
Stop Loss at previous candle high/low
How to Use
Initial Setup
Select desired timeframe in input
Enable/disable automatic trading as needed
Apply indicator to chart
Line Interpretation
Previous Bullish Candle: Green line at high + yellow line at close
Previous Bearish Candle: Red line at low + yellow line at close
Midpoint: Always present as blue line (TP reference)
Recommended Strategy
Wait for candle close in configured timeframe
Observe created reference lines
Wait 1 hour elapsed from candle for analysis
Use lines as entry/exit points
Technical Characteristics
Compatibility
Works on any visualization timeframe
Updates only when on configured timeframe
Accurate data from chosen timeframe
Performance
Optimized calculation with request.security()
lookahead_off and gaps_off parameters for precision
Automatic new candle detection
Customization
Configurable line colors
Adjustable line styles
Customizable label sizes
Version 2.0 Updates
Implemented Improvements
âś… Removal of trading texts (SELL/BUY/TP)
âś… Addition of temporal observation "Wait for 1H elapsed"
âś… Cleaner and more objective interface
âś… Informative alerts without trading bias
âś… Accurate configured timeframe data
Technical Fixes
âś… Correct new candle detection
âś… Data consistent with Data Window
âś… Multi-timeframe functionality
âś… Optimized Pine Script v6 syntax
Installation Instructions
Copy complete code from teste.txt file
Paste into TradingView Pine Script editor
Save and apply to chart
Configure desired timeframe
Enable alerts if needed
Support and Feedback
Version tested on multiple assets
Compatible with all markets
Optimized for objective technical analysis
Note: This indicator provides only objective technical information. Always conduct your own analysis before making trading decisions.

Haftungsausschluss

Die Informationen und Veröffentlichungen sind nicht als Finanz-, Anlage-, Handels- oder andere Arten von Ratschlägen oder Empfehlungen gedacht, die von TradingView bereitgestellt oder gebilligt werden, und stellen diese nicht dar. Lesen Sie mehr in den Nutzungsbedingungen.