OPEN-SOURCE SCRIPT
Personal MTF Long Bias - 30D Momentum / 20D Range

MTF Long Bias is a higher-timeframe context indicator designed for discretionary long-side trading.
The script combines two simple filters:
1. 30D Momentum
Checks whether the confirmed higher-timeframe close is above or below the close from 30 bars ago. This is used as a simple momentum filter, not as a moving average.
2. 20D Range Position
Shows where current price sits inside the recent 20-bar high/low range. The default zones are:
- Bottom zone: lower 35%
- Top zone: upper 20%
- Middle zone: everything between them
The main idea is to separate market context from entry timing:
- 30D momentum defines whether long trades are favored or avoided.
- 20D range position helps identify whether price is near an extreme or in the middle.
- The final Long Bias table summarizes the condition as LONG OK, WAIT, or AVOID.
Default behavior:
- Uses confirmed daily data by default to reduce repainting.
- Shows the 20D range zones on the chart.
- Keeps the 30D momentum base optional through display modes.
- Labels and background colors are off by default to keep the chart clean.
This indicator is not an automated buy/sell system. LONG OK means the higher-timeframe context allows long setups, but actual entries, stops, position sizing, and risk management should be decided separately.
The script combines two simple filters:
1. 30D Momentum
Checks whether the confirmed higher-timeframe close is above or below the close from 30 bars ago. This is used as a simple momentum filter, not as a moving average.
2. 20D Range Position
Shows where current price sits inside the recent 20-bar high/low range. The default zones are:
- Bottom zone: lower 35%
- Top zone: upper 20%
- Middle zone: everything between them
The main idea is to separate market context from entry timing:
- 30D momentum defines whether long trades are favored or avoided.
- 20D range position helps identify whether price is near an extreme or in the middle.
- The final Long Bias table summarizes the condition as LONG OK, WAIT, or AVOID.
Default behavior:
- Uses confirmed daily data by default to reduce repainting.
- Shows the 20D range zones on the chart.
- Keeps the 30D momentum base optional through display modes.
- Labels and background colors are off by default to keep the chart clean.
This indicator is not an automated buy/sell system. LONG OK means the higher-timeframe context allows long setups, but actual entries, stops, position sizing, and risk management should be decided separately.
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.