pineCopyindicator('MTF Countdown with Direction - Aynet', overlay = true)
This code creates a Multiple Time Frame (MTF) countdown indicator with direction The overlay = true parameter places the indicator on top of the price chart
Timeframe Options:
Users can choose to show/hide the following timeframes:
Calculates the current time Converts Unix timestamp to seconds Calculates time since midnight Returns time broken down into hours, minutes, and seconds
Countdown Calculation:
pineCopyget_period_countdown(period_seconds)
Calculates remaining time for each timeframe Computes elapsed time in current period Returns remaining time in hours, minutes, and seconds
Direction and Closing Price Calculation:
Separate functions for each timeframe (get_direction_and_close_1m(), get_direction_and_close_5m(), etc.) Each function:
Gets current closing price Compares with previous closing price Determines direction (up: 1, down: -1, sideways: 0) Returns direction and closing price
Table Creation and Updates:
Creates a table in the top right corner Table consists of 4 columns:
Period (Timeframe) Time Left (Remaining time) Direction (Shown with arrows) Close (Closing price)
Each row has a different background color Direction arrows:
Green up arrow (▲): Price rising Red down arrow (▼): Price falling Gray line (―): Price sideways
Dynamic Data Structures:
pineCopyvar timeframes = array.new_int() var timeframe_names = array.new_string() var show_array = array.new_bool()
Uses dynamic arrays for timeframes Adds selected timeframes to arrays on first run
Key Features:
Shows remaining time until period close Displays price direction for each timeframe Shows current closing prices All information in a single, easy-to-read table
This indicator helps traders by providing a comprehensive view of:
When each timeframe will close The direction of price movement Current closing prices
across multiple timeframes in a single table, making it easier to track market movements across different time periods. The color-coding and arrow system makes it visually intuitive to understand market direction at a glance, while the countdown timer helps with timing decisions.
ברוח TradingView אמיתית, מחבר הסקריפט הזה פרסם אותו בקוד פתוח, כך שסוחרים יוכלו להבין ולאמת אותו. כל הכבוד למחבר! אתה יכול להשתמש בו בחינם, אבל השימוש החוזר בקוד זה בפרסום כפוף לכללי הבית. אתה יכול להכניס אותו למועדפים כדי להשתמש בו בגרף.
המידע והפרסומים אינם אמורים להיות, ואינם מהווים, עצות פיננסיות, השקעות, מסחר או סוגים אחרים של עצות או המלצות שסופקו או מאושרים על ידי TradingView. קרא עוד בתנאים וההגבלות.