Paistrade Light V2
- Indicators
- Version: 2.1
The PairsTrade_Light_v2.mq5 file is a custom MQL5 technical indicator designed for pairs trading, primarily within the Forex market. It serves as a simplified version of the Ind_2_Linep1.mq5 indicator and provides a visual representation of the relationship between two financial instruments.
Core Functionality
The indicator plots the price movement of two selected symbols in a separate chart window to help traders identify convergence or divergence.
Symbol Comparison: It takes a main symbol (default "EURJPY") and an auxiliary symbol (default "USDJPY") as inputs.
Correlation Adjustment: Users can toggle "Reverse correlation" for either symbol to properly align their movements on the chart.
Volatility Scaling (ATR): The indicator includes an optional ATR (Average True Range) mode that adjusts the drawing of the lines based on the relative volatility of the two symbols.
Trading Volume Calculation: While primarily used for pairs trading, it includes logic to calculate transaction volumes specifically for Forex pairs.
Visual Indicators
The tool creates several graphical objects in the indicator subwindow to provide real-time status updates:
Divergence/Convergence Labels: It dynamically updates text to show if the symbol lines are moving apart (Divergence), coming together (Convergence), or remaining neutral (Flat).
Trend Pointers: It uses symbols like >, <, and = to visually indicate the current state of the relationship between the two instruments.
Horizontal Levels: It draws dotted horizontal lines that represent calculated levels based on ATR, which serve as visual references for the spread.
Technical Parameters
Smoothing: Uses both Slow EMA (default 15 periods) and Fast EMA (default 5 periods) to process price data (HLCC/4) and smooth the resulting lines.
History Depth: Users can define the number of bars to be processed (default 5000), with a minimum requirement of 200 bars for calculation.
Global Variable Management: The script creates a temporary global terminal variable to ensure that multiple instances of the indicator (up to 100) can run on a single chart without naming conflicts.
