OPEN-SOURCE SCRIPT
mean reversion Spread Z-Score

Your main "actor" is the Blue Line 🔵 (the Z-Score). It tells you if your spread is "expensive" or "cheap" compared to its average.
The other lines are your action zones.
Here is how to read the signals:
Scenario 1: SELL the Spread (The spread is TOO EXPENSIVE)
• ENTRY Signal: The Blue Line 🔵 moves up and crosses the Red Line 🔴 (at +1.8).
• Meaning: MNQ has become far too expensive compared to MES. The rubber band is stretched too far upwards.
• Your Action (Sell):
• ✅ SELL MNQ
• ✅ BUY MES
• EXIT Signal: The Blue Line 🔵 comes back down and crosses the Dotted Red Line (at +0.5).
• Meaning: The rubber band is back to normal. It's time to take your profits.
• Your Action (Close):
• ✅ BUY BACK your MNQ
• ✅ SELL your MES
Scenario 2: BUY the Spread (The spread is TOO CHEAP)
• ENTRY Signal: The Blue Line 🔵 moves down and crosses the Green Line 🟢 (at -1.8).
• Meaning: MNQ has become far too cheap compared to MES. The rubber band is stretched too far downwards.
• Your Action (Buy):
• ✅ BUY MNQ
• ✅ SELL MES
• EXIT Signal: The Blue Line 🔵 moves back up and crosses the Dotted Green Line (at -0.5).
• Meaning: The rubber band is back to normal. It's time to take your profits.
• Your Action (Close):
• ✅ SELL your MNQ
• ✅ BUY BACK your MES
In summary:
• Blue Line 🔵 touches Red Line 🔴 = Sell the spread.
• Blue Line 🔵 touches Green Line 🟢 = Buy the spread.
The other lines are your action zones.
Here is how to read the signals:
Scenario 1: SELL the Spread (The spread is TOO EXPENSIVE)
• ENTRY Signal: The Blue Line 🔵 moves up and crosses the Red Line 🔴 (at +1.8).
• Meaning: MNQ has become far too expensive compared to MES. The rubber band is stretched too far upwards.
• Your Action (Sell):
• ✅ SELL MNQ
• ✅ BUY MES
• EXIT Signal: The Blue Line 🔵 comes back down and crosses the Dotted Red Line (at +0.5).
• Meaning: The rubber band is back to normal. It's time to take your profits.
• Your Action (Close):
• ✅ BUY BACK your MNQ
• ✅ SELL your MES
Scenario 2: BUY the Spread (The spread is TOO CHEAP)
• ENTRY Signal: The Blue Line 🔵 moves down and crosses the Green Line 🟢 (at -1.8).
• Meaning: MNQ has become far too cheap compared to MES. The rubber band is stretched too far downwards.
• Your Action (Buy):
• ✅ BUY MNQ
• ✅ SELL MES
• EXIT Signal: The Blue Line 🔵 moves back up and crosses the Dotted Green Line (at -0.5).
• Meaning: The rubber band is back to normal. It's time to take your profits.
• Your Action (Close):
• ✅ SELL your MNQ
• ✅ BUY BACK your MES
In summary:
• Blue Line 🔵 touches Red Line 🔴 = Sell the spread.
• Blue Line 🔵 touches Green Line 🟢 = Buy the spread.
Mã nguồn mở
Theo đúng tinh thần TradingView, người tạo ra tập lệnh này đã biến tập lệnh thành mã nguồn mở để các nhà giao dịch có thể xem xét và xác minh công năng. Xin dành lời khen tặng cho tác giả! Mặc dù bạn có thể sử dụng miễn phí, nhưng lưu ý nếu đăng lại mã, bạn phải tuân theo Quy tắc nội bộ của chúng tôi.
Thông báo miễn trừ trách nhiệm
Thông tin và ấn phẩm không có nghĩa là và không cấu thành, tài chính, đầu tư, kinh doanh, hoặc các loại lời khuyên hoặc khuyến nghị khác được cung cấp hoặc xác nhận bởi TradingView. Đọc thêm trong Điều khoản sử dụng.
Mã nguồn mở
Theo đúng tinh thần TradingView, người tạo ra tập lệnh này đã biến tập lệnh thành mã nguồn mở để các nhà giao dịch có thể xem xét và xác minh công năng. Xin dành lời khen tặng cho tác giả! Mặc dù bạn có thể sử dụng miễn phí, nhưng lưu ý nếu đăng lại mã, bạn phải tuân theo Quy tắc nội bộ của chúng tôi.
Thông báo miễn trừ trách nhiệm
Thông tin và ấn phẩm không có nghĩa là và không cấu thành, tài chính, đầu tư, kinh doanh, hoặc các loại lời khuyên hoặc khuyến nghị khác được cung cấp hoặc xác nhận bởi TradingView. Đọc thêm trong Điều khoản sử dụng.