OPEN-SOURCE SCRIPT
Custom Weekly WED→TUE

Purpose:
This indicator creates custom weekly candles with a week boundary running from Wednesday to Tuesday (WED→TUE) for any symbol. It is designed for systems that prefer to close the trading week on Tuesday’s session instead of the standard weekend.
Custom Candle Logic (WED→TUE):
• Open = Opening price on Wednesday (start of the custom week).
• Close = Closing price on Tuesday (end of the custom week).
• High/Low = Maximum/minimum during the entire range from Wednesday → Tuesday.
Display Behavior:
• Only renders when the chart timeframe = 1W (Weekly).
• Completed weeks (with full Wed→Tue data) are shown as candlesticks (colored up/down based on O/C).
• The current incomplete week is shown as a preview box shifted to the next weekly slot (the column to the right), allowing you to see the progress of the ongoing week while keeping the last completed week intact.
Inputs:
• Start day (1=Mon…7=Sun) — default is 3 = Wednesday. You can change this to redefine the week boundary.
• Show current (incomplete) custom week — toggles the preview box for the current running week.
• Up/Down/Doji color — defines the colors of completed weekly candles.
• Preview box transparency — controls the opacity of the preview box for the ongoing week.
This indicator creates custom weekly candles with a week boundary running from Wednesday to Tuesday (WED→TUE) for any symbol. It is designed for systems that prefer to close the trading week on Tuesday’s session instead of the standard weekend.
Custom Candle Logic (WED→TUE):
• Open = Opening price on Wednesday (start of the custom week).
• Close = Closing price on Tuesday (end of the custom week).
• High/Low = Maximum/minimum during the entire range from Wednesday → Tuesday.
Display Behavior:
• Only renders when the chart timeframe = 1W (Weekly).
• Completed weeks (with full Wed→Tue data) are shown as candlesticks (colored up/down based on O/C).
• The current incomplete week is shown as a preview box shifted to the next weekly slot (the column to the right), allowing you to see the progress of the ongoing week while keeping the last completed week intact.
Inputs:
• Start day (1=Mon…7=Sun) — default is 3 = Wednesday. You can change this to redefine the week boundary.
• Show current (incomplete) custom week — toggles the preview box for the current running week.
• Up/Down/Doji color — defines the colors of completed weekly candles.
• Preview box transparency — controls the opacity of the preview box for the ongoing week.
Skrip sumber terbuka
Dalam semangat sebenar TradingView, pencipta skrip ini telah menjadikannya sumber terbuka supaya pedagang dapat menilai dan mengesahkan kefungsiannya. Terima kasih kepada penulis! Walaupun anda boleh menggunakannya secara percuma, ingat bahawa menerbitkan semula kod ini adalah tertakluk kepada Peraturan Dalaman kami.
Penafian
Maklumat dan penerbitan adalah tidak dimaksudkan untuk menjadi, dan tidak membentuk, nasihat untuk kewangan, pelaburan, perdagangan dan jenis-jenis lain atau cadangan yang dibekalkan atau disahkan oleh TradingView. Baca dengan lebih lanjut di Terma Penggunaan.
Skrip sumber terbuka
Dalam semangat sebenar TradingView, pencipta skrip ini telah menjadikannya sumber terbuka supaya pedagang dapat menilai dan mengesahkan kefungsiannya. Terima kasih kepada penulis! Walaupun anda boleh menggunakannya secara percuma, ingat bahawa menerbitkan semula kod ini adalah tertakluk kepada Peraturan Dalaman kami.
Penafian
Maklumat dan penerbitan adalah tidak dimaksudkan untuk menjadi, dan tidak membentuk, nasihat untuk kewangan, pelaburan, perdagangan dan jenis-jenis lain atau cadangan yang dibekalkan atau disahkan oleh TradingView. Baca dengan lebih lanjut di Terma Penggunaan.