In den Scripts nach "GOLD" suchen
dmw_3SMACross3 SMA set to 5 10 20 used to find the crossing points for pattern reversals or breakouts.
Lysergik's Stochastic SynergyThis indicator shows the average Stochastic RSI output of the 15m, 1h, 2h, 4h, and Daily Stochastic RSI. It will change in its behavior depending on the time-frame you're using, but for many markets it works best on the 30m time-frame and the daily time-frame.
It is best used along with Lysergik's Fib Cross, which will allow you to avoid false signals in the stochastic synergy indicator. If your MA cross (50, 200) indicates a direction change opposite of the stochastic RSI synergy indicator then that is a signal to wait for more price action to determine your entry/exit points.
Using the Lysergik's Fib Cross, the same applies, but remember that a golden cross (white cross symbol) followed directly by a golden ratio cross (gold cross symbol) is even further indication that the stochastic RSI needs more breathing room before reversing.
This indicator is fully adjustable for you to back-test against charts and refine the indicator to your market.
The inputs in respective order are as follows:
RSI Length, Stoch Length, Smooth K, Smooth D, Upper Limit, Lower Limit, Basis
Enjoy and remember only make trades on your own terms.
Happy trading/investing! :)
SynergySynergy
This indicator was developed for use in an investigation/tutorial using Pine Script to analyse Gold and US Dollar Index correlation.
The first indicator shall measure the percentage change between the open and close of each bar and compare it to the same percentage change of an alternative asset. Additionally, we shall color the background when the two assets move in the same direction. This should allow us to more easily see when the two assets move together and spot trends in their moment.
The yellow bars show use the percentage change in the price of gold. The blue bars show the percentage change in the price of the US Dollar index. If the bar is above zero, it means that the asset closed up. Conversely, if it is below zero, it means the asset closed down. Finally, the grey bars show bars in which the two assets closed in the same direction.
It can be used in conjunction with a second indicator (to be published soon) that provides statistics generated from this indicator.
The full free post can be found here: backtest-rookies.com
BO Willians EMA'sBo Williams is a North America/Brazilian trader. He created a trading software called PHI CUBE.
This ema ratios are very used in Brazil. They a based in the Golden Number PHI.
"There is a special ratio that can be used to describe the proportions of everything from nature's smallest building blocks, such as atoms, to the most advanced patterns in the universe, such as unimaginably large celestial bodies. Nature relies on this innate proportion to maintain balance, but the financial markets also seem to conform to this "golden ratio." Here, we take a look at some technical analysis tools that have been developed to take advantage of it.
The Mathematics
Mathematicians, scientists and naturalists have known this ratio for centuries. It's derived from something known as the Fibonacci sequence, named after its Italian founder, Leonardo Fibonacci (whose birth is assumed to be around 1175 A.D. and death around 1250 A.D.). Each term in this sequence is simply the sum of the two preceding terms (1, 1, 2, 3, 5, 8, 13, etc.).
But this sequence is not all that important; rather, it is the quotient of the adjacent terms that possesses an amazing proportion, roughly 1.618, or its inverse 0.618. This proportion is known by many names: the golden ratio, the golden mean, PHI and the divine proportion, among others. So, why is this number so important? Well, almost everything has dimensional properties that adhere to the ratio of 1.618, so it seems to have a fundamental function for the building blocks of nature. "
More here www.goldennumber.net
EMA 50, 100 and 200Draw a set of 3 EMA: 50, 100 and 200. It highlight with a circle the crossing of EMA(50) with other EMAs
IV/HV ratio 1.0 [dime]This script compares the implied volatility to the historic volatility as a ratio.
The plot indicates how high the current implied volatility for the next 30 days is relative to the actual volatility realized over the set period. This is most useful for options traders as it may show when the premiums paid on options are over valued relative to the historic risk.
The default is set to one year (252 bars) however any number of bars can be set for the lookback period for HV.
The default is set to VIX for the IV on SPX or SPY but other CBOE implied volatility indexes may be used. For /CL you have OVX/HV and for /GC you have GVX/HV.
Note that the CBOE data for these indexes may be delayed and updated EOD
and may not be suitable for intraday information. (Future versions of this script may be developed to provide a realtime intraday study. )
There is a list of many volatility indexes from CBOE listed at:
www.cboe.com
(Some may not yet be available on Tradingview)
RVX Russell 2000
VXN NASDAQ
VXO S&P 100
VXD DJIA
GVX Gold
OVX OIL
VIX3M 3-Month
VIX6M S&P 500 6-Month
VIX1Y 1-Year
VXEFA Cboe EFA ETF
VXEEM Cboe Emerging Markets ETF
VXFXI Cboe China ETF
VXEWZ Cboe Brazil ETF
VXSLV Cboe Silver ETF
VXGDX Cboe Gold Miners ETF
VXXLE Cboe Energy Sector ETF
EUVIX FX Euro
JYVIX FX Yen
BPVIX FX British Pound
EVZ Cboe EuroCurrency ETF Volatility Index
Amazon VXAZN
Apple VXAPL
Goldman Sachs VXGS
Google VXGOG
IBM VXIBM
Moving Average Cross Strategy Simply define your fast and slow M then backtest the strategy.
*First script, work in progress. Will allow you to combine two TV indicators into one.
MA Cross 50/200 - Moving Averageindicates short-term 50-day moving average AND long-term 200-day moving average CROSS
@GateTicker
Multi-Timeframe Probability Zones [DW]This is an experimental study based on multi-timeframe price action and a simple average.
Use it to quickly identify MTF support and resistance, and high probability price levels.
NOTE: Because higher timeframe levels are not certain until the interval is closed, refresh your chart as new levels are drawn.
Line Break StrategyLine Break Strategy
Entry rule:
Long on a bullish line and short on a bearish line.
Backtest:
Profit factors are shown below for three-line break.
Daily time frame, FXCM broker.
EURUSD: 1.267, USDJPY: 1.039, GBPUSD: -0.816, AUDUSD: -0.959
S&P500: -0.783, Nikkei225: 1.099
CrudeOil: 1.03, Gold: 1.196
BTCUSD: -0.883
Reference:
Steve Nison, Beyond Candlesticks - New Japanese Charting Techniques Revealed
Note:
This strategy doesn't work properly on the linebreak chart.
A good example is shown below. The entry prices are not always correct.
If you have signal, but the next candle moves in the opposite direction, the entry price is drawn at the Open of the new candle instead of the Close of the previous candle.
The results of backtest are unreliable due to this reason.
Earnings MultiplesMultiplies Quarterly Earnings x 13, x 21, x 34, x 55, x 89, x 144, x 233.
Yes its a fibonacci sequence.
"Goldilocks zone" seems to be in the 55x - 89x area.
Also when companies become profitable, the indicator looks like a "starburst".
EMA & SMA with FRACTAL DEVIATION BANDS by @XeL_ArjonaEMA & SMA with FRACTAL DEVIATION BANDS
Ver. 1.0.25.08.2015
By Ricardo M Arjona @XeL_Arjona
DISCLAIMER:
DISCLAIMER:
The Following indicator/code IS NOT intended to be a formal investment advice or recommendation by the author, nor should be construed as such. Users will be fully responsible by their use regarding their own trading vehicles/assets. The embedded code and ideas within this work are FREELY AND PUBLICLY available on the Web for NON LUCRATIVE ACTIVITIES and must remain as is.
WHAT IS THIS?
This is the adaptation of the FRACTAL DEVIATION BANDS to be used on Traditional Moving Averages (Simple & Exponential).
ALL NEW IDEAS OR MODIFICATIONS to these indicator(s) are Welcome in favor to deploy a better and more accurate readings. I will be very glad to be notified at Twitter or TradingVew accounts at: @XeL_Arjona
Any important addition to this work MUST REMAIN PUBLIC by means of CreativeCommons CC & TradingView.
2015
EMA 50/200 Cross AlertsFor setting up alerts when the 50-period EMA crosses the 200-period EMA. Crossing above signals a potential bullish trend shift (golden cross). Crossing below signals a potential bearish trend shift (death cross).
DeeptestDeeptest: Quantitative Backtesting Library for Pine Script
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
█ OVERVIEW
Deeptest is a Pine Script library that provides quantitative analysis tools for strategy backtesting. It calculates over 100 statistical metrics including risk-adjusted return ratios (Sharpe, Sortino, Calmar), drawdown analysis, Value at Risk (VaR), Conditional VaR, and performs Monte Carlo simulation and Walk-Forward Analysis.
█ WHY THIS LIBRARY MATTERS
Pine Script is a simple yet effective coding language for algorithmic and quantitative trading. Its accessibility enables traders to quickly prototype and test ideas directly within TradingView. However, the built-in strategy tester provides only basic metrics (net profit, win rate, drawdown), which is often insufficient for serious strategy evaluation.
Due to this limitation, many traders migrate to alternative backtesting platforms that offer comprehensive analytics. These platforms require other language programming knowledge, environment setup, and significant time investment—often just to test a simple trading idea.
Deeptest bridges this gap by bringing institutional-level quantitative analytics directly to Pine Script. Traders can now perform sophisticated analysis without leaving TradingView or learning complex external platforms. All calculations are derived from strategy.closedtrades.* , ensuring compatibility with any existing Pine Script strategy.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
█ ORIGINALITY AND USEFULNESS
This library is original work that adds value to the TradingView community in the following ways:
1. Comprehensive Metric Suite: Implements 112+ statistical calculations in a single library, including advanced metrics not available in TradingView's built-in tester (p-value, Z-score, Skewness, Kurtosis, Risk of Ruin).
2. Monte Carlo Simulation: Implements trade-sequence randomization to stress-test strategy robustness by simulating 1000+ alternative equity curves.
3. Walk-Forward Analysis: Divides historical data into rolling in-sample and out-of-sample windows to detect overfitting by comparing training vs. testing performance.
4. Rolling Window Statistics: Calculates time-varying Sharpe, Sortino, and Expectancy to analyze metric consistency throughout the backtest period.
5. Interactive Table Display: Renders professional-grade tables with color-coded thresholds, tooltips explaining each metric, and period analysis cards for drawdowns/trades.
6. Benchmark Comparison: Automatically fetches S&P 500 data to calculate Alpha, Beta, and R-squared, enabling objective assessment of strategy skill vs. passive investing.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
█ KEY FEATURES
Performance Metrics
Net Profit, CAGR, Monthly Return, Expectancy
Profit Factor, Payoff Ratio, Sample Size
Compounding Effect Analysis
Risk Metrics
Sharpe Ratio, Sortino Ratio, Calmar Ratio (MAR)
Martin Ratio, Ulcer Index
Max Drawdown, Average Drawdown, Drawdown Duration
Risk of Ruin, R-squared (equity curve linearity)
Statistical Distribution
Value at Risk (VaR 95%), Conditional VaR
Skewness (return asymmetry)
Kurtosis (tail fatness)
Z-Score, p-value (statistical significance testing)
Trade Analysis
Win Rate, Breakeven Rate, Loss Rate
Average Trade Duration, Time in Market
Consecutive Win/Loss Streaks with Expected values
Top/Worst Trades with R-multiple tracking
Advanced Analytics
Monte Carlo Simulation (1000+ iterations)
Walk-Forward Analysis (rolling windows)
Rolling Statistics (time-varying metrics)
Out-of-Sample Testing
Benchmark Comparison
Alpha (excess return vs. benchmark)
Beta (systematic risk correlation)
Buy & Hold comparison
R-squared vs. benchmark
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
█ QUICK START
Basic Usage
//@version=6
strategy("My Strategy", overlay=true)
// Import the library
import Fractalyst/Deeptest/1 as *
// Your strategy logic
fastMA = ta.sma(close, 10)
slowMA = ta.sma(close, 30)
if ta.crossover(fastMA, slowMA)
strategy.entry("Long", strategy.long)
if ta.crossunder(fastMA, slowMA)
strategy.close("Long")
// Run the analysis
DT.runDeeptest()
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
█ METRIC EXPLANATIONS
The Deeptest table displays 23 metrics across the main row, with 23 additional metrics in the complementary row. Each metric includes detailed tooltips accessible by hovering over the value.
Main Row — Performance Metrics (Columns 0-6)
Net Profit — (Final Equity - Initial Capital) / Initial Capital × 100
— >20%: Excellent, >0%: Profitable, <0%: Loss
— Total return percentage over entire backtest period
Payoff Ratio — Average Win / Average Loss
— >1.5: Excellent, >1.0: Good, <1.0: Losses exceed wins
— Average winning trade size relative to average losing trade. Breakeven win rate = 100% / (1 + Payoff)
Sample Size — Count of closed trades
— >=30: Statistically valid, <30: Insufficient data
— Number of completed trades. Includes 95% confidence interval for win rate in tooltip
Profit Factor — Gross Profit / Gross Loss
— >=1.5: Excellent, >1.0: Profitable, <1.0: Losing
— Ratio of total winnings to total losses. Uses absolute values unlike payoff ratio
CAGR — (Final / Initial)^(365.25 / Days) - 1
— >=10%: Excellent, >0%: Positive growth
— Compound Annual Growth Rate - annualized return accounting for compounding
Expectancy — Sum of all returns / Trade count
— >0.20%: Excellent, >0%: Positive edge
— Average return per trade as percentage. Positive expectancy indicates profitable edge
Monthly Return — Net Profit / (Months in test)
— >0%: Profitable month average
— Average monthly return. Geometric monthly also shown in tooltip
Main Row — Trade Statistics (Columns 7-14)
Avg Duration — Average time in position per trade
— Mean holding period from entry to exit. Influenced by timeframe and trading style
Max CW — Longest consecutive winning streak
— Maximum consecutive wins. Expected value = ln(trades) / ln(1/winRate)
Max CL — Longest consecutive losing streak
— Maximum consecutive losses. Important for psychological risk tolerance
Win Rate — Wins / Total Trades
— Higher is better
— Percentage of profitable trades. Breakeven win rate shown in tooltip
BE Rate — Breakeven Trades / Total Trades
— Lower is better
— Percentage of trades that broke even (neither profit nor loss)
Loss Rate — Losses / Total Trades
— Lower is better
— Percentage of unprofitable trades. Together with win rate and BE rate, sums to 100%
Frequency — Trades per month
— Trading activity level. Displays intelligently (e.g., "12/mo", "1.5/wk", "3/day")
Exposure — Time in market / Total time × 100
— Lower = less risk
— Percentage of time the strategy had open positions
Main Row — Risk Metrics (Columns 15-22)
Sharpe Ratio — (Return - Rf) / StdDev × sqrt(Periods)
— >=3: Excellent, >=2: Good, >=1: Fair, <1: Poor
— Measures risk-adjusted return using total volatility. Annualized using sqrt(252) for daily
Sortino Ratio — (Return - Rf) / DownsideDev × sqrt(Periods)
— >=2: Excellent, >=1: Good, <1: Needs improvement
— Similar to Sharpe but only penalizes downside volatility. Can be higher than Sharpe
Max DD — (Peak - Trough) / Peak × 100
— <5%: Excellent, 5-15%: Moderate, 15-30%: High, >30%: Severe
— Largest peak-to-trough decline in equity. Critical for risk tolerance and position sizing
RoR — Risk of Ruin probability
— <1%: Excellent, 1-5%: Acceptable, 5-10%: Elevated, >10%: Dangerous
— Probability of losing entire trading account based on win rate and payoff ratio
R² — R-squared of equity curve vs. time
— >=0.95: Excellent, 0.90-0.95: Good, 0.80-0.90: Moderate, <0.80: Erratic
— Coefficient of determination measuring linearity of equity growth
MAR — CAGR / |Max Drawdown|
— Higher is better, negative = bad
— Calmar Ratio. Reward relative to worst-case loss. Negative if max DD exceeds CAGR
CVaR — Average of returns below VaR threshold
— Lower absolute is better
— Conditional Value at Risk (Expected Shortfall). Average loss in worst 5% of outcomes
p-value — Binomial test probability
— <0.05: Significant, 0.05-0.10: Marginal, >0.10: Likely random
— Probability that observed results are due to chance. Low p-value means statistically significant edge
Complementary Row — Extended Metrics
Compounding — (Compounded Return / Total Return) × 100
— Percentage of total profit attributable to compounding (position sizing)
Avg Win — Sum of wins / Win count
— Average profitable trade return in percentage
Avg Trade — Sum of all returns / Total trades
— Same as Expectancy (Column 5). Displayed here for convenience
Avg Loss — Sum of losses / Loss count
— Average unprofitable trade return in percentage (negative value)
Martin Ratio — CAGR / Ulcer Index
— Similar to Calmar but uses Ulcer Index instead of Max DD
Rolling Expectancy — Mean of rolling window expectancies
— Average expectancy calculated across rolling windows. Shows consistency of edge
Avg W Dur — Avg duration of winning trades
— Average time from entry to exit for winning trades only
Max Eq — Highest equity value reached
— Peak equity achieved during backtest
Min Eq — Lowest equity value reached
— Trough equity point. Important for understanding worst-case absolute loss
Buy & Hold — (Close_last / Close_first - 1) × 100
— >0%: Passive profit
— Return of simply buying and holding the asset from backtest start to end
Alpha — Strategy CAGR - Benchmark CAGR
— >0: Has skill (beats benchmark)
— Excess return above passive benchmark. Positive alpha indicates genuine value-added skill
Beta — Covariance(Strategy, Benchmark) / Variance(Benchmark)
— <1: Less volatile than market, >1: More volatile
— Systematic risk correlation with benchmark
Avg L Dur — Avg duration of losing trades
— Average time from entry to exit for losing trades only
Rolling Sharpe/Sortino — Dynamic based on win rate
— >2: Good consistency
— Rolling metric across sliding windows. Shows Sharpe if win rate >50%, Sortino if <=50%
Curr DD — Current drawdown from peak
— Lower is better
— Present drawdown percentage. Zero means at new equity high
DAR — CAGR adjusted for target DD
— Higher is better
— Drawdown-Adjusted Return. DAR^5 = CAGR if max DD = 5%
Kurtosis — Fourth moment / StdDev^4 - 3
— ~0: Normal, >0: Fat tails, <0: Thin tails
— Measures "tailedness" of return distribution (excess kurtosis)
Skewness — Third moment / StdDev^3
— >0: Positive skew (big wins), <0: Negative skew (big losses)
— Return distribution asymmetry
VaR — 5th percentile of returns
— Lower absolute is better
— Value at Risk at 95% confidence. Maximum expected loss in worst 5% of outcomes
Ulcer — sqrt(mean(drawdown^2))
— Lower is better
— Ulcer Index - root mean square of drawdowns. Penalizes both depth AND duration
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
█ MONTE CARLO SIMULATION
Purpose
Monte Carlo simulation tests strategy robustness by randomizing the order of trades while keeping trade returns unchanged. This simulates alternative equity curves to assess outcome variability.
Method
Extract all historical trade returns
Randomly shuffle the sequence (1000+ iterations)
Calculate cumulative equity for each shuffle
Build distribution of final outcomes
Output
The stress test table shows:
Median Outcome: 50th percentile result
5th Percentile: Worst 5% of outcomes
95th Percentile: Best 95% of outcomes
Success Rate: Percentage of simulations that were profitable
Interpretation
If 95% of simulations are profitable: Strategy is robust
If median is far from actual result: High variance/unreliability
If 5th percentile shows large loss: High tail risk
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
█ WALK-FORWARD ANALYSIS
Purpose
Walk-Forward Analysis (WFA) is the gold standard for detecting strategy overfitting. It simulates real-world trading by dividing historical data into rolling "training" (in-sample) and "validation" (out-of-sample) periods. A strategy that performs well on unseen data is more likely to succeed in live trading.
Method
The implementation uses a non-overlapping window approach following AmiBroker's gold standard methodology:
Segment Calculation: Total trades divided into N windows (default: 12), IS = ~75%, OOS = ~25%, Step = OOS length
Window Structure: Each window has IS (training) followed by OOS (validation). Each OOS becomes the next window's IS (rolling forward)
Metrics Calculated: CAGR, Sharpe, Sortino, MaxDD, Win Rate, Expectancy, Profit Factor, Payoff
Aggregation: IS metrics averaged across all IS periods, OOS metrics averaged across all OOS periods
Output
IS CAGR: In-sample annualized return
OOS CAGR: Out-of-sample annualized return ( THE key metric )
IS/OOS Sharpe: In/out-of-sample risk-adjusted return
Success Rate: % of OOS windows that were profitable
Interpretation
Robust: IS/OOS CAGR gap <20%, OOS Success Rate >80%
Some Overfitting: CAGR gap 20-50%, Success Rate 50-80%
Severe Overfitting: CAGR gap >50%, Success Rate <50%
Key Principles:
OOS is what matters — Only OOS predicts live performance
Consistency > Magnitude — 10% IS / 9% OOS beats 30% IS / 5% OOS
Window count — More windows = more reliable validation
Non-overlapping OOS — Prevents data leakage
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
█ TABLE DISPLAY
Main Table — Organized into three sections:
Performance Metrics (Cols 0-6): Net Profit, Payoff, Sample Size, Profit Factor, CAGR, Expectancy, Monthly
Trade Statistics (Cols 7-14): Avg Duration, Max CW, Max CL, Win, BE, Loss, Frequency, Exposure
Risk Metrics (Cols 15-22): Sharpe, Sortino, Max DD, RoR, R², MAR, CVaR, p-value
Color Coding
🟢 Green: Excellent performance
🟠 Orange: Acceptable performance
⚪ Gray: Neutral / Fair
🔴 Red: Poor performance
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
█ IMPLEMENTATION NOTES
Data Source: All metrics calculated from strategy.closedtrades , ensuring compatibility with any Pine Script strategy
Calculation Timing: All calculations occur on barstate.islastconfirmedhistory to optimize performance
Limitations: Requires at least 1 closed trade for basic metrics, 30+ trades for reliable statistical analysis
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
█ QUICK NOTES
➙ This library has been developed and refined over two years of real-world strategy testing. Every calculation has been validated against industry-standard quantitative finance references.
➙ The entire codebase is thoroughly documented inline. If you are curious about how a metric is calculated or want to understand the implementation details, dive into the source code -- it is written to be read and learned from.
➙ This description focuses on usage and concepts rather than exhaustively listing every exported type and function. The library source code is thoroughly documented inline -- explore it to understand implementation details and internal logic.
➙ All calculations execute on barstate.islastconfirmedhistory to minimize runtime overhead. The library is designed for efficiency without sacrificing accuracy.
➙ Beyond analysis, this library serves as a learning resource. Study the source code to understand quantitative finance concepts, Pine Script advanced techniques, and proper statistical methodology.
➙ Metrics are their own not binary good/bad indicators. A high Sharpe ratio with low sample size is misleading. A deep drawdown during a market crash may be acceptable. Study each function and metric individually -- evaluate your strategy contextually, not by threshold alone.
➙ All strategies face alpha decay over time. Instead of over-optimizing a single strategy on one timeframe and market, build a diversified portfolio across multiple markets and timeframes. Deeptest helps you validate each component so you can combine robust strategies into a trading portfolio.
➙ Screenshots shown in the documentation are solely for visual representation to demonstrate how the tables and metrics will be displayed. Please do not compare your strategy's performance with the metrics shown in these screenshots -- they are illustrative examples only, not performance targets or benchmarks.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
█ HOW-TO
Using Deeptest is intentionally straightforward. Just import the library and call DT.runDeeptest() at the end of your strategy code in main scope. .
//@version=6
strategy("My Strategy", overlay=true)
// Import the library
import Fractalyst/Deeptest/1 as DT
// Your strategy logic
fastMA = ta.sma(close, 10)
slowMA = ta.sma(close, 30)
if ta.crossover(fastMA, slowMA)
strategy.entry("Long", strategy.long)
if ta.crossunder(fastMA, slowMA)
strategy.close("Long")
// Run the analysis
DT.runDeeptest()
And yes... it's compatible with any TradingView Strategy! 🪄
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
█ CREDITS
Author: @Fractalyst
Font Library: by @fikira - @kaigouthro - @Duyck
Community: Inspired by the @PineCoders community initiative, encouraging developers to contribute open-source libraries and continuously enhance the Pine Script ecosystem for all traders.
if you find Deeptest valuable in your trading journey, feel free to use it in your strategies and give a shoutout to @Fractalyst -- Your recognition directly supports ongoing development and open-source contributions to Pine Script.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
█ DISCLAIMER
This library is provided for educational and research purposes. Past performance does not guarantee future results. Always test thoroughly and use proper risk management. The author is not responsible for any trading losses incurred through the use of this code.
Power Hour Trendlines [LuxAlgo]The Power Hour Trendlines indicator is based on Power Hours detection, and includes up to three displayed trendlines derived from the closing prices of all the bars within the last user-selected Power Hours.
Users can edit the time of Power Hours, choose how many sessions to take into account, enable or disable any trendlines, and change their colors.
🔶 USAGE
The Power Hour is defined as the last hour of the trading session and is set by default from 3:00 p.m. to 4:00 p.m. New York time. During this period, volume and volatility enter the market. Traders using higher timeframes may use this period to enter or exit positions by placing MOC (Market on Close) orders.
This tool works under the hypothesis that prices made during power hours (periods with high trading activity) are more relevant when used for the construction of trendlines.
An initial trendline is fit using linear regression; prices from power hours located above this initial fit are used for the upper trendline, while the ones below the fit are used for the lower one.
As with any trendline, traders can analyze the slope to determine the market's direction:
Positive slope: The market is trending up.
Negative slope: The market is trending down.
No slope: The market is trending sideways.
As we can see in the image, Nasdaq and Bitcoin are clearly in downtrends, gold is clearly in an uptrend, and the euro/U.S. dollar is in a sideways market over the last visible sessions.
As you can see, the trend lines may or may not be parallel to each other. The wider the area, the more volatile the data. The narrower the area, the less volatile the data. Let's look at an example.
In the image, the Dow30 and the euro/U.S. dollar have opposite behaviors. The volatility above the middle trendline is growing in the first case but shrinking in the second. In both cases, the volatility in the bottom area seems steady, so there are no big surprises there.
Traders can adjust the number of sessions for calculations, making the tool ideal for analyzing price behavior over different time frames.
As the image shows, we can clearly see how the market behaves over different time periods. XLY has been moving down over the last 10, 20, and 40 sessions, with a steeper decline over shorter periods. However, it has been moving sideways over the last 70 sessions.
One of the main uses of trendlines is to provide key support and resistance. In the image, SPY is shown with trendlines over the last 20 sessions. These lines provide excellent reference points for trading and observing price behavior in those areas, such as whether prices are accepted or rejected, which may trigger a response from other traders.
🔹 Not Allowed Timeframes
For obvious reasons, timeframes larger than 1H are not allowed. The Power Hour is defined as the last hour of the trading session. The tool will display a warning message if the timeframe is longer than 60 minutes.
🔶 SETTINGS
Power Hour (NY Time): Choose a custom Power Hour in New York time
Sessions Memory: Select how many Power Hours to take into account for calculations.
🔹 Style
Top: Enable or disable the top line and choose the line and background colors.
Middle: Enable or disable the middle line and choose the line color.
Bottom: Enable or disable the bottom line and choose the line and background colors.
Background: Enable or disable the background color for top and bottom lines.
Bloomberg Mega Board [v2.5 Fixed]Transform your TradingView chart into a professional-grade command center. Designed for traders who need high-level market awareness without switching tabs, this dashboard provides deep, multi-timeframe analysis across US Sectors, Commodities, Currencies, and Crypto.
Key Features
1. Multi-Asset Paging System Pine Script has a limit of 40 security calls, which usually limits how much data you can see. This script bypasses that limitation using a smart Paging System:
Sectors Page: Tracks the top 10 US Sectors (SPY, XLK, XLF, etc.) & Indices.
Commodities Page: Gold, Silver, Oil, Gas, Copper, Corn, etc.
Currencies Page: Major Forex pairs including DXY, EURUSD, USDJPY.
Crypto Page: Top 10 Cryptocurrencies by volume.
Switch pages instantly via the Settings menu.
2. Smart "News" Headlines Since Pine Script cannot access the live internet for news, this script uses an Algorithmic Headline Generator. It analyzes price action and trend alignment to generate a "Market Status" summary:
Full Bull Trend: Intraday + Daily + Weekly trends are all positive.
Strong Rally: Asset is up significantly (>1.25%) on the day.
Heavy Sell-off: Asset is down significantly (<-1.25%) on the day.
Pullback (Buy?): Daily trend is UP, but Intraday is DOWN (potential entry).
Consolidating: Market is chopping sideways.
3. Timeframe Trend Matrix Monitor momentum across the curve with a single glance. The "Trend" columns are powered by the 5 EMA (Exponential Moving Average):
Intraday: Adapts to your current chart timeframe (e.g., switch your chart to 15m to see the 15m trend).
Daily / Weekly / Monthly: These are hard coded to always show the higher timeframe trend, regardless of what chart you are looking at. Trend is determined by price in relation to it's 5 EMA.
4. "Terminal" Aesthetic
Styled with a dark, high-contrast Bloomberg Terminal look.
Uses Amber tickers and Neon status blocks for rapid visual scanning.
Optimized for Full Screen Mode: Hide your main chart candles to turn your monitor into a dedicated data dashboard.
How to Use
Add the indicator to your chart and move it to "New Lower Indicator" Then repeat 4 times for each dashboard.
Open Settings (the gear icon) and find "Select Page".
Choose your desired market view (e.g., Sectors, Crypto, Currencies, Commodities)
Optional: To replicate the full dashboard look, go to your Chart Settings -> Symbol -> Uncheck "Body" and "Borders" to hide the candles behind the table.
2 hours ago
Release Notes
Transform your TradingView chart into a professional-grade command center. Designed for traders who need high-level market awareness without switching tabs, this dashboard provides deep, multi-timeframe analysis across US Sectors, Commodities, Currencies, and Crypto.
Key Features
1. Multi-Asset Paging System Pine Script has a limit of 40 security calls, which usually limits how much data you can see. This script bypasses that limitation using a smart Paging System:
Sectors Page: Tracks the top 10 US Sectors (SPY, XLK, XLF, etc.) & Indices.
Commodities Page: Gold, Silver, Oil, Gas, Copper, Corn, etc.
Currencies Page: Major Forex pairs including DXY, EURUSD, USDJPY.
Crypto Page: Top 10 Cryptocurrencies by volume.
Switch pages instantly via the Settings menu.
2. Smart "News" Headlines Since Pine Script cannot access the live internet for news, this script uses an Algorithmic Headline Generator. It analyzes price action and trend alignment to generate a "Market Status" summary:
Full Bull Trend: Intraday + Daily + Weekly trends are all positive.
Strong Rally: Asset is up significantly (>1.25%) on the day.
Heavy Sell-off: Asset is down significantly (<-1.25%) on the day.
Pullback (Buy?): Daily trend is UP, but Intraday is DOWN (potential entry).
Consolidating: Market is chopping sideways.
3. Timeframe Trend Matrix Monitor momentum across the curve with a single glance. The "Trend" columns are powered by the 5 EMA (Exponential Moving Average):
Intraday: Adapts to your current chart timeframe (e.g., switch your chart to 15m to see the 15m trend).
Daily / Weekly / Monthly: These are hard coded to always show the higher timeframe trend, regardless of what chart you are looking at. Trend is determined by price in relation to it's 5 EMA.
4. "Terminal" Aesthetic
Styled with a dark, high-contrast Bloomberg Terminal look.
Uses Amber tickers and Neon status blocks for rapid visual scanning.
Optimized for Full Screen Mode: Hide your main chart candles to turn your monitor into a dedicated data dashboard.
How to Use
Add the indicator to your chart and move it to "New Lower Indicator" Then repeat 4 times for each dashboard.
Open Settings (the gear icon) and find "Select Page".
Choose your desired market view (e.g., Sectors, Crypto, Currencies, Commodities)
Optional: To replicate the full dashboard look, go to your Chart Settings -> Symbol -> Uncheck "Body" and "Borders" to hide the candles behind the table.
2 hours ago
Release Notes
Transform your TradingView chart into a professional-grade command center. Designed for traders who need high-level market awareness without switching tabs, this dashboard provides deep, multi-timeframe analysis across US Sectors, Commodities, Currencies, and Crypto.
Key Features
1. Multi-Asset Paging System Pine Script has a limit of 40 security calls, which usually limits how much data you can see. This script bypasses that limitation using a smart Paging System:
Sectors Page: Tracks the top 10 US Sectors (SPY, XLK, XLF, etc.) & Indices.
Commodities Page: Gold, Silver, Oil, Gas, Copper, Corn, etc.
Currencies Page: Major Forex pairs including DXY, EURUSD, USDJPY.
Crypto Page: Top 10 Cryptocurrencies by volume.
Switch pages instantly via the Settings menu.
2. Smart "News" Headlines Since Pine Script cannot access the live internet for news, this script uses an Algorithmic Headline Generator. It analyzes price action and trend alignment to generate a "Market Status" summary:
Full Bull Trend: Intraday + Daily + Weekly trends are all positive.
Strong Rally: Asset is up significantly (>1.25%) on the day.
Heavy Sell-off: Asset is down significantly (<-1.25%) on the day.
Pullback (Buy?): Daily trend is UP, but Intraday is DOWN (potential entry).
Consolidating: Market is chopping sideways.
3. Timeframe Trend Matrix Monitor momentum across the curve with a single glance. The "Trend" columns are powered by the 5 EMA (Exponential Moving Average):
Intraday: Adapts to your current chart timeframe (e.g., switch your chart to 15m to see the 15m trend).
Daily / Weekly / Monthly: These are hard coded to always show the higher timeframe trend, regardless of what chart you are looking at. Trend is determined by price in relation to it's 5 EMA.
4. "Terminal" Aesthetic
Styled with a dark, high-contrast Bloomberg Terminal look.
Uses Amber tickers and Neon status blocks for rapid visual scanning.
Optimized for Full Screen Mode: Hide your main chart candles to turn your monitor into a dedicated data dashboard.
How to Use
Add the indicator to your chart and move it to "New Lower Indicator" Then repeat 4 times for each dashboard.
Open Settings (the gear icon) and find "Select Page".
Choose your desired market view (e.g., Sectors, Crypto, Currencies, Commodities)
Optional: To replicate the full dashboard look, go to your Chart Settings -> Symbol -> Uncheck "Body" and "Borders" to hide the candles behind the table.
2 hours ago
Release Notes
Transform your TradingView chart into a professional-grade command center. Designed for traders who need high-level market awareness without switching tabs, this dashboard provides deep, multi-timeframe analysis across US Sectors, Commodities, Currencies, and Crypto.
Key Features
1. Multi-Asset Paging System Pine Script has a limit of 40 security calls, which usually limits how much data you can see. This script bypasses that limitation using a smart Paging System:
Sectors Page: Tracks the top 10 US Sectors (SPY, XLK, XLF, etc.) & Indices.
Commodities Page: Gold, Silver, Oil, Gas, Copper, Corn, etc.
Currencies Page: Major Forex pairs including DXY, EURUSD, USDJPY.
Crypto Page: Top 10 Cryptocurrencies by volume.
Switch pages instantly via the Settings menu.
2. Smart "News" Headlines Since Pine Script cannot access the live internet for news, this script uses an Algorithmic Headline Generator. It analyzes price action and trend alignment to generate a "Market Status" summary:
Full Bull Trend: Intraday + Daily + Weekly trends are all positive.
Strong Rally: Asset is up significantly (>1.25%) on the day.
Heavy Sell-off: Asset is down significantly (<-1.25%) on the day.
Pullback (Buy?): Daily trend is UP, but Intraday is DOWN (potential entry).
Consolidating: Market is chopping sideways.
3. Timeframe Trend Matrix Monitor momentum across the curve with a single glance. The "Trend" columns are powered by the 5 EMA (Exponential Moving Average):
Intraday: Adapts to your current chart timeframe (e.g., switch your chart to 15m to see the 15m trend).
Daily / Weekly / Monthly: These are hard coded to always show the higher timeframe trend, regardless of what chart you are looking at. Trend is determined by price in relation to it's 5 EMA.
4. "Terminal" Aesthetic
Styled with a dark, high-contrast Bloomberg Terminal look.
Uses Amber tickers and Neon status blocks for rapid visual scanning.
Optimized for Full Screen Mode: Hide your main chart candles to turn your monitor into a dedicated data dashboard.
How to Use
Add the indicator to your chart and move it to "New Lower Indicator" Then repeat 4 times for each dashboard.
Open Settings (the gear icon) and find "Select Page".
Choose your desired market view (e.g., Sectors, Crypto, Currencies, Commodities)
Optional: To replicate the full dashboard look, go to your Chart Settings -> Symbol -> Uncheck "Body" and "Borders" to hide the candles behind the table.
Trading Sessions + IB [midst]What It Does
Displays the three major global trading sessions (Asia, London, New York) with Initial Balance (IB) ranges and extension levels. Automatically detects instrument type (ES, NQ, Gold, Silver) and applies correct IB period.
Key Features
Session Boxes: Visual high-to-low range for each session
Initial Balance: First 60 minutes of session range with IB high/mid/low lines
IB Extensions: Automatic calculation of +/-25%, 50%, 100% levels
Live IB Tracker: Real-time statistics table showing IB range, analysis, and market structure
Fully Customizable: Colors, line styles, labels, and display options
Why Use This
Identify key support/resistance levels based on session structure
Track IB breakouts for high-probability trade setups
Use extensions as profit targets or reversal zones
Compare session ranges to gauge volatility
Spot session overlaps for increased liquidity
Default Times (Chicago/Central Time)
Asia: 5:00 PM - 2:00 AM
London: 2:00 AM - 11:00 AM
New York: 7:30 AM - 4:00 PM
How To Use
Add indicator to your chart (works best on 5-15 minute timeframes)
Indicator auto-detects ES, NQ, GC, SI and applies correct 60-minute IB
Watch for price action at IB levels and extensions
Use IB Tracker table for real-time market analysis
Customization
Adjust everything: session times, IB period, colors, line styles, labels, table position. Toggle historical sessions, IB boxes, lines, extensions, and more.
Supported Instruments: ES/MES, NQ/MNQ, GC/MGC (Gold), SI (Silver) - auto-detection included
QuantLabs Mega Multi-Asset DashboardTransform your TradingView chart into a professional-grade command center. Designed for traders who need high-level market awareness without switching tabs, this dashboard provides deep, multi-timeframe analysis across US Sectors, Commodities, Currencies, and Crypto.
Key Features
1. Multi-Asset Paging System Pine Script has a limit of 40 security calls, which usually limits how much data you can see. This script bypasses that limitation using a smart Paging System:
Sectors Page: Tracks the top 10 US Sectors (SPY, XLK, XLF, etc.) & Indices.
Commodities Page: Gold, Silver, Oil, Gas, Copper, Corn, etc.
Currencies Page: Major Forex pairs including DXY, EURUSD, USDJPY.
Crypto Page: Top 10 Cryptocurrencies by volume.
Switch pages instantly via the Settings menu.
2. Smart "News" Headlines Since Pine Script cannot access the live internet for news, this script uses an Algorithmic Headline Generator. It analyzes price action and trend alignment to generate a "Market Status" summary:
Full Bull Trend: Intraday + Daily + Weekly trends are all positive.
Strong Rally: Asset is up significantly (>1.25%) on the day.
Heavy Sell-off: Asset is down significantly (<-1.25%) on the day.
Pullback (Buy?): Daily trend is UP, but Intraday is DOWN (potential entry).
Consolidating: Market is chopping sideways.
3. Timeframe Trend Matrix Monitor momentum across the curve with a single glance. The "Trend" columns are powered by the 5 EMA (Exponential Moving Average):
Intraday: Adapts to your current chart timeframe (e.g., switch your chart to 15m to see the 15m trend).
Daily / Weekly / Monthly: These are hard coded to always show the higher timeframe trend, regardless of what chart you are looking at. Trend is determined by price in relation to it's 5 EMA.
4. "Terminal" Aesthetic
Styled with a dark, high-contrast Bloomberg Terminal look.
Uses Amber tickers and Neon status blocks for rapid visual scanning.
Optimized for Full Screen Mode: Hide your main chart candles to turn your monitor into a dedicated data dashboard.
How to Use
Add the indicator to your chart and move it to "New Lower Indicator" Then repeat 4 times for each dashboard.
Open Settings (the gear icon) and find "Select Page".
Choose your desired market view (e.g., Sectors, Crypto, Currencies, Commodities)
Optional: To replicate the full dashboard look, go to your Chart Settings -> Symbol -> Uncheck "Body" and "Borders" to hide the candles behind the table.
Mashrab | Momentum X-RayStop guessing if a stock is strong or weak. The Momentum X-Ray is a professional Heads-Up Display (HUD) that tells you the truth about a stock in seconds.
Most indicators just look at price. This dashboard looks at the Context:
Relative Strength (The "King of the Hill" Check):
It doesn't just compare stocks to the S&P 500.
It automatically detects the stock's specific industry (e.g., Semiconductors, Regional Banks, Gold Miners) and compares it against its actual peers.
Green = The stock is a Leader (Beating its sector).
Red = The stock is a Laggard (Losing to its sector).
Fundamental Health (The "Engine" Check):
Instantly see Revenue Growth (QoQ and YoY) and Net Profit Margins.
Filters out "junk" stocks that are moving up on hype but have no real business growth.
Volatility Scanner:
Calculates the ADR (Average Daily Range) to help you size your positions correctly.
How to Read the Signals:
Top Table (Momentum): Look for Double Green. If a stock is beating the SPY and its Sector, it is an "Alpha Leader."
Bottom Table (Context): Check the "Industry" row to see exactly which ETF the script is using for comparison (e.g., SMH for Chips, KRE for Banks).
Trade with TreandThink of this script as a filter and a signal light for trading Gold. It helps you avoid trading in the wrong direction and tells you exactly when the price momentum is shifting.
The Three Main Parts
The Ultimate Trend (The Filter):
This is the big table in the top-right corner.
Bullish (Green): Only look for BUY signals.
Bearish (Red): Only look for SELL signals.
It uses a "300 SMA" (a long-term average) to make sure you aren't "swimming against the tide."
The Entry Signals (The Crossover):
The script watches two lines on your chart (a 20-period and a 10-period).
When they cross, it places a BUY or SELL label on your screen.
The 4 Alerts (The Notifications):
You don't have to stare at the screen all day.
You get a notification for Buy entries, Sell entries, or when the Main Trend flips from Bullish to Bearish (or vice versa).
Simple Rules for Trading
To be successful with this script, follow these four rules:
Rule 1: Check the Table. If it says "Bearish," ignore all "BUY" labels.
Rule 2: Wait for the Label. Only enter a trade when a "BUY" or "SELL" label appears and it matches the trend table.
Rule 3: Protect Your Money. Look at the last 5 candles. Put your Stop Loss just past the highest or lowest point of those candles.
Rule 4: Aim for the Target. Your profit target should be at least double the amount of money you are risking (Risk:Reward 1:2).
How to use the Settings
When you click the Settings icon on the script, you can change:
SMA Filter: Change the "300" if you want the trend to be faster or slower.
Trend Gap: Adjust how far the trailing line stays away from the price.






















