Schaff Trend Cycle Strategy for XBTUSD 15m BacktestSchaff Trend Cycle Strategy for XBTUSD 15m Backtest
Komut dosyalarını "Cycle" için ara
Zero-Lag Smoothed CycleOld indicator ! But its a simple trick to have a zero-lag smoothing effect, i think i did it because the smoothing was kinda asymmetrical with the detrended line. So even if the result appear quite good take into account that the detrended line isn't always correlated with the price.
Robust Cycle Measurement [Ehlers]The last of Ehlers Instantaneous Frequency Measurement methods.
This is a more robust version of this script.
I wrote it as a function, so you can simply copy and paste it into any script to add an adaptive period setting capability.
Cheers,
DasanC
Cosine, In-Phase & Quadrature IFM [Ehlers]Yet another method for determining the cycle of a market: this time, you have access to the two fastest and most accurate methods
as well as the option to average these methods together.
The controls are pretty straight forward:
Source lets you select the price data to perform calculations on (close, open, etc..)
Max Period is simply the cap for the algorithm when it's checking the validity of Periods.
-> If you notice your plots have a flat top, then increase this value to accept a wider range of Periods.
-> This setting has a min. value of 8 to reduce noise and a max of 100 to ignore waves from higher time frames.
Average? simply averages the two methods of calculation.
-> You may want to do this if you notice the two plots diverging a lot.
-> Cosine IFM tends to favor shorter periods; I-Q IFM tends to favor longer.
Cheers,
- DasanC
Ehlers Cyber Cycle StrategyEhlers Cyber Cycle Strategy by John Ehlers from his book "Cybernetic Analysis for Stocks and Futures".
Ichimoku BoxIntroducing Ichimoku Box Indicator:
Key Features:
Customizable Box Periods: Adjustable box periods with default settings of 9, 26, and 52.
Shifted Span A and Span B Points: Easily adjustable shifts and colors.
Additional Box Option: Capability to add an extra box for more detailed analysis.
High and Low Markers: Identifies the highest and lowest candle within each box with distinct markers.
Candle Countdown Timer: Displays the remaining candles before a box loses its high or low.
Drag-and-Drop Functionality: Move boxes to any position on the chart with a vertical line.
Automatic Box Drawing: When the indicator is first applied, a vertical line appears on the mouse cursor, and clicking on any point automatically draws the boxes.
How It Works:
The indicator allows users to visualize Ichimoku periods as boxes, highlighting key price levels and shifts in market structure. It simplifies the analysis process by providing visual cues and customizable settings for enhanced flexibility.
Silver Bullet Kill Zones w/ Alerts & Countdown (CST)“Silver Bullet Kill Zones with Alerts & Countdown (CST)” is a TradingView overlay that automatically highlights the four key “Silver Bullet” liquidity windows in Beijing time—Asia (08:00–09:00), London (14:00–15:00), New York AM (22:00–23:00), and New York PM (02:00–03:00). Each session block is shaded and labeled in its own color, with built-in alerts firing once at session start and a real-time countdown showing time until the next window. Perfect for traders who need to focus on high-probability, institution-driven moves without missing a beat.
Crypto Month SeparatorAn indicator that adds monthly separators as well as counts percent change during the month, from month open to close.
🔁 Divergence Detector (RSI + MACD)//@version=5
indicator("🔁 Divergence Detector (RSI + MACD)", overlay=true)
// === INPUTS ===
useRSI = input.bool(true, "Enable RSI Divergence")
useMACD = input.bool(true, "Enable MACD Divergence")
rsiSource = input.source(close, "RSI Source")
rsiLength = input.int(14, "RSI Length")
macdSrc = input.source(close, "MACD Source")
macdFast = input.int(12, "MACD Fast Length")
macdSlow = input.int(26, "MACD Slow Length")
macdSig = input.int(9, "MACD Signal Smoothing")
lookback = input.int(20, "Lookback Range")
// === INDICATOR CALCULATIONS ===
rsi = ta.rsi(rsiSource, rsiLength)
= ta.macd(macdSrc, macdFast, macdSlow, macdSig)
macdHist = macdLine - signalLine
// === DIVERGENCE DETECTION ===
var float lastLowPrice = na
var float lastLowRSI = na
var float lastLowMACD = na
var float lastHighPrice = na
var float lastHighRSI = na
var float lastHighMACD = na
bullDivRSI = false
bearDivRSI = false
revBullDivRSI = false
revBearDivRSI = false
bullDivMACD = false
bearDivMACD = false
revBullDivMACD = false
revBearDivMACD = false
// Detect bottoms (for Bullish Divergences)
if ta.lowestbars(low, 3) == 1
// Store recent low
bullCondition = true
// RSI
if useRSI
if not na(lastLowRSI)
bullDivRSI := (low < lastLowPrice) and (rsi > lastLowRSI)
revBullDivRSI := (low > lastLowPrice) and (rsi < lastLowRSI)
lastLowPrice := low
lastLowRSI := rsi
// MACD
if useMACD
if not na(lastLowMACD)
bullDivMACD := (low < lastLowPrice) and (macdHist > lastLowMACD)
revBullDivMACD := (low > lastLowPrice) and (macdHist < lastLowMACD)
lastLowMACD := macdHist
// Detect tops (for Bearish Divergences)
if ta.highestbars(high, 3) == 1
// RSI
if useRSI
if not na(lastHighRSI)
bearDivRSI := (high > lastHighPrice) and (rsi < lastHighRSI)
revBearDivRSI := (high < lastHighPrice) and (rsi > lastHighRSI)
lastHighPrice := high
lastHighRSI := rsi
// MACD
if useMACD
if not na(lastHighMACD)
bearDivMACD := (high > lastHighPrice) and (macdHist < lastHighMACD)
revBearDivMACD := (high < lastHighPrice) and (macdHist > lastHighMACD)
lastHighMACD := macdHist
// === PLOTS ===
// RSI-based Divergences
plotshape(bullDivRSI, title="Bullish RSI Div", location=location.belowbar, color=color.green, style=shape.labelup, text="RSI\nBull Div")
plotshape(bearDivRSI, title="Bearish RSI Div", location=location.abovebar, color=color.red, style=shape.labeldown, text="RSI\nBear Div")
plotshape(revBullDivRSI, title="Rev Bull RSI", location=location.belowbar, color=color.lime, style=shape.triangleup, text="RSI\nRevBull")
plotshape(revBearDivRSI, title="Rev Bear RSI", location=location.abovebar, color=color.orange, style=shape.triangledown, text="RSI\nRevBear")
// MACD-based Divergences
plotshape(bullDivMACD, title="Bullish MACD Div", location=location.belowbar, color=color.navy, style=shape.labelup, text="MACD\nBull Div")
plotshape(bearDivMACD, title="Bearish MACD Div", location=location.abovebar, color=color.maroon, style=shape.labeldown, text="MACD\nBear Div")
plotshape(revBullDivMACD, title="Rev Bull MACD", location=location.belowbar, color=color.blue, style=shape.triangleup, text="MACD\nRevBull")
plotshape(revBearDivMACD, title="Rev Bear MACD", location=location.abovebar, color=color.purple, style=shape.triangledown, text="MACD\nRevBear")
Cassures Tokyo pendant New York//@version=5
indicator("Cassures Tokyo pendant New York", overlay=true)
// Paramètres de sessions
// Début et fin de Tokyo (00h00 - 08h00 GMT)
tokyo_start = timestamp("GMT+0", year(timenow), month(timenow), dayofmonth(timenow), 0, 0)
tokyo_end = timestamp("GMT+0", year(timenow), month(timenow), dayofmonth(timenow), 8, 0)
// Début et fin de New York (13h30 - 22h00 GMT)
ny_start = timestamp("GMT+0", year(timenow), month(timenow), dayofmonth(timenow), 13, 30)
ny_end = timestamp("GMT+0", year(timenow), month(timenow), dayofmonth(timenow), 22, 0)
// Initialisation des variables persistantes
var float tokyo_high = na
var float tokyo_low = na
var bool ny_started = false
var bool high_broken = false
var bool low_broken = false
// Reset des valeurs à chaque nouvelle journée
if (time >= tokyo_start and time < tokyo_end)
tokyo_high := na
tokyo_low := na
high_broken := false
low_broken := false
ny_started := false
// Détection du high/low Tokyo
if (time >= tokyo_start and time < tokyo_end)
tokyo_high := na(tokyo_high) ? high : math.max(tokyo_high, high)
tokyo_low := na(tokyo_low) ? low : math.min(tokyo_low, low)
// Détection des cassures pendant New York
if (time >= ny_start and time < ny_end)
ny_started := true
if not na(tokyo_high) and high > tokyo_high
high_broken := true
if not na(tokyo_low) and low < tokyo_low
low_broken := true
// Affichage des niveaux Tokyo
plot(tokyo_high, "Tokyo High", color=color.green, linewidth=1, style=plot.style_linebr)
plot(tokyo_low, "Tokyo Low", color=color.red, linewidth=1, style=plot.style_linebr)
// Surlignage visuel en session NY selon cassure
bgcolor(ny_started and high_broken and low_broken ? color.orange : ny_started and high_broken ? color.new(color.green, 80) : ny_started and low_broken ? color.new(color.red, 80) : na)
// Affichage texte sur le graphique
label_id = label.new(x=bar_index, y=high, text="", style=label.style_label_down, textcolor=color.white, size=size.tiny, color=color.gray)
if (ny_started)
label_text = high_broken and low_broken ? "Cassure HIGH & LOW Tokyo" :
high_broken ? "Cassure HIGH Tokyo" :
low_broken ? "Cassure LOW Tokyo" :
"Aucune cassure"
label.set_text(label_id, label_text)
label.set_xy(label_id, bar_index, high + syminfo.mintick * 10)
Daily Performance Analysis [Mr_Rakun]The Daily Performance Analysis indicator is a comprehensive trading performance tracker that analyzes your strategy's success rate and profitability across different days of the week and month. This powerful tool provides detailed statistics to help traders identify patterns in their trading performance and optimize their strategies accordingly.
Weekly Performance Analysis:
Tracks wins/losses for each day of the week (Monday through Sunday)
Calculates net profit/loss for each trading day
Shows profit factor (gross profit ÷ gross loss) for each day
Displays win rate percentage for each day
Monthly Performance Analysis:
Monitors performance for each day of the month (1-31)
Provides the same detailed metrics as weekly analysis
Helps identify monthly patterns and trends
Add to Your Strategy:
Copy the performance analysis code and integrate it into your existing Pine Script strategy
Optimize Strategy: Use insights to refine entry/exit timing or avoid trading on poor-performing days
Pattern Recognition: Identify which days of the week/month work best for your strategy
Risk Management: Avoid trading on historically poor-performing days
Strategy Optimization: Fine-tune your approach based on empirical data
Performance Tracking: Monitor long-term trends in your trading success
Data-Driven Decisions: Make informed adjustments to your trading schedule
Tageszeit Linien# Custom Time Lines Indicator
**Customizable vertical time markers for precise session tracking**
This Pine Script indicator draws up to three customizable vertical lines at specific times during the trading day, perfect for marking important market sessions, news events, or personal trading schedules.
## Features
- **Three Independent Time Lines**: Each line can be set to any hour and minute
- **Fully Customizable Times**: Set exact times (hours 0-23, minutes 0-59)
- **Individual Colors**: Each line has its own color setting
- **CET/MEZ Timezone**: All times are calculated in Central European Time
- **Adjustable Line Width**: Line thickness from 1-3 pixels
- **Full Chart Extension**: Lines extend across the entire chart height
- **Clean Design**: No price level markers, just clean time divisions
## Default Settings
- **Line 1**: 00:00 CET (Midnight) - Gray
- **Line 2**: 09:00 CET (European Market Open) - Green
- **Line 3**: 15:30 CET (US Market Open) - Red
## Customization Options
Each line can be individually configured:
- **Hour Setting**: 0-23 (24-hour format)
- **Minute Setting**: 0-59
- **Color**: Any color for each line
- **Line Width**: 1-3 pixel thickness
## Usage Examples
Perfect for traders who want to mark:
- Market opening/closing times
- News release schedules
- Personal trading sessions
- Economic calendar events
- Custom time-based strategies
- Multi-timezone trading schedules
## How to Use
1. Add the indicator to your chart
2. Open indicator settings
3. Set your desired times for each line (hour and minute)
4. Choose colors that match your chart theme
5. Adjust line width as needed
All times are automatically converted to CET/MEZ timezone for consistent European trading hours.
Goldbach Swing Points [z3nius]This script checks if the swing point's time (hour + minute) is a Goldbach number. Only works on CME futures charts.
Timing LinesSmall indicator to show third Friday of each month and triple witching events when monthly, weekly and quarterly contracts expire together.
There is also a period of max pain highlighted, when market makers try to balance options with equities before monthly option contracts expiry.
Fakeout marks events when market MAY be very turbulent
Analisis Perubahan Persentase Blok v2(Part 1: Summary)
The Block Percentage Change Analysis Indicator (APP Block) is a visual tool designed to detect significant price movements within a specific time period. Instead of analyzing each candle individually, this indicator identifies a group (block) of candles and provides a visual signal if the total price change from the first candle to the last candle in the block exceeds the percentage you specify.
The goal is to help traders quickly recognize strong momentum, potential reversals, or breakouts from consolidation phases.
(Part 2: Key Features)
Block Visualization: Automatically colors the entire block of candles that meet the criteria, making it easy to see periods of significant price movement.
Direction Detection: Uses different colors (customizable) for upward (Bullish) and downward (Bearish) movements, providing instant insight into the direction of momentum.
Full Customization: You can easily adjust the main parameters according to your trading style, asset, and timeframe:
Number of candles in one block.
Minimum percentage price change required.
Price source being analyzed (Open, High, Low, Close).
Colors for upward and downward blocks.
Alert System: Equipped with built-in alert conditions that you can set to receive notifications whenever a signal block forms.
(Section 3: How It Works)
This indicator works in a simple way:
It looks back at the number of candles you specify (e.g., 20 candles).
Then, it calculates the price change in percentage between the price on the first candle and the price on the last candle in that block.
If the change (whether up or down) exceeds the threshold you set (e.g., 2%), the entire candle block will be colored according to its direction of movement.
(Section 4: How to Use in Trading)
This indicator is flexible and can be used in various ways:
Momentum Confirmation: After a breakout from a pattern, the appearance of a green block (upward) can serve as strong confirmation that a bullish momentum is underway. The opposite applies for red blocks.
Market Exhaustion Identification: In a prolonged upward trend, the first appearance of a red block can signal the initial entry of significant selling pressure, indicating a potential reversal or correction.
Signal Filter: Use as a filter for other indicators. Example: “I will only take a buy signal from RSI if the price has just formed a green block,” to avoid false signals when the market is sideways.
(Section 5: Settings)
Number of Candles in Block: Set the length of the block being analyzed. Smaller values will be more sensitive, while larger values will indicate long-term trends.
Minimum Percentage Change (%): The threshold to trigger a signal. Adjust this value based on asset volatility (e.g., stocks may require 5%, while forex may need 1%).
Price Source: Select which price (Open, High, Low, Close) best suits your strategy. Close is the default option.
Block Color (Up/Down): Adjust the background color to match your chart theme.
(Section 6: Conclusion and Disclaimer)
We hope this indicator is useful for your analysis and trading strategies.
Remember, no indicator is 100% accurate. Always use the APP Block as part of your larger trading system, combine it with other analyses (such as market structure, support/resistance, etc.), and most importantly, always apply proper risk management.
Suggestions and feedback for further development are greatly appreciated! Happy trading!
Translated with D
Lunar Sentiment BandsThe Lunar Sentiment Bands indicator is designed to combine simple price volatility analysis with the timing of moon phases. It's based on a moving average and two bands above and below it—similar to Bollinger Bands. But unlike regular bands, the width of these adjusts dynamically depending on two key conditions: the moon phase and market volume.
Around Full Moons, markets often show emotional or volatile behavior. If there's also a surge in trading volume during that time, the indicator automatically expands the bands. This tells you the market might be gearing up for a breakout or high-energy move.
Around New Moons, things are typically quieter. If there’s no significant volume, the indicator contracts the bands. This reflects a calmer environment or a potential “coil” where price is building up energy.
Traders can use this shifting bandwidth to guide decisions. Wide bands suggest breakout potential—either to join the move or to stand back until direction becomes clearer. Narrow bands suggest you may want to trade reversals, or simply wait for volatility to return before entering a position.
This approach doesn't try to predict direction. Instead, it gives you a sense of when the market is most likely to become active or stay quiet, using the rhythm of the moon and real-time volume to shape that view.
DNAMain array blue is used for break and retest entries, driver array is used for retest entries after retracement. The arrays signify dynamic liquidity pools where price reacts from. Timeframe confluence is needed to make everything work well.
Sessions HH/LLSessions HH and LL everything marked with lines, sessions start and finish, compatible with every timeframe and you can hide whole sessions or just little parts of them.
SessionsLondon, US , ASIA open sessions
Use this indicator to highlight Above time zones to analyse trading opportunity during those sessions
Simple DCA Strategy----
### 📌 **Simple DCA Strategy with Backtest Date Filter**
This strategy implements a **Dollar-Cost Averaging (DCA)** approach for long positions, including:
* ✅ **Base Order Entry:** Starts a position with a fixed dollar amount when no position is open.
* 🔁 **Safety Orders:** Buys additional positions when the price drops by a defined percentage, increasing position size with each new entry using a multiplier.
* 🎯 **Take Profit Exit:** Closes all positions when the price reaches a profit target (in % above average entry).
* 🗓️ **Backtest Date Range:** Allows users to specify a custom start and optional end date to run the strategy only within that time window.
* 📊 **Plots:** Visualizes average entry, take profit level, and safety order trigger line.
#### ⚙️ Customizable Inputs:
* Base Order Size (\$)
* Price Deviation for Safety Orders (%)
* Maximum Safety Orders
* Order Size Multiplier
* Take Profit Target (%)
* Start and End Dates for Backtesting
This is a **long-only strategy** and is best used for backtesting performance of DCA-style accumulation under different market conditions.
----
Time Period Highlighter V2This indicator highlights custom time periods on any intraday chart in TradingView, making it easier to visualize your preferred trading sessions.
You can define up to three separate time ranges per day, each with precise start and end times down to the minute (e.g., 08:30 - 12:15, 14:00 - 16:45, and 20:00 - 22:30). The indicator shades the background of your chart during these periods, helping you quickly identify when you're most active or when specific market conditions occur.
Key Features:
Set start and end times (hours and minutes) for up to three trading sessions.
Automatically highlights these periods across any intraday timeframe.
Uses 24-hour time format aligned with your TradingView chart timezone.
Perfect for day traders, scalpers, or anyone needing clear visual cues for their trading windows.
This tool is especially useful for reviewing trading strategies, backtesting, or ensuring you're focusing on high-probability market hours.
Tip: Double-check that your chart timezone matches your desired session times for accurate highlighting.