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.
Skrip sumber terbuka
Dalam semangat TradingView sebenar, pencipta skrip ini telah menjadikannya sumber terbuka, jadi pedagang boleh menilai dan mengesahkan kefungsiannya. Terima kasih kepada penulis! Walaupuan anda boleh menggunakan secara percuma, ingat bahawa penerbitan semula kod ini tertakluk kepada Peraturan Dalaman.
Penafian
Maklumat dan penerbitan adalah tidak bertujuan, dan tidak membentuk, nasihat atau cadangan kewangan, pelaburan, dagangan atau jenis lain yang diberikan atau disahkan oleh TradingView. Baca lebih dalam Terma Penggunaan.
Skrip sumber terbuka
Dalam semangat TradingView sebenar, pencipta skrip ini telah menjadikannya sumber terbuka, jadi pedagang boleh menilai dan mengesahkan kefungsiannya. Terima kasih kepada penulis! Walaupuan anda boleh menggunakan secara percuma, ingat bahawa penerbitan semula kod ini tertakluk kepada Peraturan Dalaman.
Penafian
Maklumat dan penerbitan adalah tidak bertujuan, dan tidak membentuk, nasihat atau cadangan kewangan, pelaburan, dagangan atau jenis lain yang diberikan atau disahkan oleh TradingView. Baca lebih dalam Terma Penggunaan.