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.
Users 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 account for real-time slippage or fees.
Always forward test in live or paper environments before relying on performance.
Ciclos
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 )
Volume Velocity by TenozenA new indicator is here!
Volume Velocity (VV) is designed to help identify whether the market is likely to trend or move sideways. When VV drops below 0, it suggests weak volume momentum, which often leads to choppy or range-bound price action. Conversely, a positive VV typically signals a stronger market drive, potentially indicating trend formation. (Strong reminder! Volume data quality is crucial! I suggest using volume data from futures market!)
VV is calculated using Kalman filter concepts; adapting to the state, covariance, and predictions over time, using matrix-based calculations.
To be honest, it's quite a complex method, and I’m still learning as I go. The current version is based on a translated formula that I personaly modified into Pine Script.
I’d really appreciate any insights or ideas you guys might have! Maybe there’s something I missed or a new approach I could try! Ciao!
RSC123
The indicator automatically detects if you are on 2m/5m/15m and pulls out ATR & appropriate parameters – this way you can simply change timeframes and everything syncs.
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 terms of the general idea.
You can also set the percentage of your account 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 remember 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.
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
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.
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.
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.
亚欧美盘开关及交接时段标记 - 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 为欧美盘交接期,是重要的波动衰减与等待爆发阶段
适合关注全球交易时段切换规律的中短线交易者,特别对黄金与外汇价格行为策略有重要参考意义。
EMA 1 Cross EMA 30 Alertswith this indicator you can create alert for the ema 1 crossing ema 30 if the crossing is up word you can go for long trade. if the crossing is down word you can go for short trade
Eliora Phase 4.2.2 – Precision Bloom Mode | DAX 5minPhase shifts and market cohesion using math. Sure! Let’s break down the **simple trading bot concept** for **TradingView** step by step, focusing on the logic, purpose, and key elements of the strategy. This bot uses a **trend-following strategy** combined with **risk management** to automate trades based on moving averages and the RSI indicator.
---
### **Trading Bot Concept:**
#### **Objective:**
The primary objective of this bot is to **identify trends** and **execute buy and sell orders** based on those trends, while also ensuring **risk management** through stop-loss and take-profit levels.
The bot uses two **core indicators**:
* **Exponential Moving Averages (EMAs)**: To identify the trend direction.
* **Relative Strength Index (RSI)**: To filter out overbought and oversold conditions, helping avoid entering trades during extreme market conditions.
---
### **Key Components:**
#### 1. **Exponential Moving Averages (EMA)**
* **50-period EMA** (Short-Term Trend): Tracks the price's movement in the recent past, offering more weight to recent prices. This helps the bot react quicker to short-term market shifts.
* **200-period EMA** (Long-Term Trend): Represents the broader market trend, helping the bot assess the overall market direction.
**Buy Signal**:
* A buy signal is triggered when the **50-period EMA crosses above** the **200-period EMA** (a **bullish crossover**), suggesting that the market is entering an uptrend.
**Sell Signal**:
* A sell signal is triggered when the **50-period EMA crosses below** the **200-period EMA** (a **bearish crossover**), indicating that the market might be reversing into a downtrend.
#### 2. **Relative Strength Index (RSI)**
* **RSI** is a momentum oscillator that measures the speed and change of price movements, indicating whether an asset is overbought or oversold.
* **Buy Condition**: The bot only takes buy trades if the **RSI is above 30**. This ensures that the market isn't in an **oversold** condition, which could indicate a potential reversal.
* **Sell Condition**: The bot will only take sell actions if the **RSI is below 70**, avoiding trades during **overbought** conditions where prices might be excessively high.
---
### **How the Bot Works:**
1. **Buy Signal Conditions:**
* The **50-period EMA** crosses **above** the **200-period EMA** (bullish crossover), indicating the potential start of an uptrend.
* The **RSI is above 30**, ensuring that the market isn’t oversold and a reversal isn’t imminent.
* If both of these conditions are true, the bot will **enter a long (buy) position**.
2. **Sell Signal Conditions:**
* The **50-period EMA** crosses **below** the **200-period EMA** (bearish crossover), signaling that the market might be transitioning into a downtrend.
* The **RSI is below 70**, meaning the market isn’t in an overbought state and the sell-off is not due to excessive bullish momentum.
* If both of these conditions are met, the bot will **exit** any long position (i.e., sell).
---
### **Risk Management:**
To protect against significant losses, the bot includes two essential features of **risk management**:
1. **Stop-Loss**:
* The bot will automatically **exit the trade if the price moves against it by 2%** (or another user-defined percentage). This minimizes potential losses in case the market moves unfavorably after entry.
2. **Take-Profit**:
* The bot will automatically **exit the trade once it reaches a profit of 5%** (or another user-defined percentage). This locks in profits if the market moves favorably.
---
### **Script Breakdown:**
Here’s the **key flow** of the Pine Script:
1. **Define Parameters**: The script begins by defining input values for the **EMA periods** and **RSI length**. It also defines the **RSI overbought (70)** and **RSI oversold (30)** levels.
2. **Calculate the EMAs and RSI**:
* The 50-period and 200-period **EMAs** are calculated using the `ta.ema()` function.
* The **RSI** is calculated using `ta.rsi()`, and it helps determine if the asset is overbought or oversold.
3. **Trading Conditions**:
* A buy signal is generated when the **short-term EMA crosses above** the **long-term EMA** and the RSI is **above 30**.
* A sell signal is triggered when the **short-term EMA crosses below** the **long-term EMA** and the RSI is **below 70**.
4. **Strategy Execution**:
* When the buy condition is met, the bot **enters a long position** using `strategy.entry()`.
* When the sell condition is met, the bot **closes the position** using `strategy.close()`.
5. **Risk Management**:
* The `strategy.exit()` function is used to set **stop-loss** and **take-profit** values. If the price moves **2% against** the trade, the bot will exit. If it moves **5% in favor**, it will lock in profits.
---
### **Visual Elements**:
1. **EMAs**:
* The **50-period EMA** is plotted in **green**.
* The **200-period EMA** is plotted in **red**.
2. **RSI**:
* The **RSI line** is plotted in **blue** on a separate pane below the main chart.
* Horizontal lines mark the **overbought** (70) and **oversold** (30) levels, helping visualize potential reversal zones.
3. **Buy and Sell Signals**:
* When the bot triggers a buy, a **green arrow** appears on the chart.
* When it triggers a sell, a **red arrow** appears on the chart.
---
### **How to Use the Bot on TradingView:**
1. **Go to TradingView** and open a chart of the asset you want to trade.
2. **Click on the "Pine Editor"** tab at the bottom.
3. **Paste the script** provided into the editor.
4. **Click "Add to Chart"** to see the strategy in action.
5. The bot will begin executing trades based on the logic described and display buy/sell signals directly on the chart.
---
### **Advantages of This Strategy**:
* **Trend-Following**: This bot is based on the classic moving average crossover strategy, which is effective in trending markets.
* **Simple and Clear**: The logic is easy to follow and understand, making it beginner-friendly.
* **Built-in Risk Management**: The stop-loss and take-profit functionality ensures that the bot limits potential losses and locks in profits automatically.
* **Customizable**: You can easily tweak the parameters (e.g., EMA periods, RSI levels, stop-loss, take-profit) to fit different timeframes or market conditions.
---
### **Limitations**:
* **Sideways Markets**: The bot might struggle in flat or sideways markets because moving average crossovers can produce false signals.
* **No Advanced Features**: It doesn’t incorporate more advanced strategies like **momentum indicators**, **news sentiment**, or **machine learning models** for decision-making.
---
### **In Conclusion:**
This is a **basic but effective trend-following trading bot** that you can deploy on TradingView with minimal effort. It provides a great foundation for traders who want to automate a simple strategy with **risk management**, while offering plenty of room for customization and improvement.
Let me know if you want to explore more complex features or strategies, or if you need help tweaking the bot for specific assets or markets!
Enhanced MA Cloud Guru ProEnhanced MA Cloud Guru Pro — Indicator Description
The Enhanced MA Cloud Guru Pro is a multi-layered trend and signal tool designed to visualize both short-term momentum and long-term trend context using six customizable moving averages.
🔹 Core Features:
MA Clouds:
Two distinct "clouds" are plotted:
MA Cloud 1–3 (short-term trend)
MA Cloud 4–6 (long-term trend)
Clouds are color-coded: bullish, bearish, or neutral, based on moving average alignment.
Contrarian Crossover Signals:
Buy signal: when MA1 crosses above MA3, but long-term cloud (MA4–6) is bearish or neutral — suggesting a potential reversal or early trend shift.
Sell signal: when MA1 crosses below MA3, while MA4–6 is bullish or neutral — indicating a possible breakdown or reversal.
Cloud-to-Cloud Entry Signals:
Bullish signal: when the short-term MA cloud enters upward into the long-term cloud from below.
Bearish signal: when the short-term MA cloud enters downward into the long-term cloud from above.
These mark potential trend transition zones or conflict between timeframes.
Cooldown Logic:
Adjustable cooldown bars prevent signal clustering and reduce noise.
🔹 Customization:
All MAs are independently adjustable in length and type (SMA, EMA, WMA, HMA).
Cloud transparency, colors, and signal timing can be tailored to user preference.
🧠 Use Case:
This indicator is ideal for:
Traders who want early trend reversal clues (contrarian logic)
Visualizing interaction between short- and long-term structure
Combining momentum shifts with long-term trend filters
10 MA > 21 MA HighlightWhen the 10 day is above the 21 MA , this script will show a light green color on the screen
Multifractal Forecast [ScorsoneEnterprises]Multifractal Forecast Indicator
The Multifractal Forecast is an indicator designed to model and forecast asset price movements using a multifractal framework. It uses concepts from fractal geometry and stochastic processes, specifically the Multifractal Model of Asset Returns (MMAR) and fractional Brownian motion (fBm), to generate price forecasts based on historical price data. The indicator visualizes potential future price paths as colored lines, providing traders with a probabilistic view of price trends over a specified trading time scale. Below is a detailed breakdown of the indicator’s functionality, inputs, calculations, and visualization.
Overview
Purpose: The indicator forecasts future price movements by simulating multiple price paths based on a multifractal model, which accounts for the complex, non-linear behavior of financial markets.
Key Concepts:
Multifractal Model of Asset Returns (MMAR): Models price movements as a multifractal process, capturing varying degrees of volatility and self-similarity across different time scales.
Fractional Brownian Motion (fBm): A generalization of Brownian motion that incorporates long-range dependence and self-similarity, controlled by the Hurst exponent.
Binomial Cascade: Used to model trading time, introducing heterogeneity in time scales to reflect market activity bursts.
Hurst Exponent: Measures the degree of long-term memory in the price series (persistence, randomness, or mean-reversion).
Rescaled Range (R/S) Analysis: Estimates the Hurst exponent to quantify the fractal nature of the price series.
Inputs
The indicator allows users to customize its behavior through several input parameters, each influencing the multifractal model and forecast generation:
Maximum Lag (max_lag):
Type: Integer
Default: 50
Minimum: 5
Purpose: Determines the maximum lag used in the rescaled range (R/S) analysis to calculate the Hurst exponent. A higher lag increases the sample size for Hurst estimation but may smooth out short-term dynamics.
2 to the n values in the Multifractal Model (n):
Type: Integer
Default: 4
Purpose: Defines the resolution of the multifractal model by setting the size of arrays used in calculations (N = 2^n). For example, n=4 results in N=16 data points. Larger n increases computational complexity and detail but may exceed Pine Script’s array size limits (capped at 100,000).
Multiplier for Binomial Cascade (m):
Type: Float
Default: 0.8
Purpose: Controls the asymmetry in the binomial cascade, which models trading time. The multiplier m (and its complement 2.0 - m) determines how mass is distributed across time scales. Values closer to 1 create more balanced cascades, while values further from 1 introduce more variability.
Length Scale for fBm (L):
Type: Float
Default: 100,000.0
Purpose: Scales the fractional Brownian motion output, affecting the amplitude of simulated price paths. Larger values increase the magnitude of forecasted price movements.
Cumulative Sum (cum):
Type: Integer (0 or 1)
Default: 1
Purpose: Toggles whether the fBm output is cumulatively summed (1=On, 0=Off). When enabled, the fBm series is accumulated to simulate a price path with memory, resembling a random walk with long-range dependence.
Trading Time Scale (T):
Type: Integer
Default: 5
Purpose: Defines the forecast horizon in bars (20 bars into the future). It also scales the binomial cascade’s output to align with the desired trading time frame.
Number of Simulations (num_simulations):
Type: Integer
Default: 5
Minimum: 1
Purpose: Specifies how many forecast paths are simulated and plotted. More simulations provide a broader range of possible price outcomes but increase computational load.
Core Calculations
The indicator combines several mathematical and statistical techniques to generate price forecasts. Below is a step-by-step explanation of its calculations:
Log Returns (lgr):
The indicator calculates log returns as math.log(close / close ) when both the current and previous close prices are positive. This measures the relative price change in a logarithmic scale, which is standard for financial time series analysis to stabilize variance.
Hurst Exponent Estimation (get_hurst_exponent):
Purpose: Estimates the Hurst exponent (H) to quantify the degree of long-term memory in the price series.
Method: Uses rescaled range (R/S) analysis:
For each lag from 2 to max_lag, the function calc_rescaled_range computes the rescaled range:
Calculate the mean of the log returns over the lag period.
Compute the cumulative deviation from the mean.
Find the range (max - min) of the cumulative deviation.
Divide the range by the standard deviation of the log returns to get the rescaled range.
The log of the rescaled range (log(R/S)) is regressed against the log of the lag (log(lag)) using the polyfit_slope function.
The slope of this regression is the Hurst exponent (H).
Interpretation:
H = 0.5: Random walk (no memory, like standard Brownian motion).
H > 0.5: Persistent behavior (trends tend to continue).
H < 0.5: Mean-reverting behavior (price tends to revert to the mean).
Fractional Brownian Motion (get_fbm):
Purpose: Generates a fractional Brownian motion series to model price movements with long-range dependence.
Inputs: n (array size 2^n), H (Hurst exponent), L (length scale), cum (cumulative sum toggle).
Method:
Computes covariance for fBm using the formula: 0.5 * (|i+1|^(2H) - 2 * |i|^(2H) + |i-1|^(2H)).
Uses Hosking’s method (referenced from Columbia University’s implementation) to generate fBm:
Initializes arrays for covariance (cov), intermediate calculations (phi, psi), and output.
Iteratively computes the fBm series by incorporating a random term scaled by the variance (v) and covariance structure.
Applies scaling based on L / N^H to adjust the amplitude.
Optionally applies cumulative summation if cum = 1 to produce a path with memory.
Output: An array of 2^n values representing the fBm series.
Binomial Cascade (get_binomial_cascade):
Purpose: Models trading time (theta) to account for non-uniform market activity (e.g., bursts of volatility).
Inputs: n (array size 2^n), m (multiplier), T (trading time scale).
Method:
Initializes an array of size 2^n with values of 1.0.
Iteratively applies a binomial cascade:
For each block (from 0 to n-1), splits the array into segments.
Randomly assigns a multiplier (m or 2.0 - m) to each segment, redistributing mass.
Normalizes the array by dividing by its sum and scales by T.
Checks for array size limits to prevent Pine Script errors.
Output: An array (theta) representing the trading time, which warps the fBm to reflect market activity.
Interpolation (interpolate_fbm):
Purpose: Maps the fBm series to the trading time scale to produce a forecast.
Method:
Computes the cumulative sum of theta and normalizes it to .
Interpolates the fBm series linearly based on the normalized trading time.
Ensures the output aligns with the trading time scale (T).
Output: An array of interpolated fBm values representing log returns over the forecast horizon.
Price Path Generation:
For each simulation (up to num_simulations):
Generates an fBm series using get_fbm.
Interpolates it with the trading time (theta) using interpolate_fbm.
Converts log returns to price levels:
Starts with the current close price.
For each step i in the forecast horizon (T), computes the price as prev_price * exp(log_return).
Output: An array of price levels for each simulation.
Visualization:
Trigger: Updates every T bars when the bar state is confirmed (barstate.isconfirmed).
Process:
Clears previous lines from line_array.
For each simulation, plots a line from the current bar’s close price to the forecasted price at bar_index + T.
Colors the line using a gradient (color.from_gradient) based on the final forecasted price relative to the minimum and maximum forecasted prices across all simulations (red for lower prices, teal for higher prices).
Output: Multiple colored lines on the chart, each representing a possible price path over the next T bars.
How It Works on the Chart
Initialization: On each bar, the indicator calculates the Hurst exponent (H) using historical log returns and prepares the trading time (theta) using the binomial cascade.
Forecast Generation: Every T bars, it generates num_simulations price paths:
Each path starts at the current close price.
Uses fBm to model log returns, warped by the trading time.
Converts log returns to price levels.
Plotting: Draws lines from the current bar to the forecasted price T bars ahead, with colors indicating relative price levels.
Dynamic Updates: The forecast updates every T bars, replacing old lines with new ones based on the latest price data and calculations.
Key Features
Multifractal Modeling: Captures complex market dynamics by combining fBm (long-range dependence) with a binomial cascade (non-uniform time).
Customizable Parameters: Allows users to adjust the forecast horizon, model resolution, scaling, and number of simulations.
Probabilistic Forecast: Multiple simulations provide a range of possible price outcomes, helping traders assess uncertainty.
Visual Clarity: Gradient-colored lines make it easy to distinguish bullish (teal) and bearish (red) forecasts.
Potential Use Cases
Trend Analysis: Identify potential price trends or reversals based on the direction and spread of forecast lines.
Risk Assessment: Evaluate the range of possible price outcomes to gauge market uncertainty.
Volatility Analysis: The Hurst exponent and binomial cascade provide insights into market persistence and volatility clustering.
Limitations
Computational Intensity: Large values of n or num_simulations may slow down execution or hit Pine Script’s array size limits.
Randomness: The binomial cascade and fBm rely on random terms (math.random), which may lead to variability between runs.
Assumptions: The model assumes log-normal price movements and fractal behavior, which may not always hold in extreme market conditions.
Adjusting Inputs:
Set max_lag based on the desired depth of historical analysis.
Adjust n for model resolution (start with 4–6 to avoid performance issues).
Tune m to control trading time variability (0.5–1.5 is typical).
Set L to scale the forecast amplitude (experiment with values like 10,000–1,000,000).
Choose T based on your trading horizon (20 for short-term, 50 for longer-term for example).
Select num_simulations for the number of forecast paths (5–10 is reasonable for visualization).
Interpret Output:
Teal lines suggest bullish scenarios, red lines suggest bearish scenarios.
A wide spread of lines indicates high uncertainty; convergence suggests a stronger trend.
Monitor Updates: Forecasts update every T bars, so check the chart periodically for new projections.
Chart Examples
This is a daily AMEX:SPY chart with default settings. We see the simulations being done every T bars and they provide a range for us to analyze with a few simulations still in the range.
On this intraday PEPPERSTONE:COCOA chart I modified the Length Scale for fBm, L, parameter to be 1000 from 100000. Adjusting the parameter as you switch between timeframes can give you more contextual simulations.
On BITSTAMP:ETHUSD I modified the L to be 1000000 to have a more contextual set of simulations with crypto's volatile nature.
With L at 100000 we see the range for NASDAQ:TLT is correctly simulated. The recent pop stays within the bounds of the highest simulation. Note this is a cherry picked example to show the power and potential of these simulations.
Technical Notes
Error Handling: The script includes checks for array size limits and division by zero (math.abs(denominator) > 1e-10, v := math.max(v, 1e-10)).
External Reference: The fBm implementation is based on Hosking’s method (www.columbia.edu), ensuring a robust algorithm.
Conclusion
The Multifractal Forecast is a powerful tool for traders seeking to model complex market dynamics using a multifractal framework. By combining fBm, binomial cascades, and Hurst exponent analysis, it generates probabilistic price forecasts that account for long-range dependence and non-uniform market activity. Its customizable inputs and clear visualizations make it suitable for both technical analysis and strategy development, though users should be mindful of its computational demands and parameter sensitivity. For optimal use, experiment with input settings and validate forecasts against other technical indicators or market conditions.
Setup Score OscillatorSetup Score Oscillator – Full Description
🎯 Purpose of the Script
This script is a manual trading setup scoring tool, designed to help traders quantify the quality of a trade setup by combining multiple technical, cyclical, and contextual signals.
Instead of relying on a single indicator, the trader manually selects which signals are present, and the script calculates a total score (0–100%), displayed as an oscillator in a separate panel (like RSI or MACD).
🔧 How it works in practice
1. Manual signal inputs
The script presents a set of checkboxes in the settings, where the trader can enable/disable the following signals:
✅ Confirmed Support/Resistance
✅ Aligned Volume Profile
✅ Favorable Cyclic Timing
✅ Valid Trend Line
✅ Aligned Cyclical Moving Averages
✅ Relevant Fibonacci Level
✅ Classic Volume Signal (spike, dry-up, etc.)
✅ Oscillator confirmation (e.g., divergences)
✅ Extreme Sentiment
✅ Relevant or incoming News
Each selected signal contributes to the total score based on its weight.
2. Scoring system
Each signal has a default weight (e.g., 20% for support/resistance, 15% for cycles, etc.).
Optionally, the trader can enable the “custom weights” checkbox and adjust each signal’s weight directly in the settings.
3. Score visualization
The final score (sum of all active weights) is plotted as an oscillator ranging from 0 to 100%, with dynamic coloring:
Range Color Meaning
0–39% Red No valid setup
40–54% Yellow Watchlist only
55–69% Orange Good setup
70–100% Green Strong setup
Several horizontal threshold lines are displayed:
50% → neutral threshold
40%, 55%, 70% → operational levels
4. Optional background coloring
When the score exceeds 55% or 70%, the oscillator background lightly changes color to highlight stronger setups (non-intrusive).
📌 Practical benefits
Objectifies subjective analysis: each decision becomes a number.
Prevents overtrading: no entries if the score is too low.
Adaptable to any trading style: swing, intraday, positional.
User-friendly: no coding needed – just tick boxes.
Italiano:
Setup Score Oscillator – Descrizione completa
🎯 Obiettivo dello script
Lo script è uno strumento manuale di valutazione dei setup di trading, pensato per aiutare il trader a quantificare la qualità di un'opportunità operativa basandosi su più segnali tecnici, ciclici e contestuali.
Invece di affidarsi a un solo indicatore, il trader seleziona manualmente quali segnali sono presenti, e lo script calcola un punteggio complessivo percentuale (0–100%), rappresentato come oscillatore in una finestra separata (tipo RSI, MACD, ecc.).
🔧 Come funziona operativamente
1. Input manuale dei segnali
Lo script mostra una serie di checkbox nelle impostazioni, dove il trader può attivare o disattivare i seguenti segnali:
✅ Supporto/Resistenza confermata
✅ Volume Profile allineato
✅ Cicli o timing favorevole
✅ Trend line valida
✅ Medie mobili cicliche allineate
✅ Livello di Fibonacci rilevante
✅ Volume classico significativo (spike, dry-up)
✅ Conferme da oscillatori (es. divergenze)
✅ Sentiment estremo (es. euforia o panico)
✅ News importanti imminenti o appena uscite
Ogni casella attiva contribuisce al punteggio totale, con un peso specifico.
2. Sistema di punteggio
Ogni segnale ha un peso predefinito (es. 20% per supporti/resistenze, 15% per cicli, ecc.).
Facoltativamente, il trader può attivare la funzione “Enable custom weights” per personalizzare i pesi di ciascun segnale direttamente da input.
3. Visualizzazione del punteggio
Il punteggio complessivo (somma dei pesi attivati) viene tracciato come oscillatore da 0 a 100%, con colori dinamici:
Range Colore Significato
0–39% Rosso Nessun setup valido
40–54% Giallo Osservazione
55–69% Arancione Setup buono
70–1005 Verde Setup forte
Sono tracciate anche delle linee guida orizzontali a:
50% → soglia neutra
40%, 55%, 70% → soglie operative
4. Colorazione dello sfondo (facoltativa)
Quando il punteggio supera 55% o 70%, lo sfondo dell’oscillatore cambia leggermente colore per evidenziare il segnale (non invasivo).
📌 Vantaggi pratici
Oggettivizza l’analisi soggettiva: ogni decisione manuale si trasforma in un numero.
Evita overtrading: se il punteggio è troppo basso, non si entra.
Adattabile a ogni stile: swing, intraday, position.
Facile da usare anche senza codice: basta spuntare le caselle.
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
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 verify 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.
Trend Strength Oscillator📌 What Is the Trend Strength Oscillator?
The Trend Strength Oscillator is a visual tool that helps traders understand the overall direction and strength of the market trend. Instead of using multiple indicators separately, this tool combines three trusted methods into one clear, color-coded bar chart. The bars change based on whether the market is strongly trending up, down, or just moving sideways.
Imagine it as a traffic light for trading:
• Green means it’s safe to consider buying (strong uptrend).
• Red means consider selling or avoiding longs (strong downtrend).
• Gray means wait, the market isn’t clearly trending.
🧠 How It Works — The 3 Main Components
1. EMA Slope
The EMA (Exponential Moving Average) tracks the average price but reacts more quickly to changes. If the EMA is rising, it means the market is likely moving upward. If it’s falling, the trend is likely downward.
2. RSI Direction
RSI (Relative Strength Index) measures momentum. This tool compares the RSI to its smoothed average. If the RSI is above its average, momentum is up. If it’s below, momentum is down.
3. ADX Strength
ADX (Average Directional Index) measures how strong a trend is, not the direction. So even if EMA and RSI agree on a trend, the ADX must confirm it’s strong enough to be worth trading.
Only when all three indicators agree do we consider it a strong trend.
🧮 What the Oscillator Shows
The result of combining those components is a number that becomes a colored bar:
• +2 means all three signals are bullish → green bar.
• -2 means all three signals are bearish → red bar.
• Anything else (e.g., mixed signals or weak ADX) → gray bar.
This makes the chart super easy to read at a glance, even for beginners.
📈 How to Use It in Trading
You can use the Trend Strength Oscillator in a few simple ways:
• Entering Trades:
Look for a green bar when you want to buy or go long. Look for a red bar when you want to sell or go short. These bars mean all systems are “go” in the same direction.
• Avoiding Mistakes:
If the bar is gray, it’s a warning that the market is undecided or weak. It’s often better to wait for a clearer signal rather than force a trade.
• Managing Existing Trades:
If you’re in a trade and the bar color shifts back to gray, that can be a clue that the trend is losing strength. You might tighten your stop-loss or take some profit.
🧭 Final Thoughts
This indicator doesn’t give you a trade entry every few minutes. Instead, it helps you stay on the right side of strong moves and avoid choppy or sideways markets. It’s especially helpful for:
• Trend-following traders
• People who want clean, simple visuals
• Beginners who get overwhelmed with too many indicators
Let me know if you'd like to see this paired with another tool like volume or MACD, or if you’d like a chart screenshot to visualize how this looks live.
Daily Range + Trading sessionsIndicator that shows daily ranges on the chart.
Marks every trading session in a day.
EMAs mit RSI & Candlestick-Signalen & großen KerzenkörpernMulti-Signal Indicator: EMAs, Candlestick Patterns & RSI Signals
This versatile indicator combines three proven technical analysis tools in a single script:
🔹 1. Exponential Moving Averages (EMAs)
Multiple EMAs are displayed on the chart, helping to quickly identify trends. You can customize the periods - ideal for short-term and long-term strategies.
🔹 2. candlestick pattern recognition
The indicator automatically recognizes common bullish and bearish candlestick formations such as:
Hammer / Hanging Man
Engulfing Pattern
Doji / Spinning Top
As soon as a pattern is recognized, a visual marker appears on the chart.
🔹 3. RSI-based signals
The Relative Strength Index (RSI) is analyzed to identify overbought and oversold conditions. Additional visual cues help to identify potential reversal points.
✅ Advantages:
All-in-one indicator - no overload from multiple scripts
Visual clarity through clear markings and coloring
Fully customizable in the settings menu
⚙️ Application:
Suitable for traders who want to trade technical patterns, follow trends or react to RSI reversal points.
Note: This indicator is for educational purposes only and is not a substitute for sound trading strategy or financial advice.