OPEN-SOURCE SCRIPT
Yield Curve Regimes

Yield Curve Regimes Indicator
This indicator tracks macroeconomic market regimes by analyzing the spread delta between short-term (US02Y) and long-term (US30Y) Treasury yields over a custom n-period rolling window.
Core Mechanics:
Regime Classification: Automatically categorizes the yield curve environment into six distinct macro states (Bull/Bear Steepener, Bull/Bear Flattener, and Steepener/Flattener Twists) based on the directional shifts of the underlying yields.
Visual Output: Plots a color-coded spread histogram with an integrated dynamic legend, providing an immediate read on shifting macro and liquidity conditions.
Application: Delivers quantifiable, high-level data to filter directional bias and align price action setups with the overarching macroeconomic regime
This indicator tracks macroeconomic market regimes by analyzing the spread delta between short-term (US02Y) and long-term (US30Y) Treasury yields over a custom n-period rolling window.
Core Mechanics:
Regime Classification: Automatically categorizes the yield curve environment into six distinct macro states (Bull/Bear Steepener, Bull/Bear Flattener, and Steepener/Flattener Twists) based on the directional shifts of the underlying yields.
Visual Output: Plots a color-coded spread histogram with an integrated dynamic legend, providing an immediate read on shifting macro and liquidity conditions.
Application: Delivers quantifiable, high-level data to filter directional bias and align price action setups with the overarching macroeconomic regime
สคริปต์แบบโอเพนซอร์ส
ด้วยเจตนารมณ์หลักของ TradingView ผู้สร้างสคริปต์นี้ได้ทำให้เป็นโอเพนซอร์ส เพื่อให้เทรดเดอร์สามารถตรวจสอบและยืนยันฟังก์ชันการทำงานของมันได้ ขอชื่นชมผู้เขียน! แม้ว่าคุณจะใช้งานได้ฟรี แต่โปรดจำไว้ว่าการเผยแพร่โค้ดซ้ำจะต้องเป็นไปตาม กฎระเบียบการใช้งาน ของเรา
คำจำกัดสิทธิ์ความรับผิดชอบ
ข้อมูลและบทความไม่ได้มีวัตถุประสงค์เพื่อก่อให้เกิดกิจกรรมทางการเงิน, การลงทุน, การซื้อขาย, ข้อเสนอแนะ หรือคำแนะนำประเภทอื่น ๆ ที่ให้หรือรับรองโดย TradingView อ่านเพิ่มเติมใน ข้อกำหนดการใช้งาน
สคริปต์แบบโอเพนซอร์ส
ด้วยเจตนารมณ์หลักของ TradingView ผู้สร้างสคริปต์นี้ได้ทำให้เป็นโอเพนซอร์ส เพื่อให้เทรดเดอร์สามารถตรวจสอบและยืนยันฟังก์ชันการทำงานของมันได้ ขอชื่นชมผู้เขียน! แม้ว่าคุณจะใช้งานได้ฟรี แต่โปรดจำไว้ว่าการเผยแพร่โค้ดซ้ำจะต้องเป็นไปตาม กฎระเบียบการใช้งาน ของเรา
คำจำกัดสิทธิ์ความรับผิดชอบ
ข้อมูลและบทความไม่ได้มีวัตถุประสงค์เพื่อก่อให้เกิดกิจกรรมทางการเงิน, การลงทุน, การซื้อขาย, ข้อเสนอแนะ หรือคำแนะนำประเภทอื่น ๆ ที่ให้หรือรับรองโดย TradingView อ่านเพิ่มเติมใน ข้อกำหนดการใช้งาน