Indicator · Pine Script v6 · On the chart

Refined Multi-TF Crypto Analyzer

by messified

The Refined Multi-TF Crypto Analyzer plots technical analysis signals on the main price chart by combining multi-timeframe moving averages, RSI, ADX, and volume spikes.

View on GitHub

Repaints

GitHub stars2on the repository
Pine versionv6current
Lines of code127
Settings11inputs
LicenceNone statedfile: MPL-2.0
Last update1 year ago7 Dec 2024

Add It to Your TradingView Chart

  1. 1Copy the scriptPress Copy script above, or the copy button on the code below.
  2. 2Open the Pine EditorOpen a TradingView chart and choose Pine Editor at the bottom of the screen.
  3. 3Paste over the templateCreate a new indicator, select all of the template text and paste. Press Save and give it a name.
  4. 4Add it to the chartPress Add to chart, then adjust the settings with the gear icon next to its name.

Source Code

127 lines of Pine Script v6 from crypto-analyzer.pine, published under MPL-2.0 (file header). Keep the author's credit and licence lines when you reuse it.

crypto-analyzer.pine
// This Pine Script™ code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © Messified

//@version=6
indicator("Refined Multi-TF Crypto Analyzer - Hypothetical v6", overlay=true, shorttitle="Crypto Analyzer v6")

//------------------------------------------------------
// User Inputs
//------------------------------------------------------
fastLength           = input.int(9, "Fast EMA Length")
slowLength           = input.int(26, "Slow EMA Length")
rsiLength            = input.int(14, "RSI Length")
rsiOverbought        = input.float(75, "RSI Overbought Level", minval=50, maxval=100)
rsiOversold          = input.float(25, "RSI Oversold Level", minval=0, maxval=50)
atrLength            = input.int(14, "ATR Length")
adxThreshold         = input.float(20, "ADX Threshold", minval=1)
volumeMultiplier     = input.float(2.0, "Volume Spike Multiplier")
supportResistanceLen = input.int(50, "Support/Resistance Lookback")
riskRewardMultiplier = input.float(1.0, "Risk/Reward Multiplier")
htf                  = input.timeframe("30", "Higher Timeframe for Confirmation")

//------------------------------------------------------
// Core Calculations - Current Timeframe
//------------------------------------------------------
fastEMA = ta.ema(close, fastLength)
slowEMA = ta.ema(close, slowLength)
rsi = ta.rsi(close, rsiLength)
atr = ta.atr(atrLength)

// ADX & DMI
lengthADX = 14
tr = ta.rma(ta.tr(true), lengthADX)
plusDM = ta.rma(((high - high[1]) > (low[1] - low) and (high - high[1] > 0)) ? (high - high[1]) : 0, lengthADX)
minusDM = ta.rma(((low[1] - low) > (high - high[1]) and (low[1] - low > 0)) ? (low[1] - low) : 0, lengthADX)
plusDI = (plusDM / tr) * 100
minusDI = (minusDM / tr) * 100
dx = math.abs(plusDI - minusDI) / (plusDI + minusDI) * 100
adx = ta.rma(dx, lengthADX)

// Volume Spike
averageVolume = ta.sma(volume, 20)
volumeSpike = volume > averageVolume * volumeMultiplier

// Support/Resistance
support = ta.lowest(low, supportResistanceLen)
resistance = ta.highest(high, supportResistanceLen)

// Risk/Reward Levels
entryPrice = close
stopLoss = entryPrice - atr
targetPrice = entryPrice + atr * riskRewardMultiplier

// RSI Divergences
priceHigherHigh = high > high[1]
priceLowerLow = low < low[1]
rsiLowerHigh = rsi < rsi[1] and priceHigherHigh
rsiHigherLow = rsi > rsi[1] and priceLowerLow

bullishDivergence = priceLowerLow and rsiHigherLow
bearishDivergence = priceHigherHigh and rsiLowerHigh

// Trend (Current TF)
bullishTrend = fastEMA > slowEMA and adx > adxThreshold
bearishTrend = fastEMA < slowEMA and adx > adxThreshold

//------------------------------------------------------
// Higher Timeframe Confirmation (Hypothetical v6 enhancements)
//------------------------------------------------------
// Assume a hypothetical v6 function that better handles multi-timeframe requests with less repainting.
fastEMA_htf = request.security(syminfo.tickerid, htf, ta.ema(close, fastLength))
slowEMA_htf = request.security(syminfo.tickerid, htf, ta.ema(close, slowLength))
rsi_htf     = request.security(syminfo.tickerid, htf, ta.rsi(close, rsiLength))

plusDM_htf  = request.security(syminfo.tickerid, htf, plusDM)
minusDM_htf = request.security(syminfo.tickerid, htf, minusDM)
tr_htf      = request.security(syminfo.tickerid, htf, tr)
plusDI_htf  = (plusDM_htf / tr_htf) * 100
minusDI_htf = (minusDM_htf / tr_htf) * 100
dx_htf      = math.abs(plusDI_htf - minusDI_htf) / (plusDI_htf + minusDI_htf) * 100
adx_htf     = request.security(syminfo.tickerid, htf, ta.rma(dx, lengthADX))

bullishTrend_htf = fastEMA_htf > slowEMA_htf and adx_htf > adxThreshold
bearishTrend_htf = fastEMA_htf < slowEMA_htf and adx_htf > adxThreshold

//------------------------------------------------------
// Combined Conditions
//------------------------------------------------------
criticalBuy = bullishTrend and bullishTrend_htf and rsi < rsiOversold and volumeSpike and bullishDivergence
criticalSell = bearishTrend and bearishTrend_htf and rsi > rsiOverbought and volumeSpike and bearishDivergence
regularBuy = bullishTrend and bullishTrend_htf and rsi < 50 and adx > adxThreshold
regularSell = bearishTrend and bearishTrend_htf and rsi > 50 and adx > adxThreshold
holdCondition = not criticalBuy and not criticalSell and not regularBuy and not regularSell and (bullishTrend or bearishTrend)

// Sell Percentages
sell2Percent = close * 1.02
sell10Percent = close * 1.10
sell20Percent = close * 1.20

//------------------------------------------------------
// Plots and Shapes (Hypothetical Styling Enhancements)
//------------------------------------------------------
plot(fastEMA, color=color.new(color.green, 40), title="Fast EMA", linewidth=2)
plot(slowEMA, color=color.new(color.red, 40), title="Slow EMA", linewidth=2)

// Critical Signals
plotshape(criticalBuy, title="Critical Buy Signal", text="Critical Buy", style=shape.labelup, location=location.belowbar, size=size.large, color=color.new(color.blue, 0), textcolor=color.white)
plotshape(criticalSell, title="Critical Sell Signal", text="Critical Sell", style=shape.labeldown, location=location.abovebar, size=size.large, color=color.new(color.orange, 0), textcolor=color.white)

if criticalSell
    label.new(bar_index, high, text="Target: " + str.tostring(targetPrice, format.mintick) + "\nSL: " + str.tostring(stopLoss, format.mintick) + "\n2%: " + str.tostring(sell2Percent, format.mintick) + "\n10%: " + str.tostring(sell10Percent, format.mintick) + "\n20%: " + str.tostring(sell20Percent, format.mintick),style=label.style_label_down,color=color.new(color.orange, 70), textcolor=color.white)

// Regular Signals
plotshape(regularBuy, title="Regular Buy", text="Buy", style=shape.triangleup, location=location.belowbar, size=size.small, color=color.green, textcolor=color.white)
plotshape(regularSell, title="Regular Sell", text="Sell", style=shape.triangledown, location=location.abovebar, size=size.small, color=color.red, textcolor=color.white)

//------------------------------------------------------
// Alerts (Hypothetical direct alert calling in v6)
//------------------------------------------------------
// In v6, assume we can call alert() directly with conditions without separately defining alertcondition().
if criticalBuy
    alert("Critical Buy signal on " + syminfo.ticker + " at " + str.tostring(close), alert.freq_once_per_bar)

if criticalSell
    alert("Critical Sell signal on " + syminfo.ticker + " at " + str.tostring(close) + " - Targets: 2%, 10%, 20%", alert.freq_once_per_bar)

if holdCondition
    alert("Hold signal for " + syminfo.ticker, alert.freq_once_per_bar)

Overview

Refined Multi-TF Crypto Analyzer checks for trend alignment between the chart timeframe and a higher timeframe, identifies RSI divergences, and projects dynamic ATR-based target and stop-loss levels. Users can customize indicator lengths, ADX thresholds, volume spike multipliers, and the higher timeframe. Higher-timeframe calculations without offset handling may cause repainting on historical bars or live updates.

Details

Published by

messified on GitHub

Draws

On the price chart

Markets

Crypto

Timeframes

M1-M5, M15-H1

Risk Notes

  • Signals can change on the live bar or after it closes (repainting)

Topics

cryptoindicatortradingvew

Settings

The inputs you can change from the gear icon on the chart. Defaults are the author's.

SettingTypeDefaultVariable
Fast EMA Lengthint9fastLength
Slow EMA Lengthint26slowLength
RSI Lengthint14rsiLength
RSI Overbought Levelfloat75rsiOverbought
RSI Oversold Levelfloat25rsiOversold
ATR Lengthint14atrLength
ADX Thresholdfloat20adxThreshold
Volume Spike Multiplierfloat2.0volumeMultiplier
Support/Resistance Lookbackint50supportResistanceLen
Risk/Reward Multiplierfloat1.0riskRewardMultiplier
Higher Timeframe for Confirmationtimeframe30htf
Third-party code. ForexR did not write, test or endorse this script, and the summary above was generated automatically from its code and README. Indicators describe the past, and a strategy's backtest can look better than live trading, especially when a script repaints. Check it in the Strategy Tester and on a demo account before you rely on it.

Similar Pine Scripts

QQE + AK Trend + EFI

by realanthonyc
2 stars

This indicator computes and plots a QQE histogram using RSI of the chosen source smoothed with Wilder's ATR method, alongside an AK Trend line derived from fast EMAs with dynamic scale factors adjusted by timeframe. It also calculates Elder Force Index with ad

Indicator v6 TrendOscillators & momentum
Updated 11 months ago · MPL-2.0 GitHub repository of QQE + AK Trend + EFI

The Momentum Setup is a multi-indicator visual tool designed for trend and momentum analysis directly on the price chart. It combines Relative Strength Index (RSI), Money Flow Index (MFI), Commodity Channel Index (CCI), Supertrend, and a 250-bar percentage cha

Indicator v5 Oscillators & momentumTrend
Updated 1 year ago · MPL-2.0 GitHub repository of Momentum Setup - Ankush Bajaj Momentum Investing Setup
257 stars

An overlay indicator that combines an ATR-based SuperTrend trailing stop with an integrated RSI-derived midline calculation on the price chart. The SuperTrend uses an ATR period and factor multiplier to plot dynamic green or red trend lines based on price dire

Indicator v5 TrendVolatility & bands
Updated 7 weeks ago · None stated GitHub repository of SuperTrend ATR + RSI
114 stars

ADX Strategy (original) is an overlay indicator that identifies trend-following trade signals using the Average Directional Index (ADX) combined with a Simple Moving Average filter. A long signal is generated when the ADX rises above a user-defined trend level

Indicator v4 TrendOscillators & momentum
Updated 1 year ago · None stated GitHub repository of ADX Strategy (original)

Moon Dev Lunar Sniper

by moondevonyt
92 stars

Moon Dev Lunar Sniper is a multi-indicator overlay that scores confluence across fast and slow EMAs, RSI, MACD, DMI, and BB width to fire signals only when score meets the minimum threshold. It plots buy and sell signals on the price chart, highlights cosmic b

Indicator v6 TrendOscillators & momentum Repaints
Updated 2 months ago · Custom licence GitHub repository of Moon Dev Lunar Sniper

RSI Div at dVWAP StDev

by cryptorife
75 stars

This indicator marks RSI divergences only when price trades beyond daily VWAP standard-deviation bands. It compares recent RSI extremes with price highs and lows over a lookback window, and it treats a divergence as valid only while RSI stays beyond overbought

Indicator v4 DivergenceOscillators & momentum Repaints
Updated 3 years ago · GPL-3.0 GitHub repository of RSI Div at dVWAP StDev

More Trend scripts

Related on ForexR

Trade Your Charts With a Regulated Broker

Compare brokers that connect to TradingView, with spreads, minimum deposits and leverage side by side.

Compare brokers