OPEN-SOURCE SCRIPT
已更新 Market-Aware Moving Averages

Market-Aware Moving Averages automatically switches its moving-average lengths based on the market the chart symbol belongs to, so you don't have to reconfigure it each time you move between Taiwan, the US, Japan, Korea, Europe, India, crypto, forex, and more.
Why this exists. Different markets follow different moving-average conventions. The US, Europe and India favor the round 50/200 set; Taiwan and Korea use the trading-day set (60 for a quarter, 240 for a year); Japan has its own 25/75 tradition. Changing lengths by hand on every switch is tedious and easy to forget. This script reads the symbol's country and type and applies the right set on its own.
What it plots. Five main lines covering week / month / quarter / half-year / year, plus optional secondary lines that are common but less central. Main and secondary use two distinct colors, and line width grows with period, so the longest (yearly) line is the thickest and least noisy.
Length sets by market:
How detection works. It uses Pine's syminfo.country and syminfo.type. Any stock without a mapped country, and every non-stock instrument (index, forex, crypto, futures, commodity), falls back to the default 5/20/50/200 set.
Settings. Override the auto-detection to force a specific system or fully custom lengths; switch between SMA and EMA; toggle each line; and change both colors. Secondary lines are hidden by default.
Note. Moving averages are lagging indicators and can give false signals in ranging markets. The length conventions used here are common market practices, not guarantees. This is a visualization tool, not financial advice.
Why this exists. Different markets follow different moving-average conventions. The US, Europe and India favor the round 50/200 set; Taiwan and Korea use the trading-day set (60 for a quarter, 240 for a year); Japan has its own 25/75 tradition. Changing lengths by hand on every switch is tedious and easy to forget. This script reads the symbol's country and type and applies the right set on its own.
What it plots. Five main lines covering week / month / quarter / half-year / year, plus optional secondary lines that are common but less central. Main and secondary use two distinct colors, and line width grows with period, so the longest (yearly) line is the thickest and least noisy.
Length sets by market:
- US / Europe / India, and all non-stock instruments (default): 5 / 20 / 50 / 100 / 200; secondary 10 / 13 / 15 / 30
- Taiwan / Korea: 5 / 20 / 60 / 120 / 240; secondary 10 (Korea also 90 / 180)
- Japan: 5 / 25 / 75 / 100 / 200; secondary 10 / 15
How detection works. It uses Pine's syminfo.country and syminfo.type. Any stock without a mapped country, and every non-stock instrument (index, forex, crypto, futures, commodity), falls back to the default 5/20/50/200 set.
Settings. Override the auto-detection to force a specific system or fully custom lengths; switch between SMA and EMA; toggle each line; and change both colors. Secondary lines are hidden by default.
Note. Moving averages are lagging indicators and can give false signals in ranging markets. The length conventions used here are common market practices, not guarantees. This is a visualization tool, not financial advice.
版本注释
Market-Aware Moving AveragesA moving-average set that automatically switches its length convention to match the instrument's home market, so the lines reflect the periods traders in that market actually watch.It plots five main lines for the standard timeframes — week, month, quarter, half-year, and year — and picks the right lengths by market:US / EU / IN and all non-stock symbols (default): 5 / 20 / 50 / 100 / 200Taiwan / Korea: 5 / 20 / 60 / 120 / 240
Japan: 5 / 25 / 75 / 100 / 200The market is detected automatically from the symbol's country and type, or you can force a system (Anglo, Asia, Japan, or fully Custom lengths) from the inputs.Design choices that make it readable: all main lines share one color, fixed by role; line width grows with period, so the fast week line is thinnest and the slow yearly line is thickest and calmest — you can read the timeframe at a glance from the thickness. An optional secondary set (off by default) adds market-specific extra lengths in a separate color: 10/13/15/30 for Anglo markets, 10 for Taiwan, 10/90/180 for Korea, 10/15 for Japan. SMA or EMA is selectable.Turning off the half-year line gives the classic 5/20/50/200 view.Use as a trend and support/resistance reference; the right MA convention varies by market, which is exactly what this automates.
版本注释
Market-Aware Moving AveragesA moving-average set that automatically switches its length convention to match the instrument's home market, so the lines reflect the periods traders in that market actually watch.
It plots five main lines for the standard timeframes — week, month, quarter, half-year, and year — and picks the right lengths by market:
- US / EU / IN and all non-stock symbols (default): 5 / 20 / 50 / 100 / 200
- Taiwan / Korea: 5 / 20 / 60 / 120 / 240
- Japan: 5 / 25 / 75 / 100 / 200
The market is detected automatically from the symbol's country and type, or you can force a system (Anglo, Asia, Japan, or fully Custom lengths) from the inputs.
Design choices that make it readable: all main lines share one color, fixed by role; line width grows with period, so the fast week line is thinnest and the slow yearly line is thickest and calmest — you can read the timeframe at a glance from the thickness. An optional secondary set (off by default) adds market-specific extra lengths in a separate color: 10/13/15/30 for Anglo markets, 10 for Taiwan, 10/90/180 for Korea, 10/15 for Japan. SMA or EMA is selectable.
Turning off the half-year line gives the classic 5/20/50/200 view.
Use as a trend and support/resistance reference; the right MA convention varies by market, which is exactly what this automates.
版本注释
Market-Aware Moving Averages automatically switches its moving-average lengths based on the market the chart symbol belongs to, so you don't have to reconfigure it each time you move between Taiwan, the US, Japan, Korea, Europe, India, crypto, forex, and more.Why this exists. Different markets follow different moving-average conventions. The US, Europe and India favor the round 50/200 set; Taiwan and Korea use the trading-day set (60 for a quarter, 240 for a year); Japan has its own 25/75 tradition. Changing lengths by hand on every switch is tedious and easy to forget. This script reads the symbol's country and type and applies the right set on its own.
What it plots. Five main lines covering week / month / quarter / half-year / year, plus optional secondary lines that are common but less central. Main and secondary use two distinct colors, and line width grows with period, so the longest (yearly) line is the thickest and least noisy.
Length sets by market:
US / Europe / India, and all non-stock instruments (default): 5 / 20 / 50 / 100 / 200; secondary 10 / 13 / 15 / 30
Taiwan / Korea: 5 / 20 / 60 / 120 / 240; secondary 10 (Korea also 90 / 180)
Japan: 5 / 25 / 75 / 100 / 200; secondary 10 / 15
How detection works. It uses Pine's syminfo.country and syminfo.type. Any stock without a mapped country, and every non-stock instrument (index, forex, crypto, futures, commodity), falls back to the default 5/20/50/200 set.
Settings. Override the auto-detection to force a specific system or fully custom lengths; switch between SMA and EMA; toggle each line; and change both colors. Secondary lines are hidden by default.
Note. Moving averages are lagging indicators and can give false signals in ranging markets. The length conventions used here are common market practices, not guarantees. This is a visualization tool, not financial advice.
6 hours ago
Release Notes
Market-Aware Moving AveragesA moving-average set that automatically switches its length convention to match the instrument's home market, so the lines reflect the periods traders in that market actually watch.It plots five main lines for the standard timeframes — week, month, quarter, half-year, and year — and picks the right lengths by market:US / EU / IN and all non-stock symbols (default): 5 / 20 / 50 / 100 / 200
Taiwan / Korea: 5 / 20 / 60 / 120 / 240
Japan: 5 / 25 / 75 / 100 / 200The market is detected automatically from the symbol's country and type, or you can force a system (Anglo, Asia, Japan, or fully Custom lengths) from the inputs.Design choices that make it readable: all main lines share one color, fixed by role; line width grows with period, so the fast week line is thinnest and the slow yearly line is thickest and calmest — you can read the timeframe at a glance from the thickness. An optional secondary set (off by default) adds market-specific extra lengths in a separate color: 10/13/15/30 for Anglo markets, 10 for Taiwan, 10/90/180 for Korea, 10/15 for Japan. SMA or EMA is selectable.Turning off the half-year line gives the classic 5/20/50/200 view.Use as a trend and support/resistance reference; the right MA convention varies by market, which is exactly what this automates.
6 hours ago
Release Notes
Market-Aware Moving Averages
A moving-average set that automatically switches its length convention to match the instrument's home market, so the lines reflect the periods traders in that market actually watch.
It plots five main lines for the standard timeframes — week, month, quarter, half-year, and year — and picks the right lengths by market:
US / EU / IN and all non-stock symbols (default): 5 / 20 / 50 / 100 / 200
Taiwan / Korea: 5 / 20 / 60 / 120 / 240
Japan: 5 / 25 / 75 / 100 / 200
The market is detected automatically from the symbol's country and type, or you can force a system (Anglo, Asia, Japan, or fully Custom lengths) from the inputs.
Design choices that make it readable: all main lines share one color, fixed by role; line width grows with period, so the fast week line is thinnest and the slow yearly line is thickest and calmest — you can read the timeframe at a glance from the thickness. An optional secondary set (off by default) adds market-specific extra lengths in a separate color: 10/13/15/30 for Anglo markets, 10 for Taiwan, 10/90/180 for Korea, 10/15 for Japan. SMA or EMA is selectable.
Turning off the half-year line gives the classic 5/20/50/200 view.
Use as a trend and support/resistance reference; the right MA convention varies by market, which is exactly what this automates.
版本注释
Market-Aware Moving Averages automatically switches its moving-average lengths based on the market the chart symbol belongs to, so you don't have to reconfigure it each time you move between Taiwan, the US, Japan, Korea, Europe, India, crypto, forex, and more.Why this exists. Different markets follow different moving-average conventions. The US, Europe and India favor the round 50/200 set; Taiwan and Korea use the trading-day set (60 for a quarter, 240 for a year); Japan has its own 25/75 tradition. Changing lengths by hand on every switch is tedious and easy to forget. This script reads the symbol's country and type and applies the right set on its own.
What it plots. Five main lines covering week / month / quarter / half-year / year, plus optional secondary lines that are common but less central. Main and secondary use two distinct colors, and line width grows with period, so the longest (yearly) line is the thickest and least noisy.
Length sets by market:
US / Europe / India, and all non-stock instruments (default): 5 / 20 / 50 / 100 / 200; secondary 10 / 13 / 15 / 30
Taiwan / Korea: 5 / 20 / 60 / 120 / 240; secondary 10 (Korea also 90 / 180)
Japan: 5 / 25 / 75 / 100 / 200; secondary 10 / 15
How detection works. It uses Pine's syminfo.country and syminfo.type. Any stock without a mapped country, and every non-stock instrument (index, forex, crypto, futures, commodity), falls back to the default 5/20/50/200 set.
Settings. Override the auto-detection to force a specific system or fully custom lengths; switch between SMA and EMA; toggle each line; and change both colors. Secondary lines are hidden by default.
Note. Moving averages are lagging indicators and can give false signals in ranging markets. The length conventions used here are common market practices, not guarantees. This is a visualization tool, not financial advice.
开源脚本
秉承TradingView的精神,该脚本的作者将其开源,以便交易者可以查看和验证其功能。向作者致敬!您可以免费使用该脚本,但请记住,重新发布代码须遵守我们的网站规则。
免责声明
这些信息和出版物并非旨在提供,也不构成TradingView提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。
开源脚本
秉承TradingView的精神,该脚本的作者将其开源,以便交易者可以查看和验证其功能。向作者致敬!您可以免费使用该脚本,但请记住,重新发布代码须遵守我们的网站规则。
免责声明
这些信息和出版物并非旨在提供,也不构成TradingView提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。