在腳本中搜尋"黄金近50年的走势"
UO_30-50-70Ultimate Oscillator with bands present at the 30, 50, and 70 pt levels.
Personally use this every time, created a script to hard code these lines so I wouldn't need to redraw them all the time.
Enjoy
EMA Crossover Strategy (15m)50 and 200 ema crossing when leaving anchor. when 50 and 200 crosses will give you direction of where market is going. wait for a pull back and take trade. sl on highest or lowest point of apex tp open . when you see multiple equal ( low or High) get put of trade.
The Lazy Trader - Index (ETF) Trend Following Robot50/150 moving average, index (ETF) trend following robot. Coded for people who cannot psychologically handle dollar-cost-averaging through bear markets and extreme drawdowns (although DCA can produce better results eventually), this robot helps you to avoid bear markets. Be a fair-weathered friend of Mr Market, and only take up his offer when the sun is shining! Designed for the lazy trader who really doesn't care...
Recommended Chart Settings:
Asset Class: ETF
Time Frame: Daily
Necessary ETF Macro Conditions:
a) Country must have healthy demographics, good ratio of young > old
b) Country population must be increasing
c) Country must be experiencing price-inflation
Default Robot Settings:
Slow Moving Average: 50 (integer) //adjust to suit your underlying index
Fast Moving Average: 150 (integer) //adjust to suit your underlying index
Bullish Slope Angle: 5 (degrees) //up angle of moving averages
Bearish Slope Angle: -5 (degrees) //down angle of moving averages
Average True Range: 14 (integer) //input for slope-angle formula
Risk: 100 (%) //100% risk means using all equity per trade
ETF Test Results (Default Settings):
SPY (1993 to 2020, 27 years), 332% profit, 20 trades, 6.4 profit factor, 7% drawdown
EWG (1996 to 2020, 24 years), 310% profit, 18 trades, 3.7 profit factor, 10% drawdown
EWH (1996 to 2020, 24 years), 4% loss, 26 trades, 0.9 profit factor, 36% drawdown
QQQ (1999 to 2020, 21 years), 232% profit, 17 trades, 3.6 profit factor, 2% drawdown
EEM (2003 to 2020, 17 years), 73% profit, 17 trades, 1.1 profit factor, 3% drawdown
GXC (2007 to 2020, 13 years), 18% profit, 14 trades, 1.3 profit factor, 26% drawdown
BKF (2009 to 2020, 11 years), 11% profit, 13 trades, 1.2 profit factor, 33% drawdown
A longer time in the markets is better, with the exception of EWH. 6 out of 7 tested ETFs were profitable, feel free to test on your favourite ETF (default settings) and comment below.
Risk Warning:
Not tested on commodities nor other financial products like currencies (code will not work), feel free to leave comments below.
Moving Average Slope Angle Formula:
Reproduced and modified from source:
50-Minute Opening Range BreakoutThis is a test of the opening range with Bearish/Bullish confirmation
50-Line Oscillator // (\_/)
// ( •.•)
// (")_(")
25-Line Oscillator
Description:
The 25-Line Oscillator is a sophisticated technical analysis tool designed to visualize market trends through the use of multiple Simple Moving Averages (SMAs). This indicator computes a series of 26 SMAs, incrementally increasing the base length, providing traders with a comprehensive view of price dynamics.
Features:
Customizable Base Length: Adjust the base length of the SMAs according to trading preferences, enhancing versatility for different market conditions.
Rainbow Effect: The indicator employs a visually appealing rainbow color scheme to differentiate between the various trend lines, making it easy to identify crossovers and momentum shifts.
Crossovers Detection: The script includes logic to detect crossover events between consecutive trend lines, which can serve as signals for potential entry or exit points in trading.
Clear Visualization: Suitable for both novice and seasoned traders, the plots enable quick interpretation of trends and market behavior.
How to Use:
Add the indicator to your chart and customize the base length as desired.
Observe the rainbow-colored lines for trend direction.
Look for crossover events between the SMAs as potential trading signals.
Application: This indicator is particularly useful for swing traders and trend followers who aim to capitalize on market momentum and identify reversals. By monitoring the behavior of multiple SMAs, traders can gain insights into the strength and direction of price movements over various time frames.
AK Simple Moving Average 50 days Simple Moving average suitable for Intraday on 1Hr,30Min.15Min Time frames
1. When candle crossing above SMA Line - Go for Long Entries
2. When candle crossing below SMA Line - Go for short Entries
50 SMA / 200 EMA / 128EMA Moving Average CrossFound success using 50SMA vs 200EMA.
128 EMA also charted for it's BTC relevance.
50/100/200 Moving Averages (Pine Script For Copy)by fresca
SCRIPT LANGUAGE
Copy script below and adjust based on your preferences.
-function (change function from "sma" to "ema", "wma" and more)
-length (25 Day, 150 Day or add more averages to the three in this script.)
-color, (red, yellow, etc. or use color hex codes i.e. #FEDA15, #FFAD8F, etc.)
-transparency (set to desired level 1-100)
Or add more options.
RESOURCES
Color hex codes site: www.canva.com
Trading View Pine Script Editor Reference Guide: www.tradingview.com
Taint's Multi Time Frame MA50-100-200 SMA with two 200 EMA's all with the ability choose a time frame for each.
Advanced Technical Analysis with Cumulative Delta//@version=5
indicator("Advanced Technical Analysis with Cumulative Delta", overlay=true)
This declares the script as a version 5 indicator.
The title is what appears in TradingView's indicator list.
overlay=true means it plots directly on the price chart (e.g., lines for moving averages) rather than in a separate pane.
2. Input Parameters
pinescript
smaLength = input.int(100, title="SMA Length")
emaLength = input.int(1000, title="EMA Length")
rsiLength = input.int(14, title="RSI Length")
rsiOverbought = input.int(70, title="RSI Overbought")
rsiOversold = input.int(30, title="RSI Oversold")
vwmoLength = input.int(20, title="VWMO Length")
adxLength = input.int(14, title="ADX Length")
obvLength = input.int(20, title="OBV Length")
obvDivergenceLookback = input.int(10, title="OBV Divergence Lookback")
stochLength = input.int(14, title="Stoch Length")
stochD = input.int(3, title="Stoch D")
stochOverbought = input.int(80, title="Stoch Overbought")
stochOversold = input.int(20, title="Stoch Oversold")
cciLength = input.int(14, title="CCI Length")
cciOverbought = input.int(100, title="CCI Overbought")
cciOversold = input.int(-100, title="CCI Oversold")
atrLength = input.int(14, title="ATR Length")
moneyFlowLength = input.int(14, title="Money Flow Length")
volSmaLength = input.int(20, title="Vol SMA Length")
These are user-configurable inputs using input.int() for integer values.
They define periods (lengths) and thresholds (e.g., overbought/oversold levels) for various indicators.
Examples: rsiLength sets the RSI calculation period (default 14 bars), rsiOverbought sets the upper threshold (default 70).
3. Display Options
pinescript
showMomentumScore = input.bool(true, title="Show Momentum Score")
showAdx = input.bool(true, title="Show ADX")
showDetailedLabels = input.bool(true, title="Show Detailed Labels")
showObv = input.bool(true, title="Show OBV")
showStoch = input.bool(true, title="Show Stoch")
showCci = input.bool(true, title="Show CCI")
showAtr = input.bool(true, title="Show ATR")
showMoneyFlow = input.bool(true, title="Show Money Flow")
showVolumeAnalysis = input.bool(true, title="Show Volume Analysis")
showCumulativeDelta = input.bool(true, title="Show Cumulative Delta")
Boolean inputs (input.bool()) to toggle visibility of specific metrics in the dashboard or on the chart.
This allows users to customize the display to avoid clutter.
4. Moving Averages
pinescript
SMA100 = ta.sma(close, smaLength)
EMA1000 = ta.ema(close, emaLength)
// Daily VWAP
varip float cumVol = 0.0
varip float cumPriceVol = 0.0
if ta.change(time("D")) != 0
cumVol := 0.0
cumPriceVol := 0.0
cumVol += volume
cumPriceVol += close * volume
VWAP_Day = cumPriceVol / cumVol
plot(SMA100, color=color.new(color.gray, 0), linewidth=2)
plot(EMA1000, color=color.new(color.blue, 0), linewidth=2)
plot(VWAP_Day, color=color.new(color.yellow, 0), linewidth=2)
Calculates Simple Moving Average (SMA) and Exponential Moving Average (EMA) using TradingView's ta library.
VWAP (Volume-Weighted Average Price) is reset daily: It accumulates volume and price*volume each bar, resetting on new days (ta.change(time("D")) detects day changes).
These are plotted as lines on the chart with custom colors and widths.
5. Oscillators
This section computes various momentum and volume-based oscillators.
RSI:
pinescript
rsi = ta.rsi(close, rsiLength)
Relative Strength Index measures price momentum (0-100 scale).
VWMO (Volume-Weighted Momentum Oscillator):
pinescript
volumeWeightedPrice = close * volume
vwmaCurrent = math.sum(volumeWeightedPrice, vwmoLength) / math.sum(volume, vwmoLength)
vwmaPast = math.sum(volumeWeightedPrice , vwmoLength) / math.sum(volume , vwmoLength)
vwmo = (vwmaCurrent - vwmaPast) / vwmaPast * 100
Custom oscillator: Compares current vs. past Volume-Weighted Moving Average (VWMA) to gauge volume-adjusted momentum.
ADX & DMI:
pinescript
= ta.dmi(adxLength, adxLength)
Average Directional Index (ADX) measures trend strength; Directional Movement Index (DMI) shows direction (+DI for up, -DI for down).
OBV (On-Balance Volume):
pinescript
obvRaw = ta.obv
obv = ta.sma(obvRaw, obvLength)
obvSlope = obv - obv
obvRising = obvSlope > 0
obvFalling = obvSlope < 0
OBV tracks cumulative volume based on price direction. Smoothed with SMA, and slope checks if it's rising/falling over 5 bars.
Cumulative Delta:
pinescript
cumDelta = ta.obv
cumDeltaChange = cumDelta - cumDelta
cumDeltaRising = cumDelta > cumDelta
cumDeltaFalling = cumDelta < cumDelta
cumDeltaMA = ta.sma(cumDelta, 20)
plot(showCumulativeDelta ? cumDelta : na, color=color.new(color.orange, 0), linewidth=2)
plot(showCumulativeDelta ? cumDeltaMA : na, color=color.new(color.yellow, 0), style=plot.style_line)
Uses OBV as proxy for Cumulative Delta (net buying/selling volume). Plots the raw value and its 20-period SMA if toggled.
Stochastic:
pinescript
fastK = ta.stoch(close, high, low, stochLength)
stochFullK = ta.sma(fastK, stochD)
stochFullD = ta.sma(stochFullK, stochD)
Stochastic oscillator compares closing price to high-low range. Smoothed with SMAs for %K and %D lines.
CCI (Commodity Channel Index):
pinescript
cci = ta.cci(close, cciLength)
Measures deviation from typical price.
MFI (Money Flow Index):
pinescript
mfi = ta.mfi(hlc3, moneyFlowLength)
mfiBullish = mfi > 50
mfiBearish = mfi < 50
mfiOverbought = mfi > 80
mfiOversold = mfi < 20
Volume-weighted RSI variant using typical price (hlc3 = (high + low + close)/3).
6. ATR & Volatility
pinescript
atr = ta.atr(atrLength)
atrAvg = ta.sma(atr, 20)
highVolatility = atr > atrAvg * 1.5
lowVolatility = atr < atrAvg * 0.5
volatilityRatio = math.round((atr / atrAvg) * 100)
Average True Range (ATR) measures volatility. Compared to its 20-period SMA to classify high/low volatility.
7. Volume Analysis
pinescript
volSma = ta.sma(volume, volSmaLength)
volRatio = volume / volSma
highVolume = volume > volSma * 1.5
lowVolume = volume < volSma * 0.5
extremeVolume = volRatio > 2
normalVolume = volRatio >= 0.5 and volRatio <= 1.5
Compares current volume to its SMA to detect high/low/extreme volume.
8. Price Action Signals
pinescript
bullishCandle = close > open
bearishCandle = close < open
candleSize = math.abs(close - open)
avgCandleSize = ta.sma(candleSize, 20)
largeCandleBody = candleSize > avgCandleSize * 1.5
strongBullishCandle = bullishCandle and largeCandleBody and highVolume
strongBearishCandle = bearishCandle and largeCandleBody and highVolume
Identifies candle types (bullish/bearish) and strength based on body size and volume.
9. Trend Analysis
pinescript
priceAboveAll = close > SMA100 and close > EMA1000 and close > VWAP_Day
priceBelowAll = close < SMA100 and close < EMA1000 and close < VWAP_Day
priceVsVWAP = close > VWAP_Day
Checks if price is above/below all key averages for trend direction.
10. Enhanced Momentum Conditions
pinescript
bullishMomentum = rsi > 50 and vwmo > 0 and stochFullK > 50 and cci > 0 and mfiBullish and cumDeltaRising
bearishMomentum = rsi < 50 and vwmo < 0 and stochFullK < 50 and cci < 0 and mfiBearish and cumDeltaFalling
strongTrend = adx > 25
veryStrongTrend = adx > 40
Combines multiple oscillators (including Cumulative Delta) for overall momentum. ADX thresholds define trend strength.
11. Directional Movement
pinescript
bullishDMI = diPlus > diMinus
bearishDMI = diMinus > diPlus
Uses DMI to confirm directional bias.
12. OBV Divergence
pinescript
priceHigherHigh = high > ta.highest(high , obvDivergenceLookback)
priceLowerLow = low < ta.lowest(low , obvDivergenceLookback)
obvHigherHigh = obv > ta.highest(obv , obvDivergenceLookback)
obvLowerLow = obv < ta.lowest(obv , obvDivergenceLookback)
obvBearishDiv = priceHigherHigh and not obvHigherHigh and close > SMA100
obvBullishDiv = priceLowerLow and not obvLowerLow and close < SMA100
Detects divergences: Price making higher highs/lows but OBV not confirming, signaling potential reversals.
13. Comprehensive Trend Classification
pinescript
bullishTrend = priceAboveAll and bullishMomentum and strongTrend and bullishDMI and obvRising
bearishTrend = priceBelowAll and bearishMomentum and strongTrend and bearishDMI and obvFalling
strongBullish = bullishTrend and veryStrongTrend and rsi > rsiOverbought and vwmo > 1
strongBearish = bearishTrend and veryStrongTrend and rsi < rsiOversold and vwmo < -1
Aggregates conditions for overall trend labels (e.g., bullish if price, momentum, trend strength, DMI, and OBV align).
14. Weakness/Strength Detection
pinescript
weaknessAtHigh = obvBearishDiv or (priceAboveAll and obvFalling and rsi > 70) or mfiOverbought
strengthAtLow = obvBullishDiv or (priceBelowAll and obvRising and rsi < 30) or mfiOversold
Flags hidden weaknesses (e.g., overbought with falling OBV) or strengths (e.g., oversold with rising OBV).
15. Advanced Momentum Scoring
pinescript
priceScore = priceAboveAll ? 50 : priceBelowAll ? 0 : 25
rsiScore = rsi > rsiOverbought ? 25 : rsi < rsiOversold ? 0 : rsi > 50 ? 15 : 5
vwmoScore = vwmo > 1 ? 25 : vwmo < -1 ? 0 : vwmo > 0 ? 15 : 5
adxScore = adx > 40 ? 20 : adx > 25 ? 10 : 0
stochScore = stochFullK > stochOverbought ? 20 : stochFullK < stochOversold ? 0 : stochFullK > 50 ? 12 : 4
cciScore = cci > cciOverbought ? 20 : cci < cciOversold ? 0 : cci > 0 ? 12 : 4
mfiScore = mfi > 80 ? 15 : mfi < 20 ? 0 : mfi > 50 ? 10 : 3
volScore = highVolatility ? 10 : lowVolatility ? 0 : 5
cumDeltaScore = cumDeltaRising ? 15 : cumDeltaFalling ? 0 : 8
momentumScore = priceScore + rsiScore + vwmoScore + adxScore + stochScore + cciScore + mfiScore + volScore + cumDeltaScore
marketBias = momentumScore > 155 ? 5 : momentumScore > 115 ? 4 : momentumScore < 45 ? 1 : momentumScore < 75 ? 2 : 3
Assigns points to each indicator based on conditions (e.g., higher scores for bullish signals).
Total momentumScore (max 200) determines marketBias (1=strong bear, 5=strong bull).
16. Dashboard Table
pinescript
var table dashboard = table.new(position.top_right, columns=1, rows=30, border_width=0, frame_width=0)
if barstate.islast
row = 0
// ... (code for adding cells to the table)






















