OPEN-SOURCE SCRIPT
Güncellendi Trinity Multi Time Frame Trend Dashboard

Note: This is based on trading view indicator but I am unsure the original name or author to give recognition. If you know the name of the indicator or author then please let me know and I can update this script to give recognition.
Below is a list of the changes this code has gone through and all settings are editable.
Changes:
Changed: timeline from 5 to 3 mins for faster scalping, changed the RSI, CCI and MACD values for faster signals as well as the below to update the code to latest pine script and for optimizations.
Structure and Optimization: The original script used individual variables for each timeframe (e.g., emaFast_3min, emaFast_15min), leading to repetitive code. The latest version uses arrays (e.g., emaFast as array.new_float(7, na)) to store values for all timeframes, making the code more compact and maintainable. However, due to Pine Script limitations with loops and request.security, the calculations are unrolled (explicitly computed for each timeframe i=0 to 6) instead of using a loop for security calls.
Timeframe Handling: Removed the timeframes array in the final version (as loops couldn't be used with variable timeframes in request.security due to requiring 'simple string' arguments). Instead, hardcoded the timeframe strings ("3", "15", etc.) directly in each block. Kept timeframe_labels array for display purposes.
Volume Calculation: Precomputed volume3 for the 3M timeframe outside the blocks. For 15M and 30M, used ta.sma(volume3, 3) and ta.sma(volume3, 6) respectively, as in the original, but integrated into unrolled blocks. Renamed volume arrays to tfVolume and tfVma to avoid conflicts with built-in volume.
MACD Calculation: In the original, used [macdLine_3min, signalLine_3min, _] to ignore the histogram. The latest version does the same but assigns to temporary variables like macd0, signal0 for each timeframe to avoid tuple assignment issues.
Trend Determination: Used arrays for all boolean conditions (e.g., isBullish as array.new_bool(7, false)). Set values in a loop, which works since no security calls are involved here.
Added Signal Row: Introduced a new row in the table labeled "Signal". For each timeframe, it shows:
"Buy" (green) if EMA, MACD, RSI, and CCI are all bullish.
"Sell" (red) if all are bearish.
"⚠" (yellow) if not fully aligned
Table Dimensions: Updated the table to 9, 8 (columns, rows) to accommodate the new "Signal" row.
Color for Signal: In the table cell for signal, added coloring: green for "Buy", red for "Sell", yellow for "⚠".
Array Declarations: Used array.new_float, array.new_bool, etc., without <series type> qualifiers to fix template errors. Initialized with na for floats/colors, false for bools, "" for strings.
Error Fixes: Resolved various syntax/type issues, such as avoiding series in array templates, ensuring 'simple string' for timeframes in request.security, and proper tuple unpacking for MACD.
Overall Code Length: The latest version is longer due to unrolled calculations but more robust and error-free.
Below is a list of the changes this code has gone through and all settings are editable.
Changes:
Changed: timeline from 5 to 3 mins for faster scalping, changed the RSI, CCI and MACD values for faster signals as well as the below to update the code to latest pine script and for optimizations.
Structure and Optimization: The original script used individual variables for each timeframe (e.g., emaFast_3min, emaFast_15min), leading to repetitive code. The latest version uses arrays (e.g., emaFast as array.new_float(7, na)) to store values for all timeframes, making the code more compact and maintainable. However, due to Pine Script limitations with loops and request.security, the calculations are unrolled (explicitly computed for each timeframe i=0 to 6) instead of using a loop for security calls.
Timeframe Handling: Removed the timeframes array in the final version (as loops couldn't be used with variable timeframes in request.security due to requiring 'simple string' arguments). Instead, hardcoded the timeframe strings ("3", "15", etc.) directly in each block. Kept timeframe_labels array for display purposes.
Volume Calculation: Precomputed volume3 for the 3M timeframe outside the blocks. For 15M and 30M, used ta.sma(volume3, 3) and ta.sma(volume3, 6) respectively, as in the original, but integrated into unrolled blocks. Renamed volume arrays to tfVolume and tfVma to avoid conflicts with built-in volume.
MACD Calculation: In the original, used [macdLine_3min, signalLine_3min, _] to ignore the histogram. The latest version does the same but assigns to temporary variables like macd0, signal0 for each timeframe to avoid tuple assignment issues.
Trend Determination: Used arrays for all boolean conditions (e.g., isBullish as array.new_bool(7, false)). Set values in a loop, which works since no security calls are involved here.
Added Signal Row: Introduced a new row in the table labeled "Signal". For each timeframe, it shows:
"Buy" (green) if EMA, MACD, RSI, and CCI are all bullish.
"Sell" (red) if all are bearish.
"⚠" (yellow) if not fully aligned
Table Dimensions: Updated the table to 9, 8 (columns, rows) to accommodate the new "Signal" row.
Color for Signal: In the table cell for signal, added coloring: green for "Buy", red for "Sell", yellow for "⚠".
Array Declarations: Used array.new_float, array.new_bool, etc., without <series type> qualifiers to fix template errors. Initialized with na for floats/colors, false for bools, "" for strings.
Error Fixes: Resolved various syntax/type issues, such as avoiding series in array templates, ensuring 'simple string' for timeframes in request.security, and proper tuple unpacking for MACD.
Overall Code Length: The latest version is longer due to unrolled calculations but more robust and error-free.
Sürüm Notları
Updated dashboard to now include multi time frame scoring to determine the buy and sell signals. The Score and Adj Score represent different stages of the trend analysis process, reflecting how the indicator evaluates and adjusts the trend strength across timeframes. Here's a detailed breakdown of their differences:Score
Definition: The "Score" is the initial, unadjusted numerical value calculated for each timeframe based on the weighted contributions of the five indicators (EMA, MACD, RSI, CCI, and Volume). It represents the raw trend strength and direction before considering higher timeframe (HTF) influences.
Calculation:
Each indicator contributes a positive weight (e.g., +3 for EMA if bullish, +2 for MACD if bullish, etc.) when its condition is bullish, a negative weight when bearish, or 0 if neutral or in a warning state (e.g., RSI/CCI overbought/oversold). The total score is the sum of these weighted values for a given timeframe. Example: With default weights (EMA=3, MACD=2, RSI=1, CCI=1, Volume=1), if EMA is bullish (+3), MACD is bullish (+2), RSI is neutral (0), CCI is bearish (-1), and Volume is above SMA (+1), the score would be 3 + 2 + 0 - 1 + 1 = +5.
Purpose:
The score provides a snapshot of the local trend strength for that specific timeframe, based solely on its own indicator data.
Adj Score
Definition: The "Adj Score" (Adjusted Score) is a modified version of the "Score" that incorporates the influence of higher timeframes to provide a more context-aware trend assessment. It adjusts the lower timeframe scores based on the average trend direction of all higher timeframes.
Calculation:
For the highest timeframe (1W), the Adj Score equals the Score (no adjustment, as there are no higher TFs).
For lower timeframes (3M to 1D), the Adj Score is calculated by adding an adjustment factor to the original Score. This adjustment is:
The average of the Scores from all higher timeframes (e.g., for 3M, it averages 15M, 30M, 1H, 4H, 1D, 1W scores).
Multiplied by the user-defined htfInfluenceFactor (default 0.5, range 0-1), which controls how much influence higher TFs have.
Example: If 3M has a Score of +5, and the average Score of higher TFs (15M to 1W) is +2, with htfInfluenceFactor at 0.5, the adjustment is 2 * 0.5 = +1. The Adj Score becomes 5 + 1 = +6.
Purpose:
The Adj Score aligns lower timeframe trends with the broader market context, reducing false signals (e.g., a 3M Buy when 1D is strongly bearish). It ensures that short-term signals are filtered by longer-term trends, improving signal quality.
Signal Impact:
The final "Signal" (Buy, Sell, or ⚠) is determined based on the Adj Score compared to the buyThreshold (default 5) and sellThreshold (default -5).
Practical Implications
Score gives you the unfiltered view of a timeframe's trend, useful for diagnosing individual indicator behavior. Adj Score reflects a more holistic view, making it the decision-making metric. For instance, if 3M shows a Score of +4 (near a Buy) but higher TFs are bearish (average -3), the Adj Score might drop to +2.5 (with factor 0.5), keeping it a "⚠" unless the threshold is met.
Adjust the htfInfluenceFactor (e.g., lower to 0.2 for less HTF impact, or raise to 0.8 for more) based on how much you want higher TFs to dominate lower TF signals.
This dual-score system enhances flexibility to understand local vs. adjusted trends!
Açık kaynak kodlu komut dosyası
Gerçek TradingView ruhuna uygun olarak, bu komut dosyasının oluşturucusu bunu açık kaynaklı hale getirmiştir, böylece yatırımcılar betiğin işlevselliğini inceleyip doğrulayabilir. Yazara saygı! Ücretsiz olarak kullanabilirsiniz, ancak kodu yeniden yayınlamanın Site Kurallarımıza tabi olduğunu unutmayın.
Feragatname
Bilgiler ve yayınlar, TradingView tarafından sağlanan veya onaylanan finansal, yatırım, işlem veya diğer türden tavsiye veya tavsiyeler anlamına gelmez ve teşkil etmez. Kullanım Şartları'nda daha fazlasını okuyun.
Açık kaynak kodlu komut dosyası
Gerçek TradingView ruhuna uygun olarak, bu komut dosyasının oluşturucusu bunu açık kaynaklı hale getirmiştir, böylece yatırımcılar betiğin işlevselliğini inceleyip doğrulayabilir. Yazara saygı! Ücretsiz olarak kullanabilirsiniz, ancak kodu yeniden yayınlamanın Site Kurallarımıza tabi olduğunu unutmayın.
Feragatname
Bilgiler ve yayınlar, TradingView tarafından sağlanan veya onaylanan finansal, yatırım, işlem veya diğer türden tavsiye veya tavsiyeler anlamına gelmez ve teşkil etmez. Kullanım Şartları'nda daha fazlasını okuyun.