ATR Percentage Covered% of ATR covered from yesterday's close. If a stock's ATR is for example 40$ and the stock gapped down 20$ and dropped 10$ more after the open, the Indicator will show 0.75 (75%) (30/40). It helps to understand how much move is there still "in" the asset analyzing.
Indikatoren und Strategien
Enhanced Cognitive Learning Indicator 2.0 - Enhanced Market Analyzer with Advanced Features and Adaptive Cognitive Learning 2.0
improved integration and inputs
Direnç Destek noktaları tahminleriOlası direnç ve destek noktalarını bir önceki günün açılış, kapanış, high ve low değerlerine göre tahminlemeye çalışıp grafik üzerinde gösteren kod dosyası.
Supply and Demand - Order Block Strategy BY ALGERNON STONEBreakout Logic:
topBreakCheckSource and bottomBreakCheckSource are used to define the break-out check based on user input.
If the price crosses over the topValue (the high of the last fractal) and topBreakBlock is not set, then a long entry is generated after creating a demandBox, based on the last red candle's low and high.
If the price crosses under the bottomValue and bottomBreakBlock is not set, then a short entry is generated after creating a supplyBox, based on the last green candle's low and high.
If a long or short is active, and a breakout of the price happens, the script will draw a new line object to indicate the breakout, where x2 of the line is set to the current bar index
Fractal Detection:
If a new up fractal is detected, the topValue and topLine variables are updated, and the old line object is deleted
If a new down fractal is detected, the bottomValue and bottomLine variables are updated, and the old line object is deleted
Box Color Update:
The script loops through all the active boxes and changes their color if the current candle close price is outside the range of the box.
Plots: Plots the up and down fractals for visualization.
Checklist Table: A table displays the status of different conditions of the script on the bottom right.
Shows status of Up Fractal, Down Fractal, Top Break, Bottom Break, Last Red Candle, Last Green Candle, Box Color Change Active using check and cross mark symbols.
How the Strategy Works:
Fractal Identification: The strategy continuously looks for fractal highs and lows.
Order Block Identification: When a new fractal is formed, the script stores the high and low of the last opposing candle.
Breakout Confirmation: When price breaks the range of a fractal, it indicates an order block breakout.
Trade Execution: When there is a valid breakout, it triggers a long or short trade, depending on whether a demand or supply zone is broken.
Box Visualization: The script visually represents the order blocks using boxes that are colored green for demand zones and red for supply zones. These boxes can be optionally re-colored if the price breaks beyond them.
Checklist Display: A checklist table at the bottom right of the chart helps the user to quickly understand the script status.
Custom RSIthis script is just better version like whenever RSI crosses above 60 RSI line will become green and below 40 will become red.
you can modify the color and setting from the setting of the indicator.
VWAP + FVG DetectorVWAP + FVG Detector
A VWAP + FVG Detector tool would likely combine these two concepts to help traders identify potential areas of opportunity. For example:
It could help identify when the price is moving away from the VWAP and into a fair value gap, signaling a potential reversal or continuation based on the imbalance.
It may also help to pinpoint areas where price might revert back to the VWAP after a significant move, taking into account the gaps between price and VWAP levels.
This combination could be useful in intraday trading, where traders look for price imbalances and aim to trade them with respect to the VWAP as a key reference level.
Are you looking for a script to implement this, or more information on how these strategies work together?
Compounded Price PlotPlots a line at the value of the compounded price, calculated based on a specific date and %.
For example, if a stock's close on 01/01/2020 was 100, then its approx compounded price at 10%,after 4 years would be, 146.41 . In this case, it plots the value as of last candle date.
BTC Day Trading Strategy//@version=5
indicator("BTC Day Trading Strategy", overlay=true)
// Inputs for Indicators
emaLength1 = input.int(9, title="EMA 1 Length")
emaLength2 = input.int(21, title="EMA 2 Length")
rsiperiod = input.int(14, title="RSI Period")
macdFast = input.int(12, title="MACD Fast Length")
macdSlow = input.int(26, title="MACD Slow Length")
macdSignal = input.int(9, title="MACD Signal Length")
// EMA Calculations
ema1 = ta.ema(close, emaLength1)
ema2 = ta.ema(close, emaLength2)
// RSI Calculation
rsi = ta.rsi(close, rsiperiod)
// MACD Calculation
= ta.macd(close, macdFast, macdSlow, macdSignal)
// Assigning crossover and crossunder to variables for consistency
longCrossover = ta.crossover(ema1, ema2)
shortCrossunder = ta.crossunder(ema1, ema2)
macdCrossover = ta.crossover(macdLine, signalLine)
macdCrossunder = ta.crossunder(macdLine, signalLine)
// Conditions for Long Entry
longCondition = longCrossover and rsi > 40 and macdCrossover
if (longCondition)
label.new(bar_index, high, "BUY", style=label.style_label_up, color=color.green, textcolor=color.white)
// Conditions for Short Entry
shortCondition = shortCrossunder and rsi < 35 and macdCrossunder
if (shortCondition)
label.new(bar_index, low, "SELL", style=label.style_label_down, color=color.red, textcolor=color.white)
// Plot EMAs
plot(ema1, color=color.blue, title="EMA 9")
plot(ema2, color=color.orange, title="EMA 21")
// Alerts
alertcondition(longCondition, title="Long Entry Alert", message="BTCUSD: Señal de compra confirmada.")
alertcondition(shortCondition, title="Short Entry Alert", message="BTCUSD: Señal de venta confirmada.")
ForecastPro by BinhMyco1. Overview:
This Pine Script implements a custom forecasting tool on TradingView, labeled "BinhMyco." It provides a method to predict future price movements based on historical data and a comparison with similar historical patterns. The script supports two types of forecasts: **Prediction** and **Replication**, where the forecasted price can be either based on price peaks/troughs or an average direction. The script also calculates a confidence probability, showing how closely the forecasted data aligns with historical trends.
2. Inputs:
- Source (`src`): The input data source for forecasting, which defaults to `open`.
- Length (`len`): The length of the training data used for analysis (fixed at 200).
- Reference Length (`leng`): A fixed reference length for comparing similar historical patterns (set to 70).
- Forecast Length (`length`): The length of the forecast period (fixed at 60).
- Multiplier (`mult`): A constant multiplier for the forecast confidence cone (set to 4.0).
- Forecast Type (`typ`): Type of forecast, either **Prediction** or **Replication**.
- Direction Type (`dirtyp`): Defines how the forecast is calculated — either based on price **peaks/troughs** or an **average direction**.
- Forecast Divergence Cone (`divcone`): A boolean option to enable the display of a confidence cone around the forecast.
3. Color Constants:
- Green (`#00ffbb`): Color used for upward price movements.
- Red (`#ff0000`): Color used for downward price movements.
- Reference Data Color (`refcol`): Blue color for the reference data.
- Similar Data Color (`simcol`): Orange color for the most similar data.
- Forecast Data Color (`forcol`): Yellow color for forecasted data.
4. Error Checking:
- The script checks if the reference length is greater than half the training data length, and if the forecast length exceeds the reference length, raising errors if either condition is true.
5. Arrays for Calculation:
- Correlation Array (`c`): Holds the correlation values between the data source (`src`) and historical data points.
- Index Array (`index`): Stores the indices of the historical data for comparison.
6. Forecasting Logic:
- Correlation Calculation: The script calculates the correlation between the historical data (`src`) and the reference data over the given reference length. It then identifies the point in history most similar to the current data.
- Forecast Price Calculation: Based on the type of forecast (Prediction or Replication), the script calculates future prices either by predicting based on similar bars or by replicating past data. The forecasted prices are stored in the `forecastPrices` array.
- Forecast Line Drawing: The script draws lines to represent the forecasted price movements. These lines are color-coded based on whether the forecasted price is higher or lower than the current price.
7. Divergence Cone (Optional):
- If the **divcone** option is enabled, the script calculates and draws a confidence cone around the forecasted prices. The upper and lower bounds of the cone are calculated using a standard deviation factor, providing a visual representation of forecast uncertainty.
8. Probability Table:
- A table is displayed on the chart, showing the probability of the forecast being accurate. This probability is calculated using the correlation between the current data and the most similar historical pattern. If the probability is positive, the table background turns green; if negative, it turns red. The probability is presented as a percentage.
9. Key Functions:
- `highest_range` and `lowest_range`: Functions to find the highest and lowest price within a range of bars.
- `ftype`: Determines the forecast type (Prediction or Replication) and adjusts the forecasting logic accordingly.
- `ftypediff`: Computes the difference between the forecasted and actual prices based on the selected forecast type.
- `ftypelim`, `ftypeleft`, `ftyperight`: Additional functions to adjust the calculation of the forecast based on the forecast type.
10. Conclusion:
The "ForecastPro" script is a unique tool for forecasting future price movements on TradingView. It compares historical price data with similar historical trends to generate predictions. The script also offers a customizable confidence cone and displays the probability of the forecast's accuracy. This tool provides traders with valuable insights into future price action, potentially enhancing decision-making in trading strategies.
---
This script provides advanced functionality for traders who wish to explore price forecasting, and can be customized to fit various trading styles.
Ichimoku ACE ClubA. Overview:
This script is a custom implementation of the Ichimoku Cloud indicator for the TradingView platform, built using Pine Script version 4. It adds additional features like custom "Knife" lines and circle markers for specific data points. The indicator overlays on the chart and plots various elements of the Ichimoku system, including the Tenkan, Kijun, Chikou, and Kumo Cloud.
B. Inputs:
1. Tenkan (TS): This is the short-term moving average line (default period: 9).
2. Kijun (KJ): This is the medium-term moving average line (default period: 17).
3. Knife1 (K1): This line is based on a longer-term moving average (default period: 65).
4. Knife2 (K2): Another long-term moving average line (default period: 129).
5. Chikou Displacement (Chikou_Disp): The Chikou Span is plotted with a delay of 26 periods by default.
6. Displacement (disp): Determines the horizontal shift of the Kumo cloud.
C. Functions:
- `donchian(len)`: This function calculates the Donchian channel, which is the average of the highest high and the lowest low over the given period (len).
- `mf(len, offset)`: This function calculates the highest high and the lowest low over the given period, with an offset applied.
D. Plots:
1. Tenkan, Kijun, Knife1, and Knife2: These are plotted as lines with different colors and thicknesses.
- Tenkan is blue.
- Kijun is red.
- Knife1 is yellow.
- Knife2 is orange.
2. Chikou Span: This is plotted with a displacement and shown in purple.
3. Kumo Cloud: The cloud is formed by plotting two lines, Span A (green) and Span B (magenta), which represent the top and bottom of the cloud, respectively. The space between these lines is filled with a semi-transparent color, either green or magenta, depending on the relative position of the two spans.
E. Circle Markers:
- Additional circle markers are plotted for each of the Tenkan, Kijun, Knife1, and Knife2 lines at various offsets, helping to visualize the historical data points for each of these indicators. These circles are color-coded according to the line they correspond to.
F. Customization:
- The indicator allows customization of the lengths (periods) for Tenkan, Kijun, Knife1, Knife2, and other components via the script's input fields.
G. Conclusion:
This Ichimoku-based indicator provides a detailed view of the market's trend strength and direction. It offers a unique addition with the Knife lines and visual aids like circle markers for specific periods, which helps traders make better-informed decisions based on Ichimoku analysis.
---
You can modify the parameters such as `TS`, `KJ`, `K1`, `K2`, and `disp` according to your trading preferences. The colors and line thicknesses can also be adjusted for better visual representation.
Estrategia Avanzada - EMA y RSI con ColoresDescripción del Script Mejorado:
Líneas de EMAs:
EMA 20 (Corta) y EMA 50 (Larga) cambian de color según las condiciones:
Verde para la EMA 20 cuando hay una señal de compra (crossover de EMAs).
Roja para la EMA 50 cuando hay una señal de venta (crossunder de EMAs).
Condiciones de Entrada:
Long (Compra): Cuando la EMA 20 cruza hacia arriba la EMA 50 y el RSI está por debajo de 30 (zona de sobreventa).
Short (Venta): Cuando la EMA 20 cruza hacia abajo la EMA 50 y el RSI está por encima de 70 (zona de sobrecompra).
Señales Visuales:
Señal de compra (BUY): Aparece en verde debajo de la vela cuando se cumple la condición de entrada larga.
Señal de venta (SELL): Aparece en rojo arriba de la vela cuando se cumple la condición de entrada corta.
Los colores de las líneas de las EMAs cambian dinámicamente para indicar visualmente la tendencia.
Fondo coloreado: El fondo cambia a verde (compra) o rojo (venta) para indicar claramente la tendencia en tiempo real.
RSI:
Se muestra el RSI en el gráfico para confirmar si el activo está en zonas de sobrecompra o sobreventa.
También se dibujan líneas horizontales de sobrecompra y sobreventa en el gráfico para facilitar la interpretación.
ARIA_Volume20SMAThis strategy is based on volumes and SMA, we attempt to identify when institutional activity comes into the counter and ride the direction
Fast Stochastic 60.10.1periodK Length: Set to 60 to represent the %K lookback period of 60.
smoothK: Set to 10, applying a 10-period SMA to smooth the %K line.
periodD: Set to 1, leaving the %D line unsmoothed (raw).
Plot Titles: Updated the short titles and descriptions to reflect "Fast Stochastic 60.10.1".
PPO/ADX Pinch Strategy CobyTweak 2 This tool can help analyze the momentum and trend strength of an asset to identify:
Periods of Strong Trends: Indicated by a high ADX.
Potential Reversals or Breakouts: Highlighted during "pinch zones."
Momentum Shifts: Tracked using the PPO Line, Signal Line, and histogram.
The script uses the asset's closing price to calculate all indicators, providing actionable insights for both short-term and long-term trading strategies.\This Pine Script plots two technical indicators, the Percentage Price Oscillator (PPO) and the Average Directional Index (ADX), for the underlying asset (e.g., stock, forex pair, or cryptocurrency). It helps identify periods of trend strength and potential price "pinch" zones, which can signal consolidations or reversals.
Holiday Cheer 🎄Features:
Snowflakes Animation: Creates a "falling snow" effect with small white circles drifting downwards.
Festive Candlesticks: Green for up candles, red for down candles, matching holiday vibes.
Greeting Label: Displays a cheerful holiday message on the chart
AdibXmos // © Adib2024
//@version=5
indicator('AdibXmos ', overlay=true, max_labels_count=500)
show_tp_sl = input.bool(true, 'Display TP & SL', group='Techical', tooltip='Display the exact TP & SL price levels for BUY & SELL signals.')
rrr = input.string('1:2', 'Risk to Reward Ratio', group='Techical', options= , tooltip='Set a risk to reward ratio (RRR).')
tp_sl_multi = input.float(1, 'TP & SL Multiplier', 1, group='Techical', tooltip='Multiplies both TP and SL by a chosen index. Higher - higher risk.')
tp_sl_prec = input.int(2, 'TP & SL Precision', 0, group='Techical')
candle_stability_index_param = 0.5
rsi_index_param = 70
candle_delta_length_param = 4
disable_repeating_signals_param = input.bool(true, 'Disable Repeating Signals', group='Techical', tooltip='Removes repeating signals. Useful for removing clusters of signals and general clarity.')
GREEN = color.rgb(29, 255, 40)
RED = color.rgb(255, 0, 0)
TRANSPARENT = color.rgb(0, 0, 0, 100)
label_size = input.string('huge', 'Label Size', options= , group='Cosmetic')
label_style = input.string('text bubble', 'Label Style', , group='Cosmetic')
buy_label_color = input(GREEN, 'BUY Label Color', inline='Highlight', group='Cosmetic')
sell_label_color = input(RED, 'SELL Label Color', inline='Highlight', group='Cosmetic')
label_text_color = input(color.white, 'Label Text Color', inline='Highlight', group='Cosmetic')
stable_candle = math.abs(close - open) / ta.tr > candle_stability_index_param
rsi = ta.rsi(close, 14)
atr = ta.atr(14)
bullish_engulfing = close < open and close > open and close > open
rsi_below = rsi < rsi_index_param
decrease_over = close < close
var last_signal = ''
var tp = 0.
var sl = 0.
bull_state = bullish_engulfing and stable_candle and rsi_below and decrease_over and barstate.isconfirmed
bull = bull_state and (disable_repeating_signals_param ? (last_signal != 'buy' ? true : na) : true)
bearish_engulfing = close > open and close < open and close < open
rsi_above = rsi > 100 - rsi_index_param
increase_over = close > close
bear_state = bearish_engulfing and stable_candle and rsi_above and increase_over and barstate.isconfirmed
bear = bear_state and (disable_repeating_signals_param ? (last_signal != 'sell' ? true : na) : true)
round_up(number, decimals) =>
factor = math.pow(10, decimals)
math.ceil(number * factor) / factor
if bull
last_signal := 'buy'
dist = atr * tp_sl_multi
tp_dist = rrr == '2:3' ? dist / 2 * 3 : rrr == '1:2' ? dist * 2 : rrr == '1:4' ? dist * 4 : dist
tp := round_up(close + tp_dist, tp_sl_prec)
sl := round_up(close - dist, tp_sl_prec)
if label_style == 'text bubble'
label.new(bar_index, low, 'BUY', color=buy_label_color, style=label.style_label_up, textcolor=label_text_color, size=label_size)
else if label_style == 'triangle'
label.new(bar_index, low, 'BUY', yloc=yloc.belowbar, color=buy_label_color, style=label.style_triangleup, textcolor=TRANSPARENT, size=label_size)
else if label_style == 'arrow'
label.new(bar_index, low, 'BUY', yloc=yloc.belowbar, color=buy_label_color, style=label.style_arrowup, textcolor=TRANSPARENT, size=label_size)
label.new(show_tp_sl ? bar_index : na, low, 'TP: ' + str.tostring(tp) + ' SL: ' + str.tostring(sl), yloc=yloc.price, color=color.gray, style=label.style_label_down, textcolor=label_text_color)
if bear
last_signal := 'sell'
dist = atr * tp_sl_multi
tp_dist = rrr == '2:3' ? dist / 2 * 3 : rrr == '1:2' ? dist * 2 : rrr == '1:4' ? dist * 4 : dist
tp := round_up(close - tp_dist, tp_sl_prec)
sl := round_up(close + dist, tp_sl_prec)
if label_style == 'text bubble'
label.new(bear ? bar_index : na, high, 'SELL', color=sell_label_color, style=label.style_label_down, textcolor=label_text_color, size=label_size)
else if label_style == 'triangle'
label.new(bear ? bar_index : na, high, 'SELL', yloc=yloc.abovebar, color=sell_label_color, style=label.style_triangledown, textcolor=TRANSPARENT, size=label_size)
else if label_style == 'arrow'
label.new(bear ? bar_index : na, high, 'SELL', yloc=yloc.abovebar, color=sell_label_color, style=label.style_arrowdown, textcolor=TRANSPARENT, size=label_size)
label.new(show_tp_sl ? bar_index : na, low, 'TP: ' + str.tostring(tp) + ' SL: ' + str.tostring(sl), yloc=yloc.price, color=color.gray, style=label.style_label_up, textcolor=label_text_color)
alertcondition(bull or bear, 'BUY & SELL Signals', 'New signal!')
alertcondition(bull, 'BUY Signals (Only)', 'New signal: BUY')
alertcondition(bear, 'SELL Signals (Only)', 'New signal: SELL')
Pi Cycle Top Indicatorindikator ini dibuat sesuai bitbo pi cycle top
dibuat dibantu dengan bantuan ChatGPT gratis
silahkan dipakai kalau suka. @yogajangkung
Pattern & Percent Pro"Candle Percentage Change with Patterns"
This might be one of the most powerful indicators available in TradingView for complete market trend analysis, which includes tracking the price and specifying the most important candlestick patterns. It has been designed for traders who want in-depth insight into market dynamics through visual hints, percentage-based calculations, and flexible settings.
Key Features:
Percentage Change Analysis:
Provides percentage change labels for every candle.
Label placement has three modes: all labels on top, alternate placement, or top for green candles and bottom for red candles.
Labels are user-configurable with custom colors for positive and negative changes.
Cumulative Change Tracking:
Calculates and displays cumulative percentage change over a user-specified number of candles.
Ideal for analyzing short-term trends or larger market movements.
Candlestick Pattern Detection:
Automatically identifies and labels key patterns such as:
Doji (including Dragonfly and Gravestone variants).
Hammer (standard and inverted).
Shooting Star.
Bullish and Bearish Marubozu.
Assists traders in the immediate identification of possible reversals or continuation patterns.
Heatmap Visualization:
Plots a color-coded background to show the magnitude of percentage changes.
Dynamic shades of green for positive changes and red for negative changes.
Heatmap can be enabled or disabled at will.
Candle Highlighting:
Highlights candles containing significant percentage changes based on user-set levels of threshold.
Provides a visual cue toward critical market movements.
High/Low Alert System:
Optional alerts when price travels over or below predefined boundaries
Custom text and background colors for high and low alerts
Audio and visual notifications immediately update you on the presence of significant price action
Trend Indicator:
Follows general market trend by using a weighted moving average
Arrows are displayed upward or downward for fast and easy visual identification
RSI Integration:
Enables the filtering of displayed percentage change labels based on RSI conditions, such as overbought or oversold levels.
Helps to provide more granular insights while removing some noise from the data.
Customizable UI:
Some features that can be turned on/off include heatmap, highlights, pattern detection, and RSI filters.
Adjustable label lifetime, cumulative change length, and warning/threshold levels.
Intuitive settings make it easy to adapt the indicator to any trading strategy.
Bollinger Bands StrategyTrading anhand der Bollinger Bänder:
Pine Skript erstellt und eingefügt:
Kaufbedingung: Wenn der Preis das untere Band von unten nach oben kreuzt.
Verkaufbedingung: Wenn der Preis das obere Band von oben nach unten kreuzt.
mentor+json+v1.0This script implements a straightforward trend-following strategy based on moving averages (EMAs) and RSI confirmation. It is designed to help traders identify potential trend-based entry and exit points while managing risk with a customizable stop loss.
Key Features:
EMA Crossover: Buy signals occur when the short EMA crosses above the long EMA, and RSI is above a specified level. Sell signals are generated when the short EMA crosses below the long EMA, and RSI is below the specified level.
Stop Loss: A percentage-based stop loss is applied to all trades, ensuring effective risk management. The stop loss level is displayed as a dashed line on the chart.
Customization: Users can adjust the EMA lengths, RSI confirmation level, and stop loss percentage to match their trading strategy.
How to Use:
Add the script to your chart and adjust the inputs in the settings panel:
Short EMA Length: Determines the sensitivity of the short moving average.
Long EMA Length: Controls the trend-following component.
RSI Confirmation Level: Ensures trades are aligned with momentum.
Stop Loss (%): Defines the percentage level at which the stop loss is set.
Observe the buy and sell signals marked on the chart.
Use the stop loss line as a visual guide to manage risk for your trades.
Notes:
This script is intended for educational purposes and backtesting. Use it responsibly and in combination with other analysis techniques.
Always perform thorough backtesting and analysis before applying it to live trading.
Happy trading! 🚀
RSI 10 mã thể hiện 4 khung thời gian//@version=6
indicator("Multi-Timeframe RSI with Divergence Alerts in Table", overlay=true)
// Inputs
rsiLength = input.int(14, title="RSI Length")
source = input.source(close, title="Source")
// Inputs for custom symbols (10 pairs)
symbol1 = input.string("BTC/USDT", title="Symbol 1")
symbol2 = input.string("ETH/USDT", title="Symbol 2")
symbol3 = input.string("LTC/USDT", title="Symbol 3")
symbol4 = input.string("XRP/USDT", title="Symbol 4")
symbol5 = input.string("ADA/USDT", title="Symbol 5")
symbol6 = input.string("SOL/USDT", title="Symbol 6")
symbol7 = input.string("DOGE/USDT", title="Symbol 7")
symbol8 = input.string("MATIC/USDT", title="Symbol 8")
symbol9 = input.string("BNB/USDT", title="Symbol 9")
symbol10 = input.string("AVAX/USDT", title="Symbol 10")
// RSI Calculations for custom symbols
rsi(symbol, timeframe) =>
request.security(symbol, timeframe, ta.rsi(source, rsiLength))
// RSI Calculations for timeframes (H1, H4, D1, W) for the custom symbols
rsi1H1 = rsi(symbol1, "60")
rsi2H1 = rsi(symbol2, "60")
rsi3H1 = rsi(symbol3, "60")
rsi4H1 = rsi(symbol4, "60")
rsi5H1 = rsi(symbol5, "60")
rsi6H1 = rsi(symbol6, "60")
rsi7H1 = rsi(symbol7, "60")
rsi8H1 = rsi(symbol8, "60")
rsi9H1 = rsi(symbol9, "60")
rsi10H1 = rsi(symbol10, "60")
rsi1H4 = rsi(symbol1, "240")
rsi2H4 = rsi(symbol2, "240")
rsi3H4 = rsi(symbol3, "240")
rsi4H4 = rsi(symbol4, "240")
rsi5H4 = rsi(symbol5, "240")
rsi6H4 = rsi(symbol6, "240")
rsi7H4 = rsi(symbol7, "240")
rsi8H4 = rsi(symbol8, "240")
rsi9H4 = rsi(symbol9, "240")
rsi10H4 = rsi(symbol10, "240")
rsi1D1 = rsi(symbol1, "D")
rsi2D1 = rsi(symbol2, "D")
rsi3D1 = rsi(symbol3, "D")
rsi4D1 = rsi(symbol4, "D")
rsi5D1 = rsi(symbol5, "D")
rsi6D1 = rsi(symbol6, "D")
rsi7D1 = rsi(symbol7, "D")
rsi8D1 = rsi(symbol8, "D")
rsi9D1 = rsi(symbol9, "D")
rsi10D1 = rsi(symbol10, "D")
rsi1W = rsi(symbol1, "W")
rsi2W = rsi(symbol2, "W")
rsi3W = rsi(symbol3, "W")
rsi4W = rsi(symbol4, "W")
rsi5W = rsi(symbol5, "W")
rsi6W = rsi(symbol6, "W")
rsi7W = rsi(symbol7, "W")
rsi8W = rsi(symbol8, "W")
rsi9W = rsi(symbol9, "W")
rsi10W = rsi(symbol10, "W")
// Alert levels
upperLevel = 80
lowerLevel = 30
// Table creation (adjusted size to fit 10 symbols and 4 timeframes)
var table rsiTable = table.new(position.top_right, 15, 5, border_width=1) // Added 10 rows for symbols, and 4 columns for timeframes
// Functions for RSI status and color
fun_rsiStatus(rsiValue) =>
if (rsiValue > upperLevel)
"Overbought"
else if (rsiValue < lowerLevel)
"Oversold"
else
"Neutral"
fun_rsiColor(rsiValue) =>
if (rsiValue > upperLevel)
color.new(color.red, 0)
else if (rsiValue < lowerLevel)
color.new(color.green, 0)
else
color.new(color.gray, 50)
fun_textColor() =>
color.new(color.white, 0)
// Update Table headers
table.cell(rsiTable, 0, 0, "Symbol", text_color=fun_textColor(), bgcolor=color.new(color.gray, 70))
table.cell(rsiTable, 0, 1, "H1 RSI", text_color=fun_textColor(), bgcolor=color.new(color.gray, 70))
table.cell(rsiTable, 0, 2, "H4 RSI", text_color=fun_textColor(), bgcolor=color.new(color.gray, 70))
table.cell(rsiTable, 0, 3, "D1 RSI", text_color=fun_textColor(), bgcolor=color.new(color.gray, 70))
table.cell(rsiTable, 0, 4, "Weekly RSI", text_color=fun_textColor(), bgcolor=color.new(color.gray, 70))
// Display RSI for each symbol and timeframe
// Symbol 1
table.cell(rsiTable, 1, 0, symbol1, text_color=fun_textColor(), bgcolor=color.new(color.gray, 50))
table.cell(rsiTable, 1, 1, str.tostring(rsi1H1, "#.##"), text_color=color.new(color.white, 0), bgcolor=fun_rsiColor(rsi1H1))
table.cell(rsiTable, 1, 2, str.tostring(rsi1H4, "#.##"), text_color=color.new(color.white, 0), bgcolor=fun_rsiColor(rsi1H4))
table.cell(rsiTable, 1, 3, str.tostring(rsi1D1, "#.##"), text_color=color.new(color.white, 0), bgcolor=fun_rsiColor(rsi1D1))
table.cell(rsiTable, 1, 4, str.tostring(rsi1W, "#.##"), text_color=color.new(color.white, 0), bgcolor=fun_rsiColor(rsi1W))
// Symbol 2
table.cell(rsiTable, 2, 0, symbol2, text_color=fun_textColor(), bgcolor=color.new(color.gray, 50))
table.cell(rsiTable, 2, 1, str.tostring(rsi2H1, "#.##"), text_color=color.new(color.white, 0), bgcolor=fun_rsiColor(rsi2H1))
table.cell(rsiTable, 2, 2, str.tostring(rsi2H4, "#.##"), text_color=color.new(color.white, 0), bgcolor=fun_rsiColor(rsi2H4))
table.cell(rsiTable, 2, 3, str.tostring(rsi2D1, "#.##"), text_color=color.new(color.white, 0), bgcolor=fun_rsiColor(rsi2D1))
table.cell(rsiTable, 2, 4, str.tostring(rsi2W, "#.##"), text_color=color.new(color.white, 0), bgcolor=fun_rsiColor(rsi2W))
// Repeat for other symbols (3 to 10)...
// Symbol 3
table.cell(rsiTable, 3, 0, symbol3, text_color=fun_textColor(), bgcolor=color.new(color.gray, 50))
table.cell(rsiTable, 3, 1, str.tostring(rsi3H1, "#.##"), text_color=color.new(color.white, 0), bgcolor=fun_rsiColor(rsi3H1))
table.cell(rsiTable, 3, 2, str.tostring(rsi3H4, "#.##"), text_color=color.new(color.white, 0), bgcolor=fun_rsiColor(rsi3H4))
table.cell(rsiTable, 3, 3, str.tostring(rsi3D1, "#.##"), text_color=color.new(color.white, 0), bgcolor=fun_rsiColor(rsi3D1))
table.cell(rsiTable, 3, 4, str.tostring(rsi3W, "#.##"), text_color=color.new(color.white, 0), bgcolor=fun_rsiColor(rsi3W))
// Symbol 4
table.cell(rsiTable, 4, 0, symbol4, text_color=fun_textColor(), bgcolor=color.new(color.gray, 50))
table.cell(rsiTable, 4, 1, str.tostring(rsi4H1, "#.##"), text_color=color.new(color.white, 0), bgcolor=fun_rsiColor(rsi4H1))
table.cell(rsiTable, 4, 2, str.tostring(rsi4H4, "#.##"), text_color=color.new(color.white, 0), bgcolor=fun_rsiColor(rsi4H4))
table.cell(rsiTable, 4, 3, str.tostring(rsi4D1, "#.##"), text_color=color.new(color.white, 0), bgcolor=fun_rsiColor(rsi4D1))
table.cell(rsiTable, 4, 4, str.tostring(rsi4W, "#.##"), text_color=color.new(color.white, 0), bgcolor=fun_rsiColor(rsi4W))
// Symbol 5
table.cell(rsiTable, 5, 0, symbol5, text_color=fun_textColor(), bgcolor=color.new(color.gray, 50))
table.cell(rsiTable, 5, 1, str.tostring(rsi5H1, "#.##"), text_color=color.new(color.white, 0), bgcolor=fun_rsiColor(rsi5H1))
table.cell(rsiTable, 5, 2, str.tostring(rsi5H4, "#.##"), text_color=color.new(color.white, 0), bgcolor=fun_rsiColor(rsi5H4))
table.cell(rsiTable, 5, 3, str.tostring(rsi5D1, "#.##"), text_color=color.new(color.white, 0), bgcolor=fun_rsiColor(rsi5D1))
table.cell(rsiTable, 5, 4, str.tostring(rsi5W, "#.##"), text_color=color.new(color.white, 0), bgcolor=fun_rsiColor(rsi5W))
// Symbol 6
table.cell(rsiTable, 6, 0, symbol6, text_color=fun_textColor(), bgcolor=color.new(color.gray, 50))
table.cell(rsiTable, 6, 1, str.tostring(rsi6H1, "#.##"), text_color=color.new(color.white, 0), bgcolor=fun_rsiColor(rsi6H1))
table.cell(rsiTable, 6, 2, str.tostring(rsi6H4, "#.##"), text_color=color.new(color.white, 0), bgcolor=fun_rsiColor(rsi6H4))
table.cell(rsiTable, 6, 3, str.tostring(rsi6D1, "#.##"), text_color=color.new(color.white, 0), bgcolor=fun_rsiColor(rsi6D1))
table.cell(rsiTable, 6, 4, str.tostring(rsi6W, "#.##"), text_color=color.new(color.white, 0), bgcolor=fun_rsiColor(rsi6W))
// Symbol 7
table.cell(rsiTable, 7, 0, symbol7, text_color=fun_textColor(), bgcolor=color.new(color.gray, 50))
table.cell(rsiTable, 7, 1, str.tostring(rsi7H1, "#.##"), text_color=color.new(color.white, 0), bgcolor=fun_rsiColor(rsi7H1))
table.cell(rsiTable, 7, 2, str.tostring(rsi7H4, "#.##"), text_color=color.new(color.white, 0), bgcolor=fun_rsiColor(rsi7H4))
table.cell(rsiTable, 7, 3, str.tostring(rsi7D1, "#.##"), text_color=color.new(color.white, 0), bgcolor=fun_rsiColor(rsi7D1))
table.cell(rsiTable, 7, 4, str.tostring(rsi7W, "#.##"), text_color=color.new(color.white, 0), bgcolor=fun_rsiColor(rsi7W))
// Symbol 8
table.cell(rsiTable, 8, 0, symbol8, text_color=fun_textColor(), bgcolor=color.new(color.gray, 50))
table.cell(rsiTable, 8, 1, str.tostring(rsi8H1, "#.##"), text_color=color.new(color.white, 0), bgcolor=fun_rsiColor(rsi8H1))
table.cell(rsiTable, 8, 2, str.tostring(rsi8H4, "#.##"), text_color=color.new(color.white, 0), bgcolor=fun_rsiColor(rsi8H4))
table.cell(rsiTable, 8, 3, str.tostring(rsi8D1, "#.##"), text_color=color.new(color.white, 0), bgcolor=fun_rsiColor(rsi8D1))
table.cell(rsiTable, 8, 4, str.tostring(rsi8W, "#.##"), text_color=color.new(color.white, 0), bgcolor=fun_rsiColor(rsi8W))
// Symbol 9
table.cell(rsiTable, 9, 0, symbol9, text_color=fun_textColor(), bgcolor=color.new(color.gray, 50))
table.cell(rsiTable, 9, 1, str.tostring(rsi9H1, "#.##"), text_color=color.new(color.white, 0), bgcolor=fun_rsiColor(rsi9H1))
table.cell(rsiTable, 9, 2, str.tostring(rsi9H4, "#.##"), text_color=color.new(color.white, 0), bgcolor=fun_rsiColor(rsi9H4))
table.cell(rsiTable, 9, 3, str.tostring(rsi9D1, "#.##"), text_color=color.new(color.white, 0), bgcolor=fun_rsiColor(rsi9D1))
table.cell(rsiTable, 9, 4, str.tostring(rsi9W, "#.##"), text_color=color.new(color.white, 0), bgcolor=fun_rsiColor(rsi9W))
// Symbol 10
table.cell(rsiTable, 10, 0, symbol10, text_color=fun_textColor(), bgcolor=color.new(color.gray, 50))
table.cell(rsiTable, 10, 1, str.tostring(rsi10H1, "#.##"), text_color=color.new(color.white, 0), bgcolor=fun_rsiColor(rsi10H1))
table.cell(rsiTable, 10, 2, str.tostring(rsi10H4, "#.##"), text_color=color.new(color.white, 0), bgcolor=fun_rsiColor(rsi10H4))
table.cell(rsiTable, 10, 3, str.tostring(rsi10D1, "#.##"), text_color=color.new(color.white, 0), bgcolor=fun_rsiColor(rsi10D1))
table.cell(rsiTable, 10, 4, str.tostring(rsi10W, "#.##"), text_color=color.new(color.white, 0), bgcolor=fun_rsiColor(rsi10W))