Session Bar/Candle ColoringChange the color of candles within a user-defined trading session. Borders and wicks can be changed as well, not just the body color.
PREFACE
This script can be used an educational resource for those who are interested in learning Pine Script. Therefore, the script is published open source and is organized in a manner that follows the recommended Style Guide .
While the main premise of the indicator is rather simple, the script showcases various things that can be achieved such as conditional plotting, alignment of indicator settings, user input validation, script optimization, and more. The script also has examples of taking into consideration the chart timeframe and/or different chart types (Heikin Ashi, Renko, etc.) that a user might be running it on. Note: for complete beginners, I strongly suggest going through the Pine Script User Manual (possibly more than once).
FEATURES
Besides being able to select a specific time window, the indicator also provides additional color settings for changing the background color or changing the colors of neutral/indecisive candles, as shown in the image below.
This allows for a higher level of customization beyond the TradingView chart settings or other similar scripts that are currently available.
HOW TO USE
First, define the intraday trading session that will contain the candles to modify. The session can be limited to specific days of the week.
Next, select the parts of the candles that should be modified: Body, Borders, Wick, and/or Background.
For each of the candle parts that were enabled, you can select the colors that will be used depending on whether a candle is bullish (⇧), bearish (⇩), or neutral (⇆).
All other indicator settings will have a detailed tooltip to describe its usage and/or effect.
LIMITATIONS
The indicator is not intended to function on Daily or higher timeframes due to the intraday nature of session time windows.
The indicator cannot always automatically detect the chart type being used, therefore the user is requested to manually input the chart type via the " Chart Style " setting.
Depending on the available historical data and the selected choice for the " Portion of bar in session " setting, the indicator may not be able to update very old candles on the chart.
EXAMPLE USAGE
This section will show examples of different scenarios that the indicator can be used for.
Emphasizing a main trading session.
Defining a "Pre/post market hours background" like is available for some symbols (e.g., NASDAQ:AAPL ).
Highlighting in which bar the midnight candle occurs.
Hiding indecision bars (neutral candles).
Showing only "Regular Trading Hours" for a chart that does not have the option to toggle ETH/RTH. To achieve this, the actual chart data is hidden, and only the indicator is visible; alternatively, a 2nd instance of the indicator could change colors to match the chart background.
Using a combination of Bars and Japanese Candlesticks. Alternatively, this could be done by hiding the main chart data and using 2 instances of the indicator (one with " Chart Style " setting as Bars , and the other set to Candles ).
Using a combination of thin and thick bars on Range charts. Note: requires disabling the "Thin Bars" setting for Bar charts in the TradingView chart settings.
NOTES
If using more than one instance of this indicator on the same chart, you can use the TradingView "Save Indicator Template" feature to avoid having to re-configure the multiple indicators at a later time.
This indicator is intended to work "out-of-the-box" thanks to the behind_chart option introduced to Pine Script in October 2024. But you can always manually bring the indicator to the front just in case the color changes are not being seen (using the "More" option in the indicator status line: More > Visual Order > Bring to front ).
Many thanks to fikira for their help and inspiring me to create open source scripts.
Any feedback including bug reports or suggestions for improving the indicator (or source code itself) are always welcome in the comments section.
Services Pine
Variações Diárias no Mini ÍndiceFiz esse script de variações baseado no valor do ajuste diário. Criei especificamente para ser usado no mini índice, se desejar usar em outro ativo, terás que modificar o código.
As variações vão de 0,5% até 1,5%, pois eu acredito que como um big player do mercado brasileiro faz operações que duram dias, semanas ou até meses em certos casos, eles vão estar muito mais interessados em saber se já subiu ou caiu 0,5% da operação dele .
Essas variações me mostram regiões em que esses players podem pesar no gráfico, sempre a favor das operações deles. É um bom parâmetro para ver se já subiu demais ou caiu demais.
Um beijo e um queijo e até depois.
Parabolic SAR y ADX Strategy//@version=6
indicator("Parabolic SAR y ADX Strategy", overlay=true)
// Parámetros del Parabolic SAR
psar_start = input.float(0.02, title="PSAR Factor Inicial", step=0.01)
psar_increment = input.float(0.02, title="PSAR Incremento", step=0.01)
psar_max = input.float(0.2, title="PSAR Máximo", step=0.01)
// Parámetros del ADX
adx_length = input.int(14, title="Período ADX")
adx_smoothing = input.int(14, title="Suavización ADX", minval=1)
adx_threshold = input.float(20, title="Nivel de referencia ADX", step=1)
// Cálculo del Parabolic SAR
psar = ta.sar(psar_start, psar_increment, psar_max)
// Cálculo del ADX y direcciones (+DI y -DI)
= ta.dmi(adx_length, adxSmoothing=adx_smoothing)
// Condiciones de Compra y Venta
long_condition = (adx > adx_threshold) and (close > psar)
short_condition = (adx > adx_threshold) and (close < psar)
// Dibujar señales en el gráfico
plotshape(series=long_condition, title="Compra", location=location.belowbar, color=color.green, style=shape.labelup, text="BUY")
plotshape(series=short_condition, title="Venta", location=location.abovebar, color=color.red, style=shape.labeldown, text="SELL")
// Mostrar PSAR en el gráfico
plot(psar, color=color.blue, title="Parabolic SAR")
Multi Médias Móveis EMAS's 12,26, 50, 100, 200 e MA 200 Multi Medias para realizar as analise grafica e tendencias do mercado, com utilização de stup ára entrada no trader, considerando a analise nos tempo graficos principais de 4h, 1D, 1W.
O setup consiste em rompimendo das médias moveis para oportunidade de trader
AdibXmos// © AdibXmos
//@version=5
indicator('Sood Indicator V2 ', 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')
Elf Trade Academy- Multipl. SMA Trend and ATRELF TRADE ACADEMY YOUTUBE VE TELEGRAM SAYFASI İÇİN BASİT GÖSTERGELER SERİSİ AMACIYLA KODLANMIŞTIR
İçindekiler
-Seçtiğiniz iki hareketli ortalama değerine göre tablo haline zaman dilimleri ayrılmış halde up trend/down trend belirteçleri
-Farklı zaman dilimlerinde ki atr değerleri tablosu.
6 Band Parametric EQThis indicator implements a complete parametric equalizer on any data source using high-pass and low-pass filters, high and low shelving filters, and six fully configurable bell filters. Each filter stage features standard audio DSP controls including frequency, Q factor, and gain where applicable. While parametric EQ is typically used for audio processing, this implementation raises questions about the nature of filtering in technical analysis. Why stop at simple moving averages when you can shape your signal's frequency response with surgical precision? The answer may reveal more about our assumptions than our indicators.
Filter Types and Parameters
High-Pass Filter:
A high-pass filter attenuates frequency components below its cutoff frequency while passing higher frequencies. The Q parameter controls resonance at the cutoff point, with higher values creating more pronounced peaks.
Low-Pass Filter:
The low-pass filter does the opposite - it attenuates frequencies above the cutoff while passing lower frequencies. Like the high-pass, its Q parameter affects the resonance at the cutoff frequency.
High/Low Shelf Filters:
Shelf filters boost or cut all frequencies above (high shelf) or below (low shelf) the target frequency. The slope parameter determines the steepness of the transition around the target frequency , with a value of 1.0 creating a gentle slope and lower values making the transition more abrupt. The gain parameter sets the amount of boost or cut in decibels.
Bell Filters:
Bell (or peaking) filters create a boost or cut centered around a specific frequency. A bell filter's frequency parameter determines the center point of the effect, while Q controls the width of the affected frequency range - higher Q values create a narrower bandwidth. The gain parameter defines the amount of boost or cut in decibels.
All filters run in series, processing the signal in this order: high-pass → low shelf → bell filters → high shelf → low-pass. Each stage can be independently enabled or bypassed.
The frequency parameter for all filters represents the period length of the targeted frequency component. Lower values target higher frequencies and vice versa. All gain values are in decibels, where positive values boost and negative values cut.
The 6-Band Parametric EQ combines these filters into a comprehensive frequency shaping tool. Just as audio engineers use parametric EQs to sculpt sound, this indicator lets you shape market data's frequency components with surgical precision. But beyond its technical implementation, this indicator serves as a thought experiment about the nature of filtering in technical analysis. While traditional indicators often rely on simple moving averages or single-frequency filters, the parametric EQ takes this concept to its logical extreme - offering complete control over the frequency domain of price action. Whether this level of filtering precision is useful for analysis is perhaps less important than what it reveals about our assumptions regarding market data and its frequency components.
Fibonacci Retracement MTF/LOGIn Pine Script, there’s always a shorter way to achieve a result. As far as I can see, there isn’t an indicator among the community scripts that can produce Fibonacci Retracement levels (linear and logarithmic) as multiple time frame results based on a reference 🍺 This script, which I developed a long time ago, might serve as a starting point to fill this gap.
OVERVIEW
This indicator is a short and simple script designed to display Fibonacci Retracement levels on the chart according to user preferences, aiming to build the structure of support and resistance.
ORIGINALITY
This script:
Can calculate 'retracement' results from higher time frames.
Can recall previous time frame results using its reference parameter.
Performs calculations based on both linear and logarithmic scales.
Offers optional multipliers and appearance settings to simplify users’ tasks
CONCEPTS
Fibonacci Retracement is a technical analysis tool used to predict potential reversal points in an asset's price after a significant movement. This indicator identifies possible support and resistance levels by measuring price movements between specific points in a trend, using certain ratios derived from the Fibonacci sequence. It is based on impulsive price actions.
MECHANICS
This indicator first identifies the highest and lowest prices in the time frame specified by the user. Next, it determines the priority order of the bars where these prices occurred. Finally, it defines the trend direction. Once the trend direction is determined, the "Retracement" levels are constructed.
FUNCTIONS
The script contains two functions:
f_ret(): Generates levels based on the multiplier parameter.
f_print(): Handles the visualization by drawing the levels on the chart and positioning the labels in alignment with the levels. It utilizes parameters such as ordinate, confirmation, multiplier, and color for customization
NOTES
The starting bar for the time frame entered by the user must exist on the chart. Otherwise, the trend direction cannot be determined correctly, and the levels may be drawn inaccurately. This is also mentioned in the tooltip of the TimeFrame parameter.
I hope it helps everyone. Do not forget to manage your risk. And trade as safely as possible. Best of luck!
Moda MóvilEl indicador Moda Móvil calcula y muestra en el gráfico la moda (el valor más frecuente) de los precios de cierre de las últimas N barras (configurables). A diferencia de las medias móviles tradicionales, que pueden ser distorsionadas por valores extremos, la Moda Móvil proporciona una representación más precisa del comportamiento del precio al reflejar los valores más comunes.
Este enfoque se basa en el concepto de "Modas Móviles" propuesto por Pedro L. Asensio, quien destaca que las medias móviles tradicionales pueden ser engañosas debido a su sensibilidad a los extremos. La moda, en cambio, ofrece una alternativa más realista y ajustada a la realidad del mercado, sin verse afectada por datos atípicos.
зохламарапролдлорпавапролдждлорипмасвчапролдждлорпавывапролдждлорпасвчвапролдждлорпмсчячспролдлорпавапролдзжхздлорпавапролджздлорпа
Ichimoku + RSI + MACD Strategyیک اندیکاتور ترکیب ارس ای و مکدی و ایچو با سیگنال ورود نوشته شده با هوش مصنوعی
MTF Supertrend and RSI momentum Trendmultiple super trend combine with RSI direction for confirmation
combined MTF Supertrend and RSI Momentum Trend from Tzack88
Thanks and credit to original developers
Bitcoin vs Mag7 Combined IndexThis Mag7 Combined Index script is a custom TradingView indicator that calculates and visualizes the collective performance of the Magnificent 7 (Mag7) stocks—Apple, Microsoft, Alphabet, Amazon, NVIDIA, Tesla, and Meta (red line) compared to Bitcoin (blue line). It normalizes the daily closing prices of each stock to their initial value on the chart, scales them into percentages, and then computes their simple average to form a combined index. The result is plotted as a single line, offering a clear view of the aggregated performance of these influential stocks over time compared to Bitcoin.
This indicator is ideal for analyzing the overall market impact of the Mag7 compared to Bitcoin.
Dynamic Price level ArayPrice lines will move with the chart. Enter the different levels you want to watch. Once entered there is no need to move them. Very useful to have your levels moving on any time frame.
Solid Background for Current CandleWhat Does This Script Do?
Background Reflects Current Candle:
The entire chart background changes to green if the current candle is bullish (close > open).
It changes to red if the current candle is bearish (close < open).
Solid Background Without Per-Candle Behavior:
The background doesn't depend on individual candle colors. It applies one unified color for the entire chart based on the current candle's direction.
Uses a Box to Cover the Chart:
Instead of using bgcolor (which applies per candle), this script creates a large invisible rectangle (box) that spans the entire chart area.
The box dynamically updates its color with each new candle.
Swing Points AlertSwing Points Alert with Adjustable Delay
Description:
This script is designed to detect and alert traders about significant swing highs and lows on the chart. The script is equipped with customizable pivot detection settings and an innovative **Alert Delay** mechanism, allowing users to fine-tune their notifications to reduce noise and focus on key price movements.
Key Features:
1. **Swing High/Low Detection:**
- Identifies swing highs and lows based on user-defined pivot length.
- Visualizes these points with customizable labels for clarity.
2. **Customizable Alerts:**
- Enables real-time alerts for swing highs and lows.
- Users can adjust the delay for alerts to avoid false signals during volatile periods.
3. **Dynamic Label Management:**
- Automatically manages the number of displayed swing point labels.
- Removes crossed or outdated labels based on user preferences.
4. **Flexible Label Styling:**
- Provides multiple label styles (e.g., triangles, circles, arrows) and color customization for both swing highs and lows.
How the Alert Delay Works:
The **Alert Delay** helps filter signals by introducing a delay before triggering alerts. The delay is calculated as follows:
**Alert Delay (%) x Time Frame = Alert Delay in Time Frame Units**
For example:
- If the **Alert Delay** is set to 30% and the timeframe is **15 minutes**, the alert will be triggered after a delay of:
\
This ensures the alert is triggered only if the swing high/low condition remains valid for at least 4.5 minutes.
Important Notes:
1. **Timeframe Sensitivity:**
- This script is optimized for use across various timeframes, but users must adjust the **Alert Delay** percentage to match their trading style and timeframe.
- For example, higher timeframes may require lower delay percentages for timely alerts.
2. **Customization Options:**
- Easily customize pivot detection length, alert delay, label styles, and colors to suit your preferences.
3. **Support:**
- If you encounter any challenges or need help optimizing the script for your specific trading scenario, feel free to reach out for assistance.
Working HoursWorking Hours Visualization
Description:
This script is designed to visually highlight specific "Working Hours" sessions on the chart using background colors. It is tailored and optimized for the 15-minute timeframe, ensuring accurate session representation and proper functionality. If you choose to use this script on other timeframes, adjustments may be necessary to maintain its effectiveness.
Key Features:
Working Hours Highlighting: Displays background colors to mark predefined working hours, helping you focus on specific trading sessions.
Future Session Projection: Highlights working hours for future candles, providing a clear visual guide for planning trades.
Customizable Appearance: Offers adjustable colors, transparency, and session timings to suit individual preferences.
Weekly Separators: Includes optional weekly separators to visually distinguish trading weeks.
Important Notes:
Timeframe Compatibility:
This script is optimized for the 15-minute timeframe.
Using it on other timeframes may require optimization of session inputs and related logic.
Please feel free to reach out if you need assistance with adjustments for different timeframes.
Customization:
You can customize session timings, colors, and transparency levels through the input settings.
Support:
If you encounter any issues or need help optimizing the script for your specific needs, don't hesitate to contact me.
MAG 7 - Weighted Multi-Symbol Momentum + ExtrasOverview
This indicator aggregates the percentage change of multiple symbols into a single “weighted momentum” value. You can set individual weights to emphasize or de-emphasize particular stocks. The script plots two key items:
The default tickers in the script are:
AAPL (Apple)
AMZN (Amazon)
NVDA (NVIDIA)
MSFT (Microsoft)
GOOGL (Alphabet/Google)
TSLA (Tesla)
META (Meta Platforms/Facebook)
Raw Weighted Momentum (Histogram):
Each bar represents the combined (weighted) percentage change across your chosen symbols for that bar.
Bars are colored green if the momentum is above zero, or red if below zero.
Smoothed Momentum (Yellow Line):
An Exponential Moving Average (EMA) of the raw momentum for a smoother trend view.
Helps visualize when short-term momentum is accelerating or decelerating relative to its average.
Features
Symbol Inputs: Up to seven user-defined tickers, with weights for each symbol.
Smoothing Period: Set a custom lookback length to calculate the EMA (or switch to SMA in the code if you prefer).
Table Display: A built-in table in the top-right corner lists each symbol’s real-time percentage change, plus the total weighted momentum.
Alerts:
Configure alerts for when the weighted momentum crosses above or below user-defined thresholds.
Helps you catch major shifts in sentiment across multiple symbols.
How To Use
Select Symbols & Weights: In the indicator’s settings, specify the tickers you want to monitor and their corresponding weights. Weights default to 1 (equal weighting).
Watch the Bars vs. Zero:
Bars above zero mean a positive weighted momentum (the basket is collectively moving up).
Bars below zero mean negative weighted momentum (the basket is collectively under pressure).
Check the Yellow Line: The EMA of momentum.
If the bars consistently stay above the line, short-term momentum is stronger than its recent average.
If the bars dip below the line, momentum is weakening relative to its average.
Review the Table: Quick snapshot of each symbol’s daily percentage change plus the total basket momentum, all color-coded red or green.
Caution & Tips
This indicator measures rate of change, not absolute price levels. A rising momentum can still be part of a larger downtrend.
Always combine momentum readings with other technical and/or fundamental signals for confirmation.
For better reliability, experiment with different smoothing lengths to suit your trading style (shorter for scalping, longer for swing or positional approaches).
Data TransformerIt is a data transformer. Is something TradingView lacks right now.
It is simple, it lets you transform the symbol of the chart into this options:
% change
change
QoQ change
QoQ change %
YoY change
YoY change %
Drawdawn %
Drawdawn
Cumulative
4ma 20日線角度マイナス銘柄抽出①移動平均線を計算する
②移動平均線の角度を求める
③角度がマイナスになった銘柄を検出し、アラートを出す
④4MAと20MA(20日移動平均)をチャート上にプロット