ATR Stop-Loss with Fibonacci Take-Profit [jpkxyz]ATR Stop-Loss with Fibonacci Take-Profit Indicator
This comprehensive indicator combines Average True Range (ATR) volatility analysis with Fibonacci extensions to create dynamic stop-loss and take-profit levels. It's designed to help traders set precise risk management levels and profit targets based on market volatility and mathematical ratios.
Two Operating Modes
Default Mode (Rolling Levels)
In default mode, the indicator continuously plots evolving stop-loss and take-profit levels based on real-time price action. These levels update dynamically as new bars form, creating rolling horizontal lines across the chart. I use this mode primarily to plot the rolling ATR-Level which I use to trail my Stop-Loss into profit.
Characteristics:
Levels recalculate with each new bar
All selected Fibonacci levels display simultaneously
Uses plot() functions with trackprice=true for price tracking
Custom Anchor Mode (Fixed Levels)
This is the primary mode for precision trading. You select a specific timestamp (typically your entry bar), and the indicator locks all calculations to that exact moment, creating fixed horizontal lines that represent your actual trade levels.
Characteristics:
Entry line (blue) marks your anchor point
Stop-loss calculated using ATR from the anchor bar
Fibonacci levels projected from entry-to-stop distance
Lines terminate when price breaks through them
Includes comprehensive alert system
Core Calculation Logic
ATR Stop-Loss Calculation:
Stop Loss = Entry Price ± (ATR × Multiplier)
Long positions: SL = Entry - (ATR × Multiplier)
Short positions: SL = Entry + (ATR × Multiplier)
ATR uses your chosen smoothing method (RMA, SMA, EMA, or WMA)
Default multiplier is 1.5, adjustable to your risk tolerance
Fibonacci Take-Profit Projection:
The distance from entry to stop-loss becomes the base unit (1.0) for Fibonacci extensions:
TP Level = Entry + (Entry-to-SL Distance × Fibonacci Ratio)
Available Fibonacci Levels:
Conservative: 0.618, 1.0, 1.618
Extended: 2.618, 3.618, 4.618
Complete range: 0.0 to 4.764 (23 levels total)
Multi-Timeframe Functionality
One of the indicator's most powerful features is timeframe flexibility. You can analyze on one timeframe while using stop-loss and take-profit calculations from another.
Best Practices:
Identify your entry point on execution timeframe
Enable "Custom Anchor" mode
Set anchor timestamp to your entry bar
Select appropriate analysis timeframe
Choose relevant Fibonacci levels
Enable alerts for automated notifications
Example Scenario:
Analyse trend on 4-hour chart
Execute entry on 5-minute chart for precision
Set custom anchor to your 5-minute entry bar
Configure timeframe setting to "4h" for swing-level targets
Select appropriate Fibonacci Extension levels
Result: Precise entry with larger timeframe risk management
Visual Intelligence System
Line Behaviour in Custom Anchor Mode:
Active levels: Lines extend to the right edge
Hit levels: Lines terminate at the breaking bar
Entry line: Always visible in blue
Stop-loss: Red line, terminates when hit
Take-profits: Green lines (1.618 level in gold for emphasis)
Customisation Options:
Line width (1-4 pixels)
Show/hide individual Fibonacci levels
ATR length and smoothing method
ATR multiplier for stop-loss distance
Penunjuk dan strategi
Post-Market Session AnalyzerThis script visually analyzes U.S. post-market trading hours (4:00 PM to 8:00 PM EST) by:
a) Highlighting post-market session background
b) Coloring candles based on price direction
c) Marking the final post-market candle with a trend label
Great for:
1) Traders who monitor after-hours price movement
2) Spotting late-day reversals or sentiment shifts
3) Understanding extended trading activity
Wave 2 Flat Detection - B Breaks A High, C Breaks A Low//@version=5
indicator("Wave 2 Flat Detection - B Breaks A High, C Breaks A Low", overlay=true)
// === Parameters ===
wave1_len = 10 // length of wave 1
a_len = 5 // candles to look for Wave A
b_len = 3 // candles to look for Wave B
c_len = 3 // candles to look for Wave C
// === Detect Wave 1 (upward impulse) ===
wave1_start = low
wave1_end = high
wave1_valid = wave1_end > wave1_start * 1.05 // 5% move up
// === Wave A ===
a_start = high // assumed wave 1 top
a_end = low // correction low (Wave A end)
wave_a_valid = a_end < a_start
// === Wave B ===
b_high = high
wave_b_valid = b_high > a_start // B breaks above A's high
// === Wave C ===
c_low = low
wave_c_break = c_low < a_end // C breaks below A's low
// === Final Condition ===
flat_pattern_confirmed = wave1_valid and wave_a_valid and wave_b_valid and wave_c_break
// === Plot + Alert ===
plotshape(flat_pattern_confirmed, title="Flat Wave 2 Detected", location=location.belowbar, color=color.red, style=shape.labelup, text="C↓")
alertcondition(flat_pattern_confirmed, title="Wave C Breaks Below A", message="Wave C broke below Wave A low — Flat correction confirmed, watch for Wave 3")
AI Score Indicator//@version=5
indicator("AI Score Indicator", overlay=true)
// Eingaben
length = input.int(14, title="RSI Length")
smaLength = input.int(50, title="SMA Length")
bbLength = input.int(20, title="Bollinger Band Length")
stdDev = input.float(2.0, title="Standard Deviation")
// Indikatoren
rsi = ta.rsi(close, length)
sma = ta.sma(close, smaLength)
= ta.bb(close, bbLength, stdDev)
// Scoring (simuliert ein KI-System mit gewichteten Bedingungen)
score = 0
score := rsi < 30 ? score + 1 : score
score := close < sma ? score + 1 : score
score := close < bb_lower ? score + 1 : score
score := ta.crossover(close, sma) ? score + 1 : score
// Buy-/Sell-Signale auf Basis des Scores
buySignal = score >= 3
sellSignal = rsi > 70 and close > sma
// Signale anzeigen
plotshape(buySignal, title="Buy", location=location.belowbar, color=color.green, style=shape.labelup, text="BUY")
plotshape(sellSignal, title="Sell", location=location.abovebar, color=color.red, style=shape.labeldown, text="SELL")
// Score visualisieren (debugging)
plot(score, title="AI Score", color=color.orange)
Heiken Ashi Candles - CustomizableHeiken Ashi Candles – Customizable Overlay
This TradingView indicator displays accurate Heiken Ashi candles directly on your price chart, perfectly synced with TradingView’s built-in Heiken Ashi source. It’s ideal for traders who want to backtest or analyze Heiken Ashi structure without switching chart types. The indicator also includes full customization of candle body and wick colors for both bullish and bearish candles—perfect for tailoring your chart visuals to your preferences.
SMA Crossing Background Color (Multi-Timeframe)When day trading or scalping on lower timeframes, it’s often difficult to determine whether the broader market trend is moving upward or downward. To address this, I usually check higher timeframes. However, splitting the layout makes the charts too small and hard to read.
To solve this issue, I created an indicator that uses the background color to show whether the current price is above or below a moving average from a higher timeframe.
For example, if you set the SMA Length to 200 and the MT Timeframe to 5 minutes, the indicator will display a red background on the 1-minute chart when the price drops below the 200 SMA on the 5-minute chart. This helps you quickly recognize that the trend on the higher timeframe has turned bearish—without having to open a separate chart.
デイトレード、スキャルピングで短いタイムフレームでトレードをするときに、大きな動きは上に向いているのか下に向いているのかトレンドがわからなくなることがあります。
その時に上位足を確認するのですが、レイアウトをスプリットすると画面が小さくて見えにくくなるので、バックグラウンドの色で上位足の移動平均線では価格が上なのか下なのかを表示させるインジケーターを作りました。
例えば、SMA Length で200を選び、MT Timeframeで5分を選べば、1分足タイムフレームでトレードしていて雲行きが怪しくなってくるとBGが赤になり、5分足では200線以下に突入しているようだと把握することができます。
Dynamic ATR Label//@version=5
indicator("Dynamic ATR Label", overlay=true)
// User definable ATR parameters
atrLength = input.int(14, "ATR Length", minval=1)
priceSource = input.source(close, "Price Source")
// Calculate ATR
atrValue = ta.atr(atrLength)
// Calculate ATR in percentage
atrPercent = (atrValue / priceSource) * 100
// Format the ATR percentage for display
atrText = "ATR: " + str.tostring(atrPercent, "#.##") + "%"
// Create or update the label
var label atrLabel = na
if na(atrLabel)
// Create the label on the first bar
atrLabel := label.new(x=bar_index, y=high, text=atrText,
xloc=xloc.bar_index, yloc=yloc.price, // Define how x and y are interpreted
style=label.style_label_down, color=color.blue,
textcolor=color.white, size=size.normal)
else
// Update the label's position and text on subsequent bars
label.set_xy(atrLabel, x=bar_index, y=high) // Only update x and y coordinates
label.set_text(atrLabel, atrText)
Spot Nachkauf-Zonen High TF (RSI + BB)**Spot Buy/Sell Zones High TF Indicator (RSI + Bollinger Bands + Trend & Volume Filters)**
This is an overlay indicator for TradingView that highlights optimal buy and sell areas on a higher timeframe (e.g. Daily, Weekly) while you view a lower timeframe chart. It combines volatility, momentum, trend and volume checks to reduce false signals.
---
### Key Features
* **Higher-Timeframe Calculations**
All indicators (Bollinger Bands, RSI, moving averages, volume) use data from a user-selected timeframe (for example “D” for daily or “W” for weekly).
* **Bollinger Bands**
* Middle line: Simple Moving Average (SMA) over N periods
* Upper/Lower bands: ±M × standard deviation
* Semi-transparent fill between the bands for quick visual reference
* **RSI Momentum**
* Classic 14-period RSI with adjustable overbought (e.g. 70) and oversold (e.g. 30) levels
* **Buy** when RSI crosses up out of oversold and price touches or goes below the lower Bollinger Band
* **Sell** when RSI crosses down out of overbought and price touches or goes above the upper Bollinger Band
* **Trend Filter (Optional)**
* Higher-TF SMA (default 200 periods) plotted in orange
* Signals only fire when price is above the SMA (for buys) or below (for sells) to align with the main trend
* **Volume Filter (Optional)**
* Compares current higher-TF volume against its SMA
* Signals require volume to exceed a user-set multiplier of average volume, ensuring real market participation
* **Visual Signals**
* Green triangles below bars mark buy zones; red triangles above bars mark sell zones
* Light green background highlights active buy areas
* **Built-In Alerts**
* Two alert conditions (“Buy Signal” and “Sell Signal”) ready to be used in TradingView’s Alert dialog
* Customizable alert messages include ticker and timeframe
---
### Inputs
| Setting | Default | Purpose |
| ------------------------- | ------- | ------------------------------------------------ |
| **Calculation Timeframe** | D | Higher timeframe for all calculations |
| **BB Periods** | 20 | Length of SMA for Bollinger middle line |
| **BB Std-Dev Multiplier** | 2.0 | Number of standard deviations for the bands |
| **RSI Periods** | 14 | Length of the RSI calculation |
| **Overbought / Oversold** | 70 / 30 | RSI thresholds for signal generation |
| **Enable Trend Filter** | true | Use higher-TF SMA to confirm trend direction |
| **Trend MA Periods** | 200 | SMA length for the trend filter |
| **Enable Volume Filter** | true | Require above-average volume to validate signals |
| **Volume MA Periods** | 20 | SMA length for volume filter |
| **Volume Multiplier** | 1.2 | How many times above average volume is needed |
---
### How to Use
1. **Add the Script**: Paste the Pine code into TradingView’s Pine Editor and save.
2. **Adjust Settings**: Choose your higher timeframe (“D”, “W”, etc.) and tweak BB, RSI, trend, and volume parameters.
3. **Activate Alerts**: In the Alerts panel, select the “Buy Signal” or “Sell Signal” alert condition.
4. **Interpret Signals**:
* A green triangle + green background = suggested buy zone
* A red triangle = suggested sell zone
This setup gives you clear, rule-based entry and exit areas by filtering noise and confirming market strength on a higher timeframe.
Polynomial Regression + RSI Explosive Zones// Sonic R
EMA_len = input.int(89, title="EMA Signal Length")
HiLoLen = input.int(34, title="PAC EMA Length")
// Polynomial Regression
regression_length = input.int(10, title="Regression Length")
fractal_size = input.int(2, title="Fractal Size")
// Color inputs for regression
colorMid = input.color(color.red, title="Mid Line Color")
colorMax = input.color(color.orange, title="Max Line Color")
colorMin = input.color(color.green, title="Min Line Color")
colorUpper = input.color(color.blue, title="Upper Line Color")
colorLower = input.color(color.purple, title="Lower Line Color")
// === SONIC R ===
// PAC lines
pacC = ta.ema(close, HiLoLen)
pacL = ta.ema(low, HiLoLen)
pacH = ta.ema(high, HiLoLen)
plot(pacL, title="PAC Low EMA", color=color.new(color.blue, 50))
plot(pacH, title="PAC High EMA", color=color.new(color.blue, 50))
plot(pacC, title="PAC Close EMA", color=color.new(color.blue, 0), linewidth=2)
fill(plot(pacL), plot(pacH), color=color.aqua, transp=90, title="Fill PAC")
// EMA lines
ema610 = ta.ema(close, 610)
ema200 = ta.ema(close, 200)
emaSignal = ta.ema(close, EMA_len)
plot(ema610, title="EMA 610", color=color.white)
plot(ema200, title="EMA 200", color=color.fuchsia)
plot(emaSignal, title="EMA Signal", color=color.orange, linewidth=2)
Volatility Flow X – MACD + Ichimoku Hybrid Trail🌥️ Volatility Flow X – Hybrid Ichimoku Cloud Explained
This strategy combines Ichimoku’s cloud structure with real-time price position.
Unlike standard Ichimoku coloring, the cloud here reflects both trend direction and price behavior.
🔍 What the Cloud Colors Mean
🟢 Green Cloud
Senkou A > Senkou B
Price is above the cloud
→ Indicates strong uptrend; suitable for long entries
🔴 Red Cloud
Senkou A < Senkou B
Price is below the cloud
→ Indicates strong downtrend; suitable for short entries
⚪ Gray Cloud
Price contradicts trend, or price is inside the cloud
→ Represents indecision, low momentum; best to avoid entries
⚙️ Technical Features
Ichimoku Components: Tenkan-sen, Kijun-sen, Senkou Span A & B, Chikou Span
Cloud Transparency: 30%
MACD Filter: Optional momentum confirmation (customizable)
Trailing Stop: Optional dynamic trailing stop after trigger level
Directional Control: Long and short trailing rules can be set independently
📚 References
Ichimoku Charts – Nicole Elliott
Algorithmic Trading – Ernie Chan
TradingView Pine Script and hybrid trend models
⚠️ Disclaimer
This strategy is for educational and backtesting purposes only.
It is not financial advice. Always test thoroughly before applying to real trades.
Avg High/Low Lines with TP & SL아래 코드는 TradingView Pine Script v6으로 작성된 스크립트로, 주어진 캔들 수 동안의 평균 고가와 저가를 계산해서 그 위에 수평선을 그리며, 해당 수평선 돌파 시 진입 가격을 기록하고, 손절가(SL)와 목표가(TP)를 자동으로 계산하여 표시하는 전략입니다. 알림(alert) 기능도 포함되어 있습니다.
코드 주요 기능 요약
length 기간 동안 평균 고가, 저가를 단순 이동평균(SMA)으로 계산
평균 고가선, 저가선 수평선을 일정 바 개수만큼 좌우 연장하여 차트에 표시
평균 고가 돌파 시 매수 진입, 평균 저가 돌파 시 매도 진입 처리
진입 가격 저장 및 상태 관리 (inLong, inShort 플래그)
손절가(SL): 롱이면 평균 저가, 숏이면 평균 고가
목표가(TP): 진입가에서 손절 거리의 1.5배만큼 설정
진입가 기준으로 TP, SL 라인과 라벨 표시
상단 돌파 후 종가 마감 시 매수 알림, 하단 돌파 후 종가 마감 시 매도 알림
Sure! Here’s the English explanation of your TradingView Pine Script v6 code:
Summary of Key Features
Calculates the simple moving average (SMA) of the high and low prices over a user-defined number of candles (length).
Draws horizontal lines for the average high and average low, extending them a specified number of bars to the left and right on the chart.
Detects breakouts above the average high to trigger a long entry, and breakouts below the average low to trigger a short entry.
Records the entry price and manages trade states using flags (inLong, inShort).
Sets the stop loss (SL) at the average low for long positions, and at the average high for short positions.
Calculates the take profit (TP) level based on the entry price plus 1.5 times the stop loss distance.
Draws lines and labels for the TP and SL levels starting from the entry bar, extended to the right.
Sends alerts when the price closes above the average high after a breakout (long signal), or closes below the average low after a breakout (short signal).
-onestar-
MVWAP 5/21/50 + LWMA 400Moving vwap de 5,21,50 y media movil ponderada de 400
se puede utilizar con cruces
MACD Histogram v6This script plots the MACD histogram, a popular momentum indicator used to identify bullish/bearish momentum shifts, convergence/divergence between moving averages, and potential entry/exit signals.
Core Components:
Inputs:
fast – Period for the fast EMA (default: 12).
slow – Period for the slow EMA (default: 26).
signal – Period for the signal line EMA (default: 9).
Pivot Swings w Table Pivot Swings w Table — Intraday Structure & Range Analyzer
This indicator identifies key pivot highs and lows on the chart and highlights market structure shifts using a real-time table display. It helps traders visually confirm potential trade setups by tracking unbroken swing points and measuring the range between the most recent pivots.
🔍 Features:
🔹 Automatic Pivot Detection using configurable left/right bar logic.
🔹 Unbroken Pivot Filtering — only pivots that haven't been invalidated by price are displayed.
🔹 Dynamic Range Table with:
Latest valid Pivot High and Pivot Low
Total Range Width
Upper & Lower 25% range thresholds (useful for value/imbalance analysis)
🔹 Trend-Based Color Coding — the table background changes based on which pivot (high or low) occurred more recently:
🟥 Red: Downward bias (last pivot was a lower high)
🟩 Green: Upward bias (last pivot was a higher low)
🔹 Optional extension of pivot levels to the right of the chart for support/resistance confluence.
⚙️ How to Use:
Adjust the Left Bars and Right Bars inputs to fine-tune how swings are defined.
Look for price reacting near the Upper or Lower 25% zones to anticipate mean reversion or breakout setups.
Use the trend color of the table to confirm directional bias, especially useful during consolidation or retracement periods.
💡 Best For:
Intraday or short-term swing traders
Traders who use market structure, support/resistance, or trend-based strategies
Those looking to avoid low-quality trades in tight ranges
✅ Built for overlay use on price charts
📈 Works on all symbols and timeframes
🧠 No repainting — pivots are confirmed with completed bars
RSI Cảnh Báo Vùng 20/80 by TTVRSI 8 tín hiệu B khi đạt 20 và Sell khi đạt 80, có thể cài đặt khi đạt đến ngưỡng này
MA Deviationインジケーター名: MA乖離率インジケーター / MA Deviation Indicator
📖 説明(日本語)
このインジケーターは、3本の移動平均線(MA)の乖離率を視覚化し、相場の過熱感やトレンドの強さを判定するためのツールです。
✅ 主な機能
複数の移動平均タイプに対応:SMA, EMA, WMA, RMA, VWMA, HMAから選択可能。
最大3本の移動平均を自由に設定可能。
それぞれのMA間の乖離率(%)をチャートにプロット。
指定した閾値を超えた時に背景色を表示(緑=乖離が正方向に大きい、赤=負方向に大きい)。
データウィンドウ上で「背景表示フラグ」も確認可能(サインが出ているかどうかが数値で確認できます)。
⚠️ 注意事項
乖離率は過去の価格と比較したものであり、将来の価格を保証するものではありません。
短期トレードよりも、トレンドの強弱や過熱感の把握に適しています。
複数のMAを使用しない場合でも、背景色は他の設定されたMAペアで判定されることにご注意ください。
📖 Description (English)
This indicator visualizes the percentage deviation between up to 3 configurable moving averages (MA), helping traders assess trend momentum and potential overextension.
✅ Key Features
Supports multiple MA types: Choose from SMA, EMA, WMA, RMA, VWMA, and HMA.
Set up to 3 custom MAs with different periods.
Plots the deviation (%) between each pair of selected MAs.
Background color highlights extreme deviations (green = strong positive deviation, red = strong negative deviation).
Data Window flag (1 or 0) shows whether background highlight is active.
⚠️ Notes
Deviation percentages are not predictive, but useful for identifying trend strength or market overheating.
Especially useful for trend analysis, not for exact entry signals.
Even if not all lines are shown, the background color may still appear based on the enabled MA comparisons.
Price Extension from 8 EMAOverview
This indicator can be used to see how far away the price is from the 8 EMA. It compares this to the Average Daily Range % to see if the stock may be overextended. The "Extension Multiplier" represents how far the stock is extended away from the 8 EMA.
Core Concept
This indicator is best used for breakout trades that are trying to make sure they are not chasing the stock.
How to Use This Indicator
This tool is primarily intended for analyzing daily charts of individual stocks and is often used by breakout traders to evaluate potential entry areas.
If the stock is far away from the 8 EMA, it is likely not ready to break out. If it is close to the 8ema, it could be ready to move higher.
This indicator can also be used in the opposite way. For example, shorting or puts.
Understanding the colors
Green (Not Extended): Indicates the price is close to the 8 EMA. This often corresponds to periods of consolidation.
Yellow (Slightly Extended): The price is beginning to move away from the 8 EMA.
Orange (Extended): The price has moved a considerable distance from the 8 EMA.
Red (Very Extended): The price is at an extreme distance from the 8 EMA, historically increasing the likelihood of a pullback or consolidation.
Settings
Info Row Position: Adjusts the vertical position of the display table on the chart. Useful when using other indicators.
ADR Length: Sets the lookback period for calculating the Average Daily Range. Or the average range % for different timeframes.
Timeframe: Determines the timeframe for the EMA and ADR calculation (the default is Daily).
BTCs RSI Dip & EMA Crossover AlertThis indicator helps you catch potential reversal opportunities after a stock or crypto asset becomes oversold.
🛠 How it works:
Watches RSI (Relative Strength Index)
First, it waits for RSI to dip below a level you choose (default is 30), which often signals the asset is oversold and due for a bounce.
Waits for Price Confirmation
After the RSI dip, the indicator watches for the first time price closes above both the 55 EMA and 200 EMA — a strong sign that momentum may be shifting upward.
Sends a “Buy” Signal
When that happens, the script:
Plots a green “Buy” label on the chart
Triggers an alert (labeled "Buy Indicator") so you’re notified immediately
⚙️ Customizable Inputs:
RSI threshold (e.g. 30 or 25)
RSI period (e.g. 14)
EMA lengths (default: 55 and 200)
✅ Designed to:
Avoid false signals by requiring both RSI weakness and price strength
Only trigger once per RSI dip, so you’re not spammed with repeat alerts
Use it to stay patient during downtrends and get alerted when the technicals show a possible turnaround. Great for swing traders and longer-term entries.