This script is designed to analyze and visualize the divergence or convergence of two selected financial instruments, making it an excellent tool for implementing a pairs trading strategy. Developed for the TradingView platform, it offers extensive customization options for analysis. Key Features:
Asset Selection: The first asset can be taken directly from the chart or specified manually. The second asset is always selected manually.
Data Normalization: Calculates the percentage change of both assets relative to their initial prices. Includes an offset for better visual interpretation.
Visualization: Plots normalized price charts for both assets. Highlights crossovers between the assets. Displays the spread (difference between normalized prices) graphically.
Alerts (Works only on the 30-minute timeframe): Configurable thresholds to trigger alerts (e.g., when the difference is smaller or larger than a set value). Alerts for crossovers of prices and exponential moving averages (EMA).
Dynamic Labels: Automatically adds labels to mark key events: crossovers, critical spread values, and current price information.
EMA and Deviation Analysis: Calculates EMA for each asset. Alerts for EMA crossovers.
قام مؤلف هذا النص البرمجي بنشره وجعله مفتوح المصدر، بحيث يمكن للمتداولين فهمه والتحقق منه، وهو الأمر الذي يدخل ضمن قيم TradingView. تحياتنا للمؤلف! يمكنك استخدامه مجانًا، ولكن إعادة استخدام هذا الرمز في المنشور يخضع لقواعدقوانين الموقع. يمكنك جعله مفضلاً لاستخدامه على الرسم البياني.
هل تريد استخدام هذا النص البرمجي على الرسم البياني؟
لا يُقصد بالمعلومات والمنشورات أن تكون، أو تشكل، أي نصيحة مالية أو استثمارية أو تجارية أو أنواع أخرى من النصائح أو التوصيات المقدمة أو المعتمدة من TradingView. اقرأ المزيد في شروط الاستخدام.