Holy Grail (100% Win Rate)tldr:
1. Here you go folks – no repaint, no dodgy stuff, and 100% win rate
2. DO NOT TRADE THIS
________________________________________
Key points:
• Assets to trade: SPY, NASDAQ, DAX, FTSE, Bitcoin
• Time Frame: 1D or higher
________________________________________
What does the script do?
The script buys a certain amount of the asset every time we're in a pullback, and sells when we make a new All-Time High (ATH). More specifically, it waits for the first green candle after the lowest point of the pullback, and then adds to the position. We assume that when we see a green candle, the pullback is over. If we go even lower – we wait for another green candle. The script sells on the first red candle after an ATH.
The pullback is identified using a simple moving average (MA) – if we're below the MA, we're in a pullback.
You can set the MA length in the settings. I considered adding different types of MAs, but decided against it as it wouldn't change much in of the general idea.
You can also set the percentage of your to invest on the very first candle – this is an initial pre-filling of the position, so you have something to sell if the price goes straight up after you start trading. If you think we’re in a bear market and the only way is up, you might want to set a higher number. On the other hand, if you believe we’re near the top of a bull market, set a lower one.
You can set the percentage of the position to sell on each red candle after ATH under Settings → Input → Exit % . Similarly, you can set the percentage to buy on each green candle after a pullback low under Settings → Properties → Order Size . Since bull markets tend to last longer than bear market pullbacks, you’ll typically want Exit % to be larger than Order Size — though this may vary depending on your initial pre-fill.
________________________________________
Why these assets?
These are assets that are expected to go up over the long run. I call them “number go up” assets. Meaning: no matter where they are now, at some point in the future they’ll make a new ATH. That’s why this might not work on individual stocks like Nvidia or Tesla — there’s no guarantee they won’t go bust tomorrow. We all big companies from the past (Enron, Lehman Brothers, etc.) that collapsed unexpectedly.
With SPY, you're betting on the American economy. And the American economy will go up at least because of inflation. If you believe inflation will continue, then you believe we’ll eventually see a new ATH in SPY. It may take years — like from 2007 to 2013 — but it happened. And there was a bull run after that.
And if you think the American economy will never grow again — well, if that’s true, we’ll all have much bigger problems than trading scripts.
________________________________________
Why this time frame?
Because, as mentioned, it may take a long time to reach a new ATH. You can use a shorter time frame, but that requires a higher TradingView subscription plan to view multi-year data.
Also, if you choose a shorter time frame, you should reduce the Order Size and Exit % accordingly, because the script will jump in on every new green candle after a pullback. On a 1-minute chart, that could mean 100x more entries compared to daily. Conversely, if you go to a higher time frame, increase the sizes — otherwise, too much of your capital will just sit unused.
________________________________________
So if everything is so great and it has a real 100% win rate – why not trade it?
If you turn on the “buy & hold equity” curve, you’ll see that the profit from all closed trades (with a 100% win rate) is smaller than if you had simply bought the asset and held it for years.
Real-world slippage and fees will reduce your actual profits even more.
If you’re unlucky and start trading at the very top of a bull market, it might take 10 years before even a single trade is closed.
Some assets that seem like they can only go up long-term... might not. Take Bitcoin. Many believe it can only go up in the long term, but it could still die — just like anything else. The only reason I included it is because many people treat it as a “number go up” asset. And I know some will try to trade it. You've been warned. But I don’t want to start holy wars in the holy grail description (pun intended), so let’s move on.
________________________________________
What if, after all this, you do decide to trade this strategy?
Why would you? Maybe not for profit, but just to impress your friends with a 100% win rate. Or maybe you skipped the entire explanation above and just want to jump in because it sounds like a sure win.
Whatever your reason, first you should research the asset’s historical max time (in years) between ATHs. That’s how long you might need to keep a trade open. My other script – Cycles Analysis – might help with this.
Second, experiment with the input parameters. There aren't many, so it should be easy to find what works best for your asset. You can also enable “Show stats table” in settings – it’ll help you see how many entries/exits the script makes, which will help you find the right Order Size to Exit % ratio.
Yes, this might lead to over-optimization — but hey, if we’re at this stage, who cares, right?
That said, I did find some rare cases where specific parameter setups caused performance to dip below 100% due to a mandatory close at the wrong time.
Also, since trades can last for years, don’t use this with futures — you'd have to keep rolling them over. Use ETFs or similar long-holdable assets.
________________________________________
The final word
In short, this is a glorified “Buy the Dip” strategy. It only works long-term on a very limited set of assets, and in most cases performs worse than just buying and holding for the same period.
I created this script as a teaching tool — to show new traders that win rate isn’t everything. Even if the win rate is 100%. Trust me: it’s extremely hard to beat the market (especially without leverage), and this script is just more proof of that.
Ciclos
Adaptive Quadratic Kernel EnvelopeThis study draws a fair-value curve from a quadratic-weighted (Nadaraya-Watson) regression. Alpha sets how sharply weights decay inside the look-back window, so you trade lag against smoothness with one slider. Band half-width is ATRslow times a bounded fast/slow ATR ratio, giving an instant response to regime shifts without overshooting on spikes. Work in log space when an instrument grows exponentially, equal percentage moves then map to equal vertical steps. NearBase and FarBase define a progression of adaptive thresholds, useful for sizing exits or calibrating mean-reversion logic. Non-repaint mode keeps one-bar delay for clean back-tests, predictive mode shows the zero-lag curve for live decisions.
Key points
- Quadratic weights cut phase error versus Gaussian or SMA-based envelopes.
- Dual-ATR scaling updates width on the next bar, no residual lag.
- Log option preserves envelope symmetry across multi-decade data.
- Alpha provides direct control of curvature versus noise.
- Built-in alerts trigger on the first adaptive threshold, ready for automation.
Typical uses
Trend bias from the slope of the curve.
Entry timing when price pierces an inner threshold and momentum stalls.
Breakout confirmation when closes hold beyond outer thresholds while volatility expands.
Stops and targets anchored to chosen thresholds, automatically matching current noise.
Market Sessions Indicator by NomadTradesCustomisable Market session indicator
This indicator visually marks the high and low price levels for the Asia, London, and New York trading sessions directly on the chart, using distinct horizontal lines and color-coding for each session. Each session’s high and low are labelled for easy identification, allowing traders to quickly assess key and resistance levels established during major global market hours. The indicator is designed for clear session demarcation, helping s identify price reactions at these significant levels and ing multi-session analysis for intraday and swing trading strategies
Confluence Pannel📊 RSI / MACD / ADX Info — Indicator Overview
This Pine Script v6 indicator is a compact visual dashboard that displays real-time insights from three popular technical indicators — RSI, MACD, and ADX — in a color-coded at the top-right of your TradingView chart.
🔍 What It Shows
✅ RSI (Relative Strength Index)
Measures momentum and potential overbought/oversold conditions.
Green background: RSI is above 50 (bullish momentum).
Red background: RSI is below 50 (bearish momentum).
Extra label:
"OVER BOUGHT" if RSI > input threshold (default 70)
"OVER SOLD" if RSI < input threshold (default 30)
✅ MACD (Moving Average Convergence Divergence)
Indicates trend strength and direction.
Green background: MACD line is above signal line → Bullish
Red background: MACD line is below signal line → Bearish
Label displays: "Bullish" or "Bearish"
✅ ADX (Average Directional Index)
Measures the strength of the trend, not its direction.
Background and label color changes:
🔴 Red: ADX < 20 → "Bad" (no trend)
🟠 Orange: 20 ≤ ADX < 25 → "Weak" (choppy trend)
🟢 Green: 25 ≤ ADX < 30 → "Good" (valid trend)
🔵 Blue: ADX ≥ 30 → "Best" (strong trend)
🧠 How to Use It
Add to Chart: Paste the script into TradingView’s Pine Editor, click “Add to Chart,” and you’ll see a table appear in the top-right corner.
Interpret Quickly: Use the to quickly assess:
Is momentum building or fading? (RSI)
Is there a trend direction? (MACD)
Is the trend strong enough to trade? (ADX)
Make Fast Trade Decisions:
Look for all green/blue for optimal bullish conditions.
Mixed colors may indicate range-bound or weakening setups.
Use it as a confluence check before entering trades.
Goldbach - nonGB time trackerTracks nonGB prints with a purple Ray until that print is violated by price. It is written in a way that allows you to connect it with any GoldBach Time indicator that produces source.input functions (almost every indicator does).
Instructions:
1.Add a GoldBach Time indicator and nonGBTrack to your chart.
2.Open the Settings for nonGBTrack.
3.Select a GBtime indicator source for both the high and low options (I connect it to dmn's AMD-Goldbach (beta 2.15c) nGB Time Swing High Created and nGB Time Swing Low Created on the dropdown menu for signal source).
4.You must change to your source each time the indicator is added to a new chart (this is the only way to allow them to work together on TV with their closed source indicator rules).
Big Bulge.
(Goldbach Levels and Time introduced by Hopiplaka. See Hopiplaka's X page and discord to get the book on Goldbach. x.com )
SlopeDirectionLine_TWSlopeDirectionLine_TW
___________________________
Tried to copy a MT4 indicator
Smart Composite Strategy {Darkoexe}This strategy is a multi-confirmation trend-based system that combines several powerful community concepts into a cohesive trade automation framework. It’s designed to help identify high-probability directional trades with built-in dynamic exits, take-profits, and intelligent trend filters.
🧩 What Makes It Unique
Rather than relying on a single signal or open-source indicator, this strategy blends three well-established concepts:
G-Trend Reversal Detection – A trailing ATR-based trend switch logic to determine core market direction.
Bull/Bear Candle Momentum Filter – Counts candle colors over a lookback period to evaluate directional conviction.
Multi-timeframe CCI Rider & Ultimate RSI – Uses smoothed momentum values to confirm continuation and strength.
Trades are only entered when all modules are in agreement — filtering out noisy entries and aligning with prevailing momentum.
⚙️ Strategy Components
Entry Triggers:
A confirmed trend switch via G-Trend logic.
Favorable bullish or bearish candle momentum.
Multi-timeframe momentum alignment using:
CCI EMA
Augmented RSI signal line
Exits:
Optional G-Trend signal reversal exit.
Configurable stop-loss and take-profit levels, based on percentages.
Partial TP1-based exit, with dynamic stop-loss movement to entry upon trigger.
Customization:
Backtesting window control (start/end date).
Toggle for stop loss, take profit, TP1 percent, and SL trail logic.
Toggle to use or skip trend-based exit logic.
🎯 Use Case
This strategy is best suited for:
Swing traders or intraday trend-followers.
s wanting layered confirmation rather than single-indicator entries.
Markets with clear institutional flows or trending behavior.
⚠️ Notes & Limitations
This strategy uses components from other publicly available indicators, including:
G-Trend
CCI Rider by Stefan Loosli
Ultimate RSI by LuxAlgo
All code has been integrated and adapted into a unified logic tree.
The strategy operates using historical price data and may not for real-time slippage or fees.
Always forward test in live or paper environments before relying on performance.
Fall from Recent Top & ATH (Latest Only)Easy tool for smart investors. it's good option when you find good fundamental stock. then just check the fall from the top before taking decision.
Weekly High/Low + Breakout Probabilities (Debug Fixed)This script will tell you which day created the high or low of the week, the probability of it being that day and the probability that a day will break last weeks H/L
亚欧美盘开关及交接时段标记 - plotshape版📌 English Description:
This script highlights the opening and closing times of the Asian, European, and US trading sessions on your chart, helping traders understand global session dynamics and volatility shifts in a visual and intuitive way.
💡 Applicable Instruments: Gold (XAUUSD) and Major Forex Pairs (e.g., EURUSD, GBPUSD, USDJPY, etc.)
💡 Best for: Price Action, Session-based strategies, Breakout trades
Time zone used: Asia/Shanghai (GMT+8)
Asia Session: 08:00 - 15:00 (typically range-bound)
European Session: 15:00 - 19:00 (London volatility begins)
US Session: 20:00 - 00:00 (New York session, often the major trend period)
Gray background marks the 19:00 - 20:00 transition phase between EU and US sessions, often a quiet or pivotal moment
Perfect for short- to medium-term traders who rely on understanding session-based price behaviors—especially effective for gold and major forex pairs.
📌 中文描述:
本脚本用于在图表中标记亚盘、欧盘、美盘的开盘与收盘时间点,以直观的方式帮助交易者识别全球主要交易时段的节奏与波动特征。
💡 适用品种:黄金(XAUUSD)及主流外汇(如EURUSD、GBPUSD、USDJPY等)
💡 适用策略:价格行为(Price Action)、时段波动捕捉、趋势突破等
使用**北京时间(Asia/Shanghai)**识别时段
亚盘时间:08:00 - 15:00(通常为震荡行情)
欧盘时间:15:00 - 19:00(伦敦时段,波动增强)
美盘时间:20:00 - 00:00(纽约时段,主趋势时段)
灰色背景提示:19:00 - 20:00 为欧美盘交接期,是重要的波动衰减与等待爆发阶段
适合关注全球交易时段切换规律的中短线交易者,特别对黄金与外汇价格行为策略有重要参考意义。
Highlight Time Ranges - VN Timezone AbsoluteDefines specific time blocks as visual reminders to take a break and reset after long periods of chart analysis.
The indicator highlights two rest periods in Vietnam time (GMT+7):
12:00 to 14:00 – lunch break
17:00 to 20:00 – dinner and evening rest
Wonder StochasticWonder Stochastic is a custom indicator based on traditional stochastics, which includes additional smoothing for the %K and %D lines, highlighted overbought and oversold levels, and visual crossover signals to make it easier to identify potential entry and exit points in the market. by lachi1911
Stoch RSI + RSI + DivergenceStochastic RSI and RSI Indicator in 1, you can change the color and the borders of the bands to be more visible.
Friday Market Close Trigger🎯 PRIMARY OBJECTIVE:
Trigger a precisely timed alert every Friday at U.S. stock market close (4:00 PM EST / 21:00 UTC) to activate a webhook to WunderTrading for a BTC buy order.
This removes all dependency on indicators, volatility, or chart behavior. It is time-based, disciplined, and mission-driven.
Ichimoku AdvancedGreetings. I present to you an improved version of the indicator from LuxAlgo - Ichimoku Theories.
I am grateful to them for the work they have done, since I myself have no experience in programming on Pine Script.
I have supplemented their indicator with such functions as:
Multi-timeframe Tenkan and Kijun lines - you will always know where on the lower timeframe there is a stronger resistance/.
Ichimoku line formation areas - they can be used as a visualization of the number of bars that appear in the near lines, and for forecasting when the growth of the lines is caused by the fading of candles. They can also be used as measures for setting stop orders.
3-line pattern detector - Marker showing when the price is above/below the lines Tenkan ----> Kijun ----> Senkou A.
Please note that the calculation takes into the CLOSING price of the candle.
3 Chikou Span lines - for those who use the 3 Chikou Span strategy -9, -26, -52 from the current bar ----> forward.
Points of the expected next direction of the Tenkan, Kijun, Senkou A and B lines and Senkou A and B with 0 offset.
Senkou A and B lines with 0 offset - for visualization of possible resistance/
Calculation of the angle of inclination of the Ichimoku lines - for better perception of the trend strength. A 90° scale is used for measurement, where 0 is the horizontal position of the line
Measuring the distance from the current price to the Tenkan and Kijun lines - for better interpretation of the next possible price movements
Table - all key points for opening a position are displayed in the table. But please CONSIDER THE CONTENT and THE THEORY OF CYCLES AND WAVES by Goichi Hosoda.
May the take profit be with you!
Luma DCA Tracker (BTC)Luma DCA Tracker (BTC) – Guide
Function
This indicator simulates a regular Bitcoin investment strategy (Dollar Cost Averaging). It calculates and visualizes:
Accumulated BTC amount
Average entry price
Total amount invested
Current portfolio value
Profit/loss in absolute and percentage
Settings
Investment per interval
Fixed amount to be invested at each interval (e.g., 100 USD)
Start date
The date when DCA simulation begins
Investment interval
Choose between:
daily, weekly, every 14 days, or monthly
Show investment data
Displays additional chart lines (total invested, value, profit, etc.)
Chart Elements
Orange line: Average DCA entry price
Grey dots: Entry points based on selected interval
Info box (bottom left): Live summary of all key values
Notes
Purchases are simulated at the closing price of each interval
No fees, slippage, or taxes are included
The indicator is a simulation only and not linked to an actual portfolio
Touch 30 EMA & 150 EMA - Candle Signal//@version=5
indicator("Touch 30 EMA & 150 EMA - Candle Signal", overlay=true)
// Calculate EMAs
ema30 = ta.ema(close, 30)
ema150 = ta.ema(close, 150)
// Candle types
isGreen = close > open
isRed = close < open
// Candle touches both EMAs (either open-high-low-close range includes both)
touchesBothEMAs = low <= ema30 and high >= ema30 and low <= ema150 and high >= ema150
// Signals
greenArrow = isGreen and touchesBothEMAs
redArrow = isRed and touchesBothEMAs
// Plot arrows
plotshape(greenArrow, title="Green Candle Touch", location=location.belowbar, color=color.green, style=shape.arrowup, size=size.small)
plotshape(redArrow, title="Red Candle Touch", location=location.abovebar, color=color.red, style=shape.arrowdown, size=size.small)
// Plot EMAs for reference
plot(ema30, color=color.orange, title="EMA 30")
plot(ema150, color=color.blue, title="EMA 150")
Copper to Bitcoin RatioRatio: Divides copper price by Bitcoin price (copper / bitcoin). Since copper is in USD per pound and Bitcoin is in USD, the ratio is unitless but reflects copper’s value relative to Bitcoin.
Plotting: The ratio is plotted as a blue line, with an optional 20-period simple moving average (red line) for smoothing.
This can reflect market sentiment (e.g., industrial demand vs. crypto speculation).
Copper to Gold Ratioratio = copper / gold: Calculates the ratio by dividing copper price by gold price.
plot(ratio): Plots the ratio as a blue line.
ma = ta.sma(ratio, 20): Adds a 20-period simple moving average (optional) to smooth the ratio, plotted as a red line.
A rising Copper/Gold ratio often signals economic expansion (strong copper demand relative to gold), while a falling ratio may indicate economic uncertainty or recession fears, as gold outperforms copper.
The ratio is also used as a leading indicator for 10-year U.S. Treasury yields, with a rising ratio often correlating with higher yields.
Day of Week Highlighter# 📅 Day of Week Highlighter - Global Market Edition
**Enhanced visual trading tool that highlights each day of the week with customizable colors across all major global financial market timezones.**
## 🌍 Global Market Coverage
This indicator s **27 major financial market timezones**, including:
- **Asia-Pacific**: Tokyo, Sydney, Hong Kong, Singapore, Shanghai, Seoul, Mumbai, Dubai, Auckland (New Zealand)
- **Europe**: London, Frankfurt, Zurich, Paris, Amsterdam, Moscow, Istanbul
- **Americas**: New York, Chicago, Toronto, São Paulo, Buenos Aires
- **Plus UTC and other key financial centers**
## ✨ Key Features
### 🎨 **Fully Customizable Colors**
- Individual color picker for each day of the week
- Transparent overlays that don't obstruct price action
- Professional color scheme defaults
### 🌐 **Comprehensive Timezone **
- 27 major global financial market timezones
- Automatic daylight saving time adjustments
- Perfect for multi-market analysis and global trading
### ⚙️ **Flexible Display Options**
- Toggle individual days on/off
- Optional day name labels with size control
- Clean, professional appearance
### 📊 **Trading Applications**
- **Market Session Analysis**: Identify trading patterns by day of week
- **Multi-Market Coordination**: Track different markets in their local time
- **Pattern Recognition**: Spot day-specific market behaviors
- **Risk Management**: Avoid trading on historically volatile days
## 🔧 How to Use
1. **Add to Chart**: Apply the indicator to any timeframe
2. **Select Timezone**: Choose your preferred market timezone from the dropdown
3. **Customize Colors**: Set unique colors for each day in the settings
4. **Enable/Disable Days**: Toggle specific days on or off as needed
5. **Optional Labels**: Show day names with customizable label sizes
## 💡 Pro Tips
- Use different color intensities to highlight your preferred trading days
- Combine with other session indicators for comprehensive market timing
- Perfect for swing traders who want to identify weekly patterns
- Ideal for international traders managing multiple market sessions
## 🎯 Perfect For
- Day traders tracking intraday patterns
- Swing traders analyzing weekly cycles
- International traders managing multiple markets
- Anyone wanting better visual organization of their charts
**Works on all timeframes and instruments. Set it once, trade with confidence!**
---
*Compatible with Pine Script v6 | No repainting | Lightweight performance*
Weekend Background Highlighter (UTC+12)## Weekend Background Highlighter (UTC+12)
### Description
This indicator automatically highlights weekend periods on your TradingView charts specifically for the UTC+12 timezone (New Zealand Standard Time). Perfect for traders who need to visualize market closures and weekend gaps in the New Zealand/Pacific time zone, regardless of their exchange's native timezone or chart settings.
### Key Features
- **Fixed UTC+12 Timezone**: Hardcoded to always show weekends according to UTC+12, independent of exchange or chart timezone settings
- **Customizable Appearance**: Adjust background color and opacity to match your chart theme
- **Optional Weekend Labels**: Mark the beginning of each weekend period with customizable labels
- **Debug Mode**: View real-time timezone calculations to correct weekend detection
- **Lightweight**: Minimal performance impact with efficient calculations
### Use Cases
- **Forex Traders**: Identify weekend gaps and Monday openings in NZD pairs
- **Cryptocurrency Traders**: Visualize weekend trading patterns in the Pacific timezone
- **Multi-Market Traders**: Maintain consistent weekend awareness across different exchanges
- **Risk Management**: Clearly see when markets are closed for position management
### Settings
- **Weekend Background Color**: Choose any color for the weekend highlight
- **Opacity**: Control transparency (0-100%) to maintain chart visibility
- **Show Weekend Labels**: Toggle labels marking weekend start
- **Debug Info**: Display timezone calculations for verification
### How It Works
The indicator calculates the current UTC time and adds 12 hours to determine the UTC+12 time. It then checks if the resulting day falls on Saturday or Sunday, highlighting these periods on your chart. This ensures weekends are always displayed according to New Zealand time, regardless of your broker's timezone or your local settings.
### Notes
- Weekends begin at 00:00 Saturday UTC+12 (12:00 Friday UTC)
- Weekends end at 00:00 Monday UTC+12 (12:00 Sunday UTC)
- Works on all timeframes and markets
- Compatible with Pine Script v6
### Tags
weekend, background, timezone, UTC+12, New Zealand, highlight, trading sessions, forex, crypto, time zones, market hours, pacific time
True Hour Open🧠 Why Count an Hour from 30th Minute to 30th Minute?
✅ Traditional Hour vs. Functional Hour
Traditional Time Logic: We’re used to viewing time in clean hourly chunks: 12:00 to 1:00, 1:00 to 2:00, and so on. This structure is fine for general purposes like clocks, meetings, and schedules.
Market Logic: Markets, however, don’t always respect these arbitrary human-made time divisions. Price action often develops momentum, structure, and transitions based on market participants' behavior, not on the clock.
🛠 What the Indicator Does
Marks the start of each hour at the 30th minute past the hour (e.g., 1:30, 2:30, 3:30).
Can highlight or segment candles that fall within a “30-to-30” hourly window.
Optionally draws background shading, lines, or boxes to visually group candles from one 30-minute mark to the next.
This helps you:
Visually align your trading with more accurate price behavior windows.
Anchor time blocks around actual market rhythm, not artificial time slots.
Backtest and strategize based on how candles behave in these alternative hourly segments.
📈 Summary
Trading is about timing. But great trading is about timing that makes sense.
By redefining the hour from 30 to 30, you’re not changing time—you’re aligning with how price moves in time.