OPEN-SOURCE SCRIPT
Real Rate Mortgage Framework [Gabremoku]

Real Rate Mortgage Framework is a macro context indicator that estimates a simplified real-rate proxy by subtracting CPI YoY from a nominal government yield series. It is designed to help users assess borrowing conditions from a broader economic perspective, rather than to predict a specific mortgage quote or lender offer.
The script currently includes preset configurations for the United States and Italy, and it also supports custom sources so the framework can be extended to additional countries without changing the core logic. This modular structure makes the indicator suitable as a reusable framework for future country presets and custom macro implementations.
To make the output easier to read, the real-rate proxy is classified into four clearly labeled regimes: Excellent Rate, Good Rate, Acceptable Rate, and High Rate. These labels are paired with a color structure that makes the current macro environment immediately visible on the chart, in the label, and in the dashboard.
A moving average is applied to inflation to reduce the stair-step effect caused by monthly CPI updates and improve visual readability. The indicator also includes a summary dashboard, optional background regime shading, alerts, and a disclaimer so users can interpret the output as informational context rather than financial advice.
This script is intended for traders and investors who want a simple cross-country real-rate framework for macro analysis, mortgage context, and future expansion to additional national datasets. If you would like a new country or a different sovereign yield / inflation pair added, feel free to message me with your request so I can consider it for a future implementation.
The script currently includes preset configurations for the United States and Italy, and it also supports custom sources so the framework can be extended to additional countries without changing the core logic. This modular structure makes the indicator suitable as a reusable framework for future country presets and custom macro implementations.
To make the output easier to read, the real-rate proxy is classified into four clearly labeled regimes: Excellent Rate, Good Rate, Acceptable Rate, and High Rate. These labels are paired with a color structure that makes the current macro environment immediately visible on the chart, in the label, and in the dashboard.
A moving average is applied to inflation to reduce the stair-step effect caused by monthly CPI updates and improve visual readability. The indicator also includes a summary dashboard, optional background regime shading, alerts, and a disclaimer so users can interpret the output as informational context rather than financial advice.
This script is intended for traders and investors who want a simple cross-country real-rate framework for macro analysis, mortgage context, and future expansion to additional national datasets. If you would like a new country or a different sovereign yield / inflation pair added, feel free to message me with your request so I can consider it for a future implementation.
نص برمجي مفتوح المصدر
بروح TradingView الحقيقية، قام مبتكر هذا النص البرمجي بجعله مفتوح المصدر، بحيث يمكن للمتداولين مراجعة وظائفه والتحقق منها. شكرا للمؤلف! بينما يمكنك استخدامه مجانًا، تذكر أن إعادة نشر الكود يخضع لقواعد الموقع الخاصة بنا.
إخلاء المسؤولية
لا يُقصد بالمعلومات والمنشورات أن تكون، أو تشكل، أي نصيحة مالية أو استثمارية أو تجارية أو أنواع أخرى من النصائح أو التوصيات المقدمة أو المعتمدة من TradingView. اقرأ المزيد في شروط الاستخدام.
نص برمجي مفتوح المصدر
بروح TradingView الحقيقية، قام مبتكر هذا النص البرمجي بجعله مفتوح المصدر، بحيث يمكن للمتداولين مراجعة وظائفه والتحقق منها. شكرا للمؤلف! بينما يمكنك استخدامه مجانًا، تذكر أن إعادة نشر الكود يخضع لقواعد الموقع الخاصة بنا.
إخلاء المسؤولية
لا يُقصد بالمعلومات والمنشورات أن تكون، أو تشكل، أي نصيحة مالية أو استثمارية أو تجارية أو أنواع أخرى من النصائح أو التوصيات المقدمة أو المعتمدة من TradingView. اقرأ المزيد في شروط الاستخدام.