Timeshifter Triple Timeframe Strategy w/ SessionsOverview
The "Enhanced Timeshifter Triple Timeframe Strategy with Session Filtering" is a sophisticated trading strategy designed for the TradingView platform. It integrates multiple technical indicators across three different timeframes and allows traders to customize their trading Sessions. This strategy is ideal for traders who wish to leverage multi-timeframe analysis and session-based trading to enhance their trading decisions.
Features
Multi-Timeframe Analysis and direction:
Higher Timeframe: Set to a daily timeframe by default, providing a broader view of market trends.
Trading Timeframe: Automatically set to the current chart timeframe, ensuring alignment with the trader's primary analysis period.
Lower Timeframe: Set to a 15-minute timeframe by default, offering a granular view for precise entry and exit points.
Indicator Selection:
RMI (Relative Momentum Index): Combines RSI and MFI to gauge market momentum.
TWAP (Time Weighted Average Price): Provides an average price over a specified period, useful for identifying trends.
TEMA (Triple Exponential Moving Average): Reduces lag and smooths price data for trend identification.
DEMA (Double Exponential Moving Average): Similar to TEMA, it reduces lag and provides a smoother trend line.
MA (Moving Average): A simple moving average for basic trend analysis.
MFI (Money Flow Index): Measures the flow of money into and out of a security, useful for identifying overbought or oversold conditions.
VWMA (Volume Weighted Moving Average): Incorporates volume data into the moving average calculation.
PSAR (Parabolic SAR): Identifies potential reversals in price movement.
Session Filtering:
London Session: Trade during the London market hours (0800-1700 GMT+1).
New York Session: Trade during the New York market hours (0800-1700 GMT-5).
Tokyo Session: Trade during the Tokyo market hours (0900-1800 GMT+9).
Users can select one or multiple sessions to align trading with specific market hours.
Trade Direction:
Long: Only long trades are permitted.
Short: Only short trades are permitted.
Both: Both long and short trades are permitted, providing flexibility based on market conditions.
ADX Confirmation:
ADX (Average Directional Index): An optional filter to confirm the strength of a trend before entering a trade.
How to Use the Script
Setup:
Add the script to your TradingView chart.
Customize the input parameters according to your trading preferences and strategy requirements.
Indicator Selection:
Choose the primary indicator you wish to use for generating trading signals from the dropdown menu.
Enable or disable the ADX confirmation based on your preference for trend strength analysis.
Session Filtering:
Select the trading sessions you wish to trade in. You can choose one or multiple Sessions based on your trading strategy and market focus.
Trade Direction:
Set your preferred trade direction (Long, Short, or Both) to align with your market outlook and risk tolerance. You can use this feature to gauge the market and understand the possible directions.
Tips for Profitable and Safe Trading:
Recommended Timeframes Combination:
LT: 1m , CT: 5m, HT: 1H
LT: 1-5m , CT: 15m, HT: 4H
LT: 5-15m , CT: 4H, HT: 1W
Backtesting:
Always backtest the strategy on historical data to understand its performance under various market conditions.
Adjust the parameters based on backtesting results to optimize the strategy for your specific trading style.
Risk Management:
Use appropriate risk management techniques, such as setting stop-loss and take-profit levels, to protect your capital.
Avoid over-leveraging and ensure that you are trading within your risk tolerance.
Market Analysis:
Combine the script with other forms of market analysis, such as fundamental analysis or market sentiment, to make well-rounded trading decisions.
Stay informed about major economic events and news that could impact market volatility and trading sessions.
Continuous Monitoring:
Regularly monitor the strategy's performance and make adjustments as necessary.
Keep an eye on the results and settings for real-time statistics and ensure that the strategy aligns with current market conditions.
Education and Practice:
Continuously educate yourself on trading strategies and market dynamics.
Practice using the strategy in a demo account before applying it to live trading to gain confidence and understanding.
Análise de Tendência
Long/Short/Exit/Risk management Strategy # LongShortExit Strategy Documentation
## Overview
The LongShortExit strategy is a versatile trading system for TradingView that provides complete control over entry, exit, and risk management parameters. It features a sophisticated framework for managing long and short positions with customizable profit targets, stop-loss mechanisms, partial profit-taking, and trailing stops. The strategy can be enhanced with continuous position signals for visual feedback on the current trading state.
## Key Features
### General Settings
- **Trading Direction**: Choose to trade long positions only, short positions only, or both.
- **Max Trades Per Day**: Limit the number of trades per day to prevent overtrading.
- **Bars Between Trades**: Enforce a minimum number of bars between consecutive trades.
### Session Management
- **Session Control**: Restrict trading to specific times of the day.
- **Time Zone**: Specify the time zone for session calculations.
- **Expiration**: Optionally set a date when the strategy should stop executing.
### Contract Settings
- **Contract Type**: Select from common futures contracts (MNQ, MES, NQ, ES) or custom values.
- **Point Value**: Define the dollar value per point movement.
- **Tick Size**: Set the minimum price movement for accurate calculations.
### Visual Signals
- **Continuous Position Signals**: Implement 0 to 1 visual signals to track position states.
- **Signal Plotting**: Customize color and appearance of position signals.
- **Clear Visual Feedback**: Instantly see when entry conditions are triggered.
### Risk Management
#### Stop Loss and Take Profit
- **Risk Type**: Choose between percentage-based, ATR-based, or points-based risk management.
- **Percentage Mode**: Set SL/TP as a percentage of entry price.
- **ATR Mode**: Set SL/TP as a multiple of the Average True Range.
- **Points Mode**: Set SL/TP as a fixed number of points from entry.
#### Advanced Exit Features
- **Break-Even**: Automatically move stop-loss to break-even after reaching specified profit threshold.
- **Trailing Stop**: Implement a trailing stop-loss that follows price movement at a defined distance.
- **Partial Profit Taking**: Take partial profits at predetermined price levels:
- Set first partial exit point and percentage of position to close
- Set second partial exit point and percentage of position to close
- **Time-Based Exit**: Automatically exit a position after a specified number of bars.
#### Win/Loss Streak Management
- **Streak Cutoff**: Automatically pause trading after a series of consecutive wins or losses.
- **Daily Reset**: Option to reset streak counters at the start of each day.
### Entry Conditions
- **Source and Value**: Define the exact price source and value that triggers entries.
- **Equals Condition**: Entry signals occur when the source exactly matches the specified value.
### Performance Analytics
- **Real-Time Stats**: Track important performance metrics like win rate, P&L, and largest wins/losses.
- **Visual Feedback**: On-chart markers for entries, exits, and important events.
### External Integration
- **Webhook Support**: Compatible with TradingView's webhook alerts for automated trading.
- **Cross-Platform**: Connect to external trading systems and notification platforms.
- **Custom Order Execution**: Implement advanced order flows through external services.
## How to Use
### Setup Instructions
1. Add the script to your TradingView chart.
2. Configure the general settings based on your trading preferences.
3. Set session trading hours if you only want to trade specific times.
4. Select your contract specifications or customize for your instrument.
5. Configure risk parameters:
- Choose your preferred risk management approach
- Set appropriate stop-loss and take-profit levels
- Enable advanced features like break-even, trailing stops, or partial profit taking as needed
6. Define entry conditions:
- Select the price source (such as close, open, high, or an indicator)
- Set the specific value that should trigger entries
### Entry Condition Examples
- **Example 1**: To enter when price closes exactly at a whole number:
- Long Source: close
- Long Value: 4200 (for instance, to enter when price closes exactly at 4200)
- **Example 2**: To enter when an indicator reaches a specific value:
- Long Source: ta.rsi(close, 14)
- Long Value: 30 (triggers when RSI equals exactly 30)
### Best Practices
1. **Always backtest thoroughly** before using in live trading.
2. **Start with conservative risk settings**:
- Small position sizes
- Reasonable stop-loss distances
- Limited trades per day
3. **Monitor and adjust**:
- Use the performance table to track results
- Adjust parameters based on how the strategy performs
4. **Consider market volatility**:
- Use ATR-based stops during volatile periods
- Use fixed points during stable markets
## Continuous Position Signals Implementation
The LongShortExit strategy can be enhanced with continuous position signals to provide visual feedback about the current position state. These signals can help you track when the strategy is in a long or short position.
### Adding Continuous Position Signals
Add the following code to implement continuous position signals (0 to 1):
```pine
// Continuous position signals (0 to 1)
var float longSignal = 0.0
var float shortSignal = 0.0
// Update position signals based on your indicator's conditions
longSignal := longCondition ? 1.0 : 0.0
shortSignal := shortCondition ? 1.0 : 0.0
// Plot continuous signals
plot(longSignal, title="Long Signal", color=#00FF00, linewidth=2, transp=0, style=plot.style_line)
plot(shortSignal, title="Short Signal", color=#FF0000, linewidth=2, transp=0, style=plot.style_line)
```
### Benefits of Continuous Position Signals
- Provides clear visual feedback of current position state (long/short)
- Signal values stay consistent (0 or 1) until condition changes
- Can be used for additional calculations or alert conditions
- Makes it easier to track when entry conditions are triggered
### Using with Custom Indicators
You can adapt the continuous position signals to work with any custom indicator by replacing the condition with your indicator's logic:
```pine
// Example with moving average crossover
longSignal := fastMA > slowMA ? 1.0 : 0.0
shortSignal := fastMA < slowMA ? 1.0 : 0.0
```
## Webhook Integration
The LongShortExit strategy is fully compatible with TradingView's webhook alerts, allowing you to connect your strategy to external trading platforms, brokers, or custom applications for automated trading execution.
### Setting Up Webhooks
1. Create an alert on your chart with the LongShortExit strategy
2. Enable the "Webhook URL" option in the alert dialog
3. Enter your webhook endpoint URL (from your broker or custom trading system)
4. Customize the alert message with relevant information using TradingView variables
### Webhook Message Format Example
```json
{
"strategy": "LongShortExit",
"action": "{{strategy.order.action}}",
"price": "{{strategy.order.price}}",
"quantity": "{{strategy.position_size}}",
"time": "{{time}}",
"ticker": "{{ticker}}",
"position_size": "{{strategy.position_size}}",
"position_value": "{{strategy.position_value}}",
"order_id": "{{strategy.order.id}}",
"order_comment": "{{strategy.order.comment}}"
}
```
### TradingView Alert Condition Examples
For effective webhook automation, set up these alert conditions:
#### Entry Alert
```
{{strategy.position_size}} != {{strategy.position_size}}
```
#### Exit Alert
```
{{strategy.position_size}} < {{strategy.position_size}} or {{strategy.position_size}} > {{strategy.position_size}}
```
#### Partial Take Profit Alert
```
strategy.order.comment contains "Partial TP"
```
### Benefits of Webhook Integration
- **Automated Trading**: Execute trades automatically through supported brokers
- **Cross-Platform**: Connect to custom trading bots and applications
- **Real-Time Notifications**: Receive trade signals on external platforms
- **Data Collection**: Log trade data for further analysis
- **Custom Order Management**: Implement advanced order types not available in TradingView
### Compatible External Applications
- Trading bots and algorithmic trading software
- Custom order execution systems
- Discord, Telegram, or Slack notification systems
- Trade journaling applications
- Risk management platforms
### Implementation Recommendations
- Test webhook delivery using a free service like webhook.site before connecting to your actual trading system
- Include authentication tokens or API keys in your webhook URL or payload when required by your external service
- Consider implementing confirmation mechanisms to verify trade execution
- Log all webhook activities for troubleshooting and performance tracking
## Strategy Customization Tips
### For Scalping
- Set smaller profit targets (1-3 points)
- Use tighter stop-losses
- Enable break-even feature after small profit
- Set higher max trades per day
### For Day Trading
- Use moderate profit targets
- Implement partial profit taking
- Enable trailing stops
- Set reasonable session trading hours
### For Swing Trading
- Use longer-term charts
- Set wider stops (ATR-based often works well)
- Use higher profit targets
- Disable daily streak reset
## Common Troubleshooting
### Low Win Rate
- Consider widening stop-losses
- Verify that entry conditions aren't triggering too frequently
- Check if the equals condition is too restrictive; consider small tolerances
### Missing Obvious Trades
- The equals condition is extremely precise. Price must exactly match the specified value.
- Consider using floating-point precision for more reliable triggers
### Frequent Stop-Outs
- Try ATR-based stops instead of fixed points
- Increase the stop-loss distance
- Enable break-even feature to protect profits
## Important Notes
- The exact equals condition is strict and may result in fewer trade signals compared to other conditions.
- For instruments with decimal prices, exact equality might be rare. Consider the precision of your value.
- Break-even and trailing stop calculations are based on points, not percentage.
- Partial take-profit levels are defined in points distance from entry.
- The continuous position signals (0 to 1) provide valuable visual feedback but don't affect the strategy's trading logic directly.
- When implementing continuous signals, ensure they're aligned with the actual entry conditions used by the strategy.
---
*This strategy is for educational and informational purposes only. Always test thoroughly before using with real funds.*
Long/Short/Exit/Risk management Strategy # LongShortExit Strategy Documentation
## Overview
The LongShortExit strategy is a versatile trading system for TradingView that provides complete control over entry, exit, and risk management parameters. It features a sophisticated framework for managing long and short positions with customizable profit targets, stop-loss mechanisms, partial profit-taking, and trailing stops. The strategy can be enhanced with continuous position signals for visual feedback on the current trading state.
## Key Features
### General Settings
- **Trading Direction**: Choose to trade long positions only, short positions only, or both.
- **Max Trades Per Day**: Limit the number of trades per day to prevent overtrading.
- **Bars Between Trades**: Enforce a minimum number of bars between consecutive trades.
### Session Management
- **Session Control**: Restrict trading to specific times of the day.
- **Time Zone**: Specify the time zone for session calculations.
- **Expiration**: Optionally set a date when the strategy should stop executing.
### Contract Settings
- **Contract Type**: Select from common futures contracts (MNQ, MES, NQ, ES) or custom values.
- **Point Value**: Define the dollar value per point movement.
- **Tick Size**: Set the minimum price movement for accurate calculations.
### Visual Signals
- **Continuous Position Signals**: Implement 0 to 1 visual signals to track position states.
- **Signal Plotting**: Customize color and appearance of position signals.
- **Clear Visual Feedback**: Instantly see when entry conditions are triggered.
### Risk Management
#### Stop Loss and Take Profit
- **Risk Type**: Choose between percentage-based, ATR-based, or points-based risk management.
- **Percentage Mode**: Set SL/TP as a percentage of entry price.
- **ATR Mode**: Set SL/TP as a multiple of the Average True Range.
- **Points Mode**: Set SL/TP as a fixed number of points from entry.
#### Advanced Exit Features
- **Break-Even**: Automatically move stop-loss to break-even after reaching specified profit threshold.
- **Trailing Stop**: Implement a trailing stop-loss that follows price movement at a defined distance.
- **Partial Profit Taking**: Take partial profits at predetermined price levels:
- Set first partial exit point and percentage of position to close
- Set second partial exit point and percentage of position to close
- **Time-Based Exit**: Automatically exit a position after a specified number of bars.
#### Win/Loss Streak Management
- **Streak Cutoff**: Automatically pause trading after a series of consecutive wins or losses.
- **Daily Reset**: Option to reset streak counters at the start of each day.
### Entry Conditions
- **Source and Value**: Define the exact price source and value that triggers entries.
- **Equals Condition**: Entry signals occur when the source exactly matches the specified value.
### Performance Analytics
- **Real-Time Stats**: Track important performance metrics like win rate, P&L, and largest wins/losses.
- **Visual Feedback**: On-chart markers for entries, exits, and important events.
### External Integration
- **Webhook Support**: Compatible with TradingView's webhook alerts for automated trading.
- **Cross-Platform**: Connect to external trading systems and notification platforms.
- **Custom Order Execution**: Implement advanced order flows through external services.
## How to Use
### Setup Instructions
1. Add the script to your TradingView chart.
2. Configure the general settings based on your trading preferences.
3. Set session trading hours if you only want to trade specific times.
4. Select your contract specifications or customize for your instrument.
5. Configure risk parameters:
- Choose your preferred risk management approach
- Set appropriate stop-loss and take-profit levels
- Enable advanced features like break-even, trailing stops, or partial profit taking as needed
6. Define entry conditions:
- Select the price source (such as close, open, high, or an indicator)
- Set the specific value that should trigger entries
### Entry Condition Examples
- **Example 1**: To enter when price closes exactly at a whole number:
- Long Source: close
- Long Value: 4200 (for instance, to enter when price closes exactly at 4200)
- **Example 2**: To enter when an indicator reaches a specific value:
- Long Source: ta.rsi(close, 14)
- Long Value: 30 (triggers when RSI equals exactly 30)
### Best Practices
1. **Always backtest thoroughly** before using in live trading.
2. **Start with conservative risk settings**:
- Small position sizes
- Reasonable stop-loss distances
- Limited trades per day
3. **Monitor and adjust**:
- Use the performance table to track results
- Adjust parameters based on how the strategy performs
4. **Consider market volatility**:
- Use ATR-based stops during volatile periods
- Use fixed points during stable markets
## Continuous Position Signals Implementation
The LongShortExit strategy can be enhanced with continuous position signals to provide visual feedback about the current position state. These signals can help you track when the strategy is in a long or short position.
### Adding Continuous Position Signals
Add the following code to implement continuous position signals (0 to 1):
```pine
// Continuous position signals (0 to 1)
var float longSignal = 0.0
var float shortSignal = 0.0
// Update position signals based on your indicator's conditions
longSignal := longCondition ? 1.0 : 0.0
shortSignal := shortCondition ? 1.0 : 0.0
// Plot continuous signals
plot(longSignal, title="Long Signal", color=#00FF00, linewidth=2, transp=0, style=plot.style_line)
plot(shortSignal, title="Short Signal", color=#FF0000, linewidth=2, transp=0, style=plot.style_line)
```
### Benefits of Continuous Position Signals
- Provides clear visual feedback of current position state (long/short)
- Signal values stay consistent (0 or 1) until condition changes
- Can be used for additional calculations or alert conditions
- Makes it easier to track when entry conditions are triggered
### Using with Custom Indicators
You can adapt the continuous position signals to work with any custom indicator by replacing the condition with your indicator's logic:
```pine
// Example with moving average crossover
longSignal := fastMA > slowMA ? 1.0 : 0.0
shortSignal := fastMA < slowMA ? 1.0 : 0.0
```
## Webhook Integration
The LongShortExit strategy is fully compatible with TradingView's webhook alerts, allowing you to connect your strategy to external trading platforms, brokers, or custom applications for automated trading execution.
### Setting Up Webhooks
1. Create an alert on your chart with the LongShortExit strategy
2. Enable the "Webhook URL" option in the alert dialog
3. Enter your webhook endpoint URL (from your broker or custom trading system)
4. Customize the alert message with relevant information using TradingView variables
### Webhook Message Format Example
```json
{
"strategy": "LongShortExit",
"action": "{{strategy.order.action}}",
"price": "{{strategy.order.price}}",
"quantity": "{{strategy.position_size}}",
"time": "{{time}}",
"ticker": "{{ticker}}",
"position_size": "{{strategy.position_size}}",
"position_value": "{{strategy.position_value}}",
"order_id": "{{strategy.order.id}}",
"order_comment": "{{strategy.order.comment}}"
}
```
### TradingView Alert Condition Examples
For effective webhook automation, set up these alert conditions:
#### Entry Alert
```
{{strategy.position_size}} != {{strategy.position_size}}
```
#### Exit Alert
```
{{strategy.position_size}} < {{strategy.position_size}} or {{strategy.position_size}} > {{strategy.position_size}}
```
#### Partial Take Profit Alert
```
strategy.order.comment contains "Partial TP"
```
### Benefits of Webhook Integration
- **Automated Trading**: Execute trades automatically through supported brokers
- **Cross-Platform**: Connect to custom trading bots and applications
- **Real-Time Notifications**: Receive trade signals on external platforms
- **Data Collection**: Log trade data for further analysis
- **Custom Order Management**: Implement advanced order types not available in TradingView
### Compatible External Applications
- Trading bots and algorithmic trading software
- Custom order execution systems
- Discord, Telegram, or Slack notification systems
- Trade journaling applications
- Risk management platforms
### Implementation Recommendations
- Test webhook delivery using a free service like webhook.site before connecting to your actual trading system
- Include authentication tokens or API keys in your webhook URL or payload when required by your external service
- Consider implementing confirmation mechanisms to verify trade execution
- Log all webhook activities for troubleshooting and performance tracking
## Integrating with Confluence of Signals
The LongShortExit strategy can be enhanced by using it in conjunction with the "Confluence of Alerts" indicator to create more robust entry conditions based on multiple technical signals.
### What is Confluence of Signals?
The Confluence of Alerts indicator allows you to define up to 8 different technical conditions that must be met simultaneously to generate a trading signal. This approach helps filter out false signals and only enters trades when multiple technical factors align.
### Integration Approach
#### Method 1: Using Confluence as a Signal Source
1. Add the Confluence of Alerts indicator to your chart
2. Configure your desired technical conditions (RSI, moving averages, support/resistance, etc.)
3. In the LongShortExit strategy settings:
- Set Long Source to `plot("Long All")` from the Confluence indicator
- Set Long Value to `1` with "Equals" condition
- Similarly for Short Source using `plot("Short All")`
#### Method 2: Modifying the Strategy Code
For more advanced integration, you can incorporate the condition logic directly:
```pine
// Add to the top of your LongShortExit strategy
//@import TradersPost/Confluence_of_Alerts/1
// Replace simple entry conditions with confluence signals
longCondition = confluence_long_signal and longEntryCondition
shortCondition = confluence_short_signal and shortEntryCondition
```
### Confluence Configuration Examples
#### Trend-Following Configuration
1. **Condition 1**: When SMA(20) crossing up SMA(50)
2. **Condition 2**: When RSI(14) greater than 50
3. **Condition 3**: When close greater than VWAP
4. **Condition 4**: When ADX(14) greater than 25
#### Support/Resistance Configuration
1. **Condition 1**: When price crossing up pivot support
2. **Condition 2**: When Stochastic %K crossing up %D
3. **Condition 3**: When volume greater than average volume
4. **Condition 4**: When price greater than previous day's close
### Benefits of Using Confluence with LongShortExit
- **Reduced False Signals**: Enter trades only when multiple conditions confirm the signal
- **Higher Probability Trades**: Each additional confirming factor increases trade success probability
- **Customizable Filter**: Adapt the conditions to suit different market environments and trading styles
- **Visual Confirmation**: The Confluence indicator provides clear visual signals when all conditions are met
### Implementation Tips
1. Start with 2-3 conditions before adding more complexity
2. Ensure conditions aren't redundant (e.g., don't use multiple similar indicators)
3. Include conditions from different categories:
- Trend indicators (moving averages, ADX)
- Momentum indicators (RSI, MACD)
- Volume indicators
- Support/resistance levels
4. Test different timeframes for the conditions
5. Use the "on Bar Close" option for more reliable signals
## Strategy Customization Tips
### For Scalping
- Set smaller profit targets (1-3 points)
- Use tighter stop-losses
- Enable break-even feature after small profit
- Set higher max trades per day
### For Day Trading
- Use moderate profit targets
- Implement partial profit taking
- Enable trailing stops
- Set reasonable session trading hours
### For Swing Trading
- Use longer-term charts
- Set wider stops (ATR-based often works well)
- Use higher profit targets
- Disable daily streak reset
## Common Troubleshooting
### Low Win Rate
- Consider widening stop-losses
- Verify that entry conditions aren't triggering too frequently
- Check if the equals condition is too restrictive; consider small tolerances
### Missing Obvious Trades
- The equals condition is extremely precise. Price must exactly match the specified value.
- Consider using floating-point precision for more reliable triggers
### Frequent Stop-Outs
- Try ATR-based stops instead of fixed points
- Increase the stop-loss distance
- Enable break-even feature to protect profits
## Important Notes
- The exact equals condition is strict and may result in fewer trade signals compared to other conditions.
- For instruments with decimal prices, exact equality might be rare. Consider the precision of your value.
- Break-even and trailing stop calculations are based on points, not percentage.
- Partial take-profit levels are defined in points distance from entry.
- The continuous position signals (0 to 1) provide valuable visual feedback but don't affect the strategy's trading logic directly.
- When implementing continuous signals, ensure they're aligned with the actual entry conditions used by the strategy.
---
*This strategy is for educational and informational purposes only. Always test thoroughly before using with real funds.*
Strategy [High-Low Cloud Trend] (v6, perf-safe)Description
High-Low Cloud Trend Strategy (Performance-Safe Edition)
Version 6 • RezzoRedPriest (based on the original logic by @rottor29)
How it works
Dynamic range ― The script tracks the highest high / lowest low over a look-back of N bars (len). When price tags one extreme, a “pivot” flips to the opposite extreme, forming the core of the cloud.
Trend filter ― If the candle closes above the pivot, trend = bullish; below it, trend = bearish. The optional “Trade only with trend” switch forces longs in bullish mode and shorts in bearish mode.
Signals
Cloud Retest – price pulls back to the inner edge (band1) and rejects it.
Cloud Cross – price breaks through the outer edge (band).
Mean Reversion – spikes beyond the inner edge and snap back (optional).
Execution model – trades are processed once per bar (process_orders_on_close = true), capped at maxTradesPerDay.
Performance guardrails
Only the most-recent visBars bars are calculated and painted.
Object limits: max_labels_count = 400, max_lines_count = 30.
Inputs
Group Name Purpose
Display Drawings: show last N bars Hard cap for calculations & drawings (default = 500).
Display Show markers / labels Toggle all arrows / diamonds.
Display Show cloud fill & background Toggle the colored cloud & background.
Strategy Look-back period (len) Width of the cloud; larger = smoother trend.
Strategy Enable trading Completely turn trade logic on/off.
Strategy Take cloud-retest / cross / mean-reversion signals Select which setups feed the engine.
Strategy Trade only with trend Filter counter-trend signals.
Risk Max trades per day Hard daily cap.
Recommended use
Works on any timeframe; common sweet spots are 5 m & 15 m for liquid futures / FX.
Increase len for higher timeframes (e.g. 55–100 on 1 H) to avoid noise.
If your chart still lags, either:
Lower Drawings: show last N bars, or
Turn Show cloud fill off – the fill is the heaviest operation.
Disclaimer
This script is for educational purposes only and does not constitute financial advice. Always test on demo data first and use proper risk management.
Supertrend Strategy v.1.0 (Nikko)This is the well-known Supertrend indicator, adapted for use as a strategy and updated to be compatible with Pine Script v6.
While I am not the original author of this indicator, I was curious to assess its real-world performance. The Supertrend is widely promoted by trading influencers, and I assumed many traders rely on it in their decision-making.
My goal was to stress-test the Supertrend by converting it into a strategy, to evaluate whether it could be a reliable tool to follow.
After testing it across various timeframes and assets, I found that it generally delivers poor results in terms of profitable trades. It performs somewhat better when the number of trades is kept low, but once trade frequency increases, the strategy tends to lose significantly due to its low win rate. This is an important caveat for those considering its use—be cautious, especially in high-frequency setups.
The source code is open for anyone who wants to improve or investigate further. If you identify any optimizations or bugs, feel free to share them with the community so we can all benefit.
------------------------------------------------------
How the Supertrend Indicator Works
The Supertrend indicator is a trend-following tool designed to identify whether the market is in a bullish or bearish phase. It's often used to signal potential entry and exit points for trades.
It is built on the Average True Range (ATR), a measure of volatility, and a user-defined multiplier. These inputs are used to calculate dynamic support and resistance bands:
When the price is above the Supertrend line, the trend is considered bullish.
When the price is below the Supertrend line, the trend is considered bearish.
These trend shifts can offer visual cues for trade direction, but as seen in strategy testing, the effectiveness may vary widely depending on market conditions and timeframes.
Multi-Indicator Trend-Following Strategy v6Multi-Indicator Trend-Following Strategy v6
This strategy uses a combination of technical indicators to identify potential trend-following trade entries and exits. It is intended for educational and research purposes.
How it works:
Moving Averages (EMA): Entry signals are generated on crossovers between a fast and slow exponential moving average.
RSI Filter: Confirms momentum with a threshold above/below 50 for long/short entries.
Volume Confirmation: Requires volume to exceed a moving average multiplied by a user-defined factor.
ATR-Based Risk Management: Stop loss and take profit levels are calculated using the Average True Range (ATR), allowing for dynamic risk control based on market volatility.
Customizable Inputs:
Fast/Slow MA lengths
RSI length and levels
MACD settings (used in calculation, not directly in signal)
Volume MA and multiplier
ATR period and multipliers for stop loss and take profit
Notes:
This strategy does not guarantee future results.
It is provided for analysis and backtesting only.
Alerts are available for buy/sell conditions.
Feel free to adjust parameters to explore different market conditions and asset classes.
Advanced Crypto Trend Line Strategysimple trend line strategy with rsi, macd, demand and supply and volume confluence.
CST WITH ATR Custom Multiplier @ DrGSthis is the revised and updated version onf contra trend in ST with ATR of 5 and 3x multiplier. it works on the principle of selling when everyone is buying and vice versa. last modified on 20 june by Dr GS
DJ30 Sniper (Trend + Reversal Buy + Pyramid Recovery)
4Hours chart only ,have fun people, don't forget to leave review if you like it
Mitbai ScalperThis strategy takes a breakout depending of a candle and after a certain number of candles above or below the initial candle, open a trade in the trend direction.
XRP 16H StrongThis XRP Trading Strategy CRUSHES Buy & Hold (675 Trades Backtested!)
Unlock the power of this simple yet powerful XRP trading strategy that outperforms the classic buy & hold method. In this video, we backtest 675 XRP trades with a profit factor of 1.46, showing how this approach delivers higher returns and lower drawdowns.
Video:
www.youtube.com
metaduro.com
NA GPT - TTM Squeeze Strategy**NA GPT - TTM Squeeze Strategy**” transforms the well-known TTM Squeeze indicator into a back-testable, long-only strategy.
It combines **volatility compression** (Bollinger Bands inside Keltner Channels) with **momentum confirmation** to catch powerful bullish breakouts and then trails positions with a simple 21-period moving-average stop.
---
## 1. Core Concepts & Calculations
| Component | What it measures | How it works |
| ---------------------- | ------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Squeeze State** | Volatility contraction vs. expansion | • Calculate a 20-period Bollinger Band (BB). • Calculate a 20-period Keltner Channel (KC). • **Squeeze ON** when the entire BB is *inside* the KC (narrow volatility). |
| **Momentum Histogram** | Direction & strength of pressure building inside the squeeze | • Compute the midpoint of the recent high/low range and the 20-period SMA of close. • Take the price’s deviation from that blended average. • Fit a **20-period linear regression** to that deviation to produce the histogram. • Color logic: ↗ increasing green/lime for strengthening bulls, ↘ red/maroon for bears. |
| **Blue-Dot Theme** | Visual cue of squeeze state | • **Navy-blue dot** = Squeeze ON (ready to pop). • **Steel-blue dot** = Squeeze just released. • **Sky-blue dot** = Neutral (no squeeze). |
---
## 2. Trade Logic
| Step | Condition | Rationale |
| ---------------- | ------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- |
| **Entry (Long)** | Three consecutive navy-blue dots (i.e., **3 bars with Squeeze ON in a row**) *inside the user-defined date window*. | Requires sustained volatility compression before committing capital, filtering out one-bar “fake” squeezes. |
| **Exit (Flat)** | Close price **crosses below** the 21-period Simple Moving Average. | A classic trailing stop that lets profits run while cutting momentum failures. |
| **Positioning** | Long-only, one trade at a time. No short sales. | Focuses on bullish breakouts, keeps strategy simple and margin-friendly. |
---
## 3. Inputs & Customisation
| Input | Default | Purpose |
| -------------------------- | ------------------------ | ---------------------------------------------- |
| **BB Length / Multiplier** | 20 / 2.0 | Adjust sensitivity of Bollinger Bands. |
| **KC Length / Multiplier** | 20 / 1.5 | Adjust Keltner Channel width. |
| **Use True Range (KC)** | ✔ | Pick *True Range* vs. *High-Low* for KC width. |
| **Trade Window** | 1 Jan 2022 → 31 Dec 2069 | Back-test only the period you care about. |
| **Commission** | 0.01 % | Embedded in `strategy()` header. |
| **Slippage (Ticks)** | 3 | Models real-world order fill uncertainty. |
---
## 4. Visual Outputs
* **Momentum Histogram** (green / lime / red / maroon).
* **Zero Line** colored by squeeze state (blue / dark navy / grey).
* **Blue-Dot Row** at the chart bottom showing squeeze timing.
The visuals are **identical** to the original indicator, letting you correlate back-test trades with familiar chart cues.
---
## 5. How to Use
1. **Add to chart**, choose your symbol & timeframe (works on anything from 1-minute to weekly).
2. **Tune the BB/KC/ATR settings** to match instrument volatility.
3. **Adjust the date window** for focused walk-forward testing.
4. Run the “**Strategy Tester**” to inspect historical performance, P\&L; curves, drawdowns, and trade list.
5. Use the plotted dots & histogram to visually validate why each trade fired.
6. Combine with your own risk-management (position sizing, portfolio filters, etc.) before going live.
---
## 6. Practical Notes
* Designed for educational/back-testing purposes—**not financial advice**.
* Long-only by design; add your own short logic if desired.
* Because exits rely on the 21-SMA, extremely low-volume instruments or illiquid intraday timeframes may experience wider drawdowns.
* Commission/slippage values are easily editable in the first line of the script.
IKODO Engulfing Strategy with Dynamic RR# 📈 ELITE ENGULFING STRATEGY - PUBLICATION DESCRIPTION
## **🎯 TITLE:**
**Elite Engulfing Strategy with Dynamic Risk Management - Advanced Pattern Recognition System**
---
## **📊 DESCRIPTION:**
### **🚀 OVERVIEW:**
The **Elite Engulfing Strategy** is a sophisticated trading system that combines advanced pattern recognition with dynamic risk management. This strategy identifies high-probability engulfing patterns while using the 50 EMA as a trend filter, ensuring trades align with the dominant market direction.
### **🔍 KEY FEATURES:**
**📈 ADVANCED PATTERN RECOGNITION:**
- Enhanced engulfing pattern detection with mathematical validation
- Quality filters including wick analysis and body-to-body ratio
- Volume confirmation for signal strength
- ATR-based volatility filtering for optimal entry timing
**🎯 DYNAMIC RISK MANAGEMENT:**
- Customizable Risk-Reward ratio (0.5x to 10x)
- Fibonacci-based take profit levels using swing highs/lows
- ATR-enhanced stop loss placement with buffer zones
- Real-time position sizing based on market volatility
**📊 INTELLIGENT FILTERING SYSTEM:**
- 50 EMA trend filter for directional bias
- Volume multiplier confirmation (1.0x to 3.0x average)
- Minimum engulfing ratio validation (0.01 to 1.0)
- Maximum wick ratio quality control (10% to 80%)
**🔔 COMPREHENSIVE ALERT SYSTEM:**
- Real-time entry signals with price and RR information
- Both alertcondition() and alert() functions for maximum compatibility
- Detailed signal descriptions for manual verification
### **📋 STRATEGY LOGIC:**
**🟢 LONG ENTRY CONDITIONS:**
- Price above 50 EMA (bullish trend confirmation)
- Current bullish candle completely engulfs previous bearish candle
- Current candle's low penetrates previous candle's low
- Volume exceeds average by specified multiplier
- ATR volatility meets minimum threshold
- Wick size within acceptable parameters
**🔴 SHORT ENTRY CONDITIONS:**
- Price below 50 EMA (bearish trend confirmation)
- Current bearish candle completely engulfs previous bullish candle
- Current candle's high penetrates previous candle's high
- Volume and volatility confirmations as above
### **⚙️ CUSTOMIZABLE PARAMETERS:**
**🎯 Risk Management:**
- Risk-Reward Ratio: 0.5 to 10.0 (default: 2.0)
- Fibonacci TP Level: 0.236 to 1.0 (default: 0.618)
- Use Fibonacci toggle for advanced exit strategy
**📈 Trend Analysis:**
- EMA Length: 1 to 200 periods (default: 50)
- EMA Source: OHLC4, Close, HL2, etc.
**🔍 Pattern Quality:**
- Minimum Engulfing Ratio: 0.01 to 1.0 (default: 0.1)
- Maximum Wick Ratio: 10% to 80% (default: 30%)
**🔧 Advanced Filters:**
- Volume Filter: On/Off with 1.0x to 3.0x multiplier
- ATR Filter: 1 to 50 periods with 0.1 to 2.0 ratio threshold
### **📊 PERFORMANCE METRICS:**
- Real-time P&L tracking
- Current trend identification
- ATR volatility measurement
- Risk-reward ratio display
- Strategy parameter overview
### **🎨 VISUAL ELEMENTS:**
- 50 EMA trend line with dynamic coloring
- Entry signals with triangular markers
- Stop loss and take profit levels
- Entry price reference line
- Comprehensive information table
### **💡 BEST PRACTICES:**
- Recommended for 1H to 4H timeframes
- Works best in trending markets
- Combine with higher timeframe analysis
- Use proper position sizing (1-2% risk per trade)
- Monitor during high-impact news events
### **🔧 COMPATIBILITY:**
- Pine Script v6
- Compatible with all TradingView account types
- Optimized for both free and premium users
- Works on all asset classes (Forex, Crypto, Stocks, Indices)
### **⚠️ DISCLAIMER:**
This strategy is for educational purposes only. Past performance does not guarantee future results. Always use proper risk management and never risk more than you can afford to lose. Test thoroughly on paper trading before live implementation.
## **📝 USAGE INSTRUCTIONS:**
1. Add the strategy to your chart
2. Adjust parameters according to your risk tolerance
3. Set up alerts for automated notifications
4. Backtest on your preferred timeframe and asset
5. Start with paper trading to validate performance
6. Implement proper position sizing for live trading
**🎯 Ready to elevate your trading game with professional-grade pattern recognition!**
Multi-Indicator Trend-Following Strategy v7This strategy is a trend-following system that combines multiple technical indicators into a single, optimized indicator to help identify high-probability Buy and Sell opportunities while maintaining a clean and uncluttered chart.
✅ How It Works:
This script utilizes a combination of Exponential Moving Averages (EMAs), Relative Strength Index (RSI), Volume, MACD, and Average True Range (ATR) to determine trade entries and exits.
🟢 Buy Conditions:
Trend Crossover Entry:
A Buy signal is generated when the Fast EMA crosses above the Slow EMA, indicating a potential bullish trend.
Oversold Reversal Entry:
Alternatively, a Buy is triggered when:
The Slow EMA is significantly below the Fast EMA (oversold market behavior),
The current price is well below the Fast EMA,
A volume spike occurs, suggesting a possible reversal.
🔴 Sell Conditions:
Trend Crossover Exit:
A Sell signal is generated when the Fast EMA crosses below the Slow EMA, indicating a bearish shift.
Overbought Reversal Exit:
A Sell is triggered when:
The Slow EMA is above the Fast EMA by a wide margin,
The price is well above the Fast EMA,
A volume spike suggests downward reversal pressure.
📏 Risk Management:
Uses ATR-based stop-loss and take-profit levels to dynamically manage risk per trade.
Includes adjustable input options for ATR multipliers, moving average lengths, volume filters, and more.
🧩 Why Use This Strategy?
Rather than juggling multiple indicators manually, this script combines and simplifies them into a single, convenient strategy. It’s ideal for traders who want:
Clean visual signals,
Robust entry/exit logic backed by volume and trend behavior,
A modular and customizable setup for testing and optimization.
⚠️ Disclaimer: This script is for educational and informational purposes only. It does not constitute financial advice. Always backtest strategies thoroughly and use proper risk management when trading live.
Dual TF Stochastic StrategyCore Strategy Components:
Uses two Stochastic oscillators (Primary and Reference)
Both use 15-second timeframe (15S)
Primary Stochastic settings:
K Length: 12
K Smoothing: 12
D Length: 12
Reference Stochastic settings:
K Length: 12
K Smoothing: 15
D Length: 30
Entry Logic:
Long Entries occur when:
Primary %K crosses over %D
AND either:
Reference %D is ≥ 50 or < 20
OR Primary %K is close to Reference %D (within 0.15)
AND price is above Moving Average (if MA filter enabled)
AND during regular market hours (9:30 AM - 4:00 PM ET)
Short Entries occur when:
Primary %K crosses under %D
AND either:
Within tolerance of Reference %D
OR specific crossunder conditions met
AND price is below Moving Average
AND during regular market hours
Exit Logic:
Time-based exits:
At 3:30 PM ET
End of regular market hours
Technical exits:
Long positions: When Primary %K crosses under Reference %D
Short positions: When Primary %K crosses over Reference %D and Reference %D > 20
Pattern Detection:
Higher Low Pattern:
Current crossover %K > Previous crossover %K
Bullish continuation pattern
Lower High Pattern:
Current crossunder %K < Previous crossunder %K
Bearish continuation pattern
Risk Management:
Price difference filters:
Maximum price difference: 0.1%
Minimum price difference for shorts: 0.1%
Reference %D tolerance: 0.1%
Close %K tolerance: 0.7%
Strengths:
Multiple confirmation layers (dual timeframes, MA filter)
Clear entry/exit rules
Pattern recognition for trend continuation
Time-based filters to avoid volatile periods
Comprehensive alert system
Potential Limitations:
Short timeframe (15S) may generate more false signals
Tight price difference filters might miss some opportunities
Relies heavily on Reference %D levels
No stop-loss implementation visible in the code
Suggested Improvements:
Add stop-loss mechanisms
Implement position sizing rules
Add volume confirmation
Consider adding RSI or other momentum filters
Add backtesting statistics tracking
Best Use Cases:
Day trading in liquid markets
Markets with clear trends
Time periods with normal volatility
When price action aligns with Stochastic signals
Risk Considerations:
High-frequency trading due to 15S timeframe
Multiple entries possible in short timeframes
No explicit risk management beyond entry/exit rules
Market hours limitation might miss opportunities
Turtle Trading System (Full Version)The turtle trader strategy by Richard Dennis, buys from breakouts and uses volatility for sizing. Accurate on most asset classes, best on Gold.
Medico Action Zone self adjust TFput "buy" and "sell" signal by using EMA 12/26 and you can adjust TF for short term or long term.
Anomalous Holonomy Field Theory🌌 Anomalous Holonomy Field Theory (AHFT) - Revolutionary Quantum Market Analysis
Where Theoretical Physics Meets Trading Reality
A Groundbreaking Synthesis of Differential Geometry, Quantum Field Theory, and Market Dynamics
🔬 THEORETICAL FOUNDATION - THE MATHEMATICS OF MARKET REALITY
The Anomalous Holonomy Field Theory represents an unprecedented fusion of advanced mathematical physics with practical market analysis. This isn't merely another indicator repackaging old concepts - it's a fundamentally new lens through which to view and understand market structure .
1. HOLONOMY GROUPS (Differential Geometry)
In differential geometry, holonomy measures how vectors change when parallel transported around closed loops in curved space. Applied to markets:
Mathematical Formula:
H = P exp(∮_C A_μ dx^μ)
Where:
P = Path ordering operator
A_μ = Market connection (price-volume gauge field)
C = Closed price path
Market Implementation:
The holonomy calculation measures how price "remembers" its journey through market space. When price returns to a previous level, the holonomy captures what has changed in the market's internal geometry. This reveals:
Hidden curvature in the market manifold
Topological obstructions to arbitrage
Geometric phase accumulated during price cycles
2. ANOMALY DETECTION (Quantum Field Theory)
Drawing from the Adler-Bell-Jackiw anomaly in quantum field theory:
Mathematical Formula:
∂_μ j^μ = (e²/16π²)F_μν F̃^μν
Where:
j^μ = Market current (order flow)
F_μν = Field strength tensor (volatility structure)
F̃^μν = Dual field strength
Market Application:
Anomalies represent symmetry breaking in market structure - moments when normal patterns fail and extraordinary opportunities arise. The system detects:
Spontaneous symmetry breaking (trend reversals)
Vacuum fluctuations (volatility clusters)
Non-perturbative effects (market crashes/melt-ups)
3. GAUGE THEORY (Theoretical Physics)
Markets exhibit gauge invariance - the fundamental physics remains unchanged under certain transformations:
Mathematical Formula:
A'_μ = A_μ + ∂_μΛ
This ensures our signals are gauge-invariant observables , immune to arbitrary market "coordinate changes" like gaps or reference point shifts.
4. TOPOLOGICAL DATA ANALYSIS
Using persistent homology and Morse theory:
Mathematical Formula:
β_k = dim(H_k(X))
Where β_k are the Betti numbers describing topological features that persist across scales.
🎯 REVOLUTIONARY SIGNAL CONFIGURATION
Signal Sensitivity (0.5-12.0, default 2.5)
Controls the responsiveness of holonomy field calculations to market conditions. This parameter directly affects the threshold for detecting quantum phase transitions in price action.
Optimization by Timeframe:
Scalping (1-5min): 1.5-3.0 for rapid signal generation
Day Trading (15min-1H): 2.5-5.0 for balanced sensitivity
Swing Trading (4H-1D): 5.0-8.0 for high-quality signals only
Score Amplifier (10-200, default 50)
Scales the raw holonomy field strength to produce meaningful signal values. Higher values amplify weak signals in low-volatility environments.
Signal Confirmation Toggle
When enabled, enforces additional technical filters (EMA and RSI alignment) to reduce false positives. Essential for conservative strategies.
Minimum Bars Between Signals (1-20, default 5)
Prevents overtrading by enforcing quantum decoherence time between signals. Higher values reduce whipsaws in choppy markets.
👑 ELITE EXECUTION SYSTEM
Execution Modes:
Conservative Mode:
Stricter signal criteria
Higher quality thresholds
Ideal for stable market conditions
Adaptive Mode:
Self-adjusting parameters
Balances signal frequency with quality
Recommended for most traders
Aggressive Mode:
Maximum signal sensitivity
Captures rapid market moves
Best for experienced traders in volatile conditions
Dynamic Position Sizing:
When enabled, the system scales position size based on:
Holonomy field strength
Current volatility regime
Recent performance metrics
Advanced Exit Management:
Implements trailing stops based on ATR and signal strength, with mode-specific multipliers for optimal profit capture.
🧠 ADAPTIVE INTELLIGENCE ENGINE
Self-Learning System:
The strategy analyzes recent trade outcomes and adjusts:
Risk multipliers based on win/loss ratios
Signal weights according to performance
Market regime detection for environmental adaptation
Learning Speed (0.05-0.3):
Controls adaptation rate. Higher values = faster learning but potentially unstable. Lower values = stable but slower adaptation.
Performance Window (20-100 trades):
Number of recent trades analyzed for adaptation. Longer windows provide stability, shorter windows increase responsiveness.
🎨 REVOLUTIONARY VISUAL SYSTEM
1. Holonomy Field Visualization
What it shows: Multi-layer quantum field bands representing market resonance zones
How to interpret:
Blue/Purple bands = Primary holonomy field (strongest resonance)
Band width = Field strength and volatility
Price within bands = Normal quantum state
Price breaking bands = Quantum phase transition
Trading application: Trade reversals at band extremes, breakouts on band violations with strong signals.
2. Quantum Portals
What they show: Entry signals with recursive depth patterns indicating momentum strength
How to interpret:
Upward triangles with portals = Long entry signals
Downward triangles with portals = Short entry signals
Portal depth = Signal strength and expected momentum
Color intensity = Probability of success
Trading application: Enter on portal appearance, with size proportional to portal depth.
3. Field Resonance Bands
What they show: Fibonacci-based harmonic price zones where quantum resonance occurs
How to interpret:
Dotted circles = Minor resonance levels
Solid circles = Major resonance levels
Color coding = Resonance strength
Trading application: Use as dynamic support/resistance, expect reactions at resonance zones.
4. Anomaly Detection Grid
What it shows: Fractal-based support/resistance with anomaly strength calculations
How to interpret:
Triple-layer lines = Major fractal levels with high anomaly probability
Labels show: Period (H8-H55), Price, and Anomaly strength (φ)
⚡ symbol = Extreme anomaly detected
● symbol = Strong anomaly
○ symbol = Normal conditions
Trading application: Expect major moves when price approaches high anomaly levels. Use for precise entry/exit timing.
5. Phase Space Flow
What it shows: Background heatmap revealing market topology and energy
How to interpret:
Dark background = Low market energy, range-bound
Purple glow = Building energy, trend developing
Bright intensity = High energy, strong directional move
Trading application: Trade aggressively in bright phases, reduce activity in dark phases.
📊 PROFESSIONAL DASHBOARD METRICS
Holonomy Field Strength (-100 to +100)
What it measures: The Wilson loop integral around price paths
>70: Strong positive curvature (bullish vortex)
<-70: Strong negative curvature (bearish collapse)
Near 0: Flat connection (range-bound)
Anomaly Level (0-100%)
What it measures: Quantum vacuum expectation deviation
>70%: Major anomaly (phase transition imminent)
30-70%: Moderate anomaly (elevated volatility)
<30%: Normal quantum fluctuations
Quantum State (-1, 0, +1)
What it measures: Market wave function collapse
+1: Bullish eigenstate |↑⟩
0: Superposition (uncertain)
-1: Bearish eigenstate |↓⟩
Signal Quality Ratings
LEGENDARY: All quantum fields aligned, maximum probability
EXCEPTIONAL: Strong holonomy with anomaly confirmation
STRONG: Good field strength, moderate anomaly
MODERATE: Decent signals, some uncertainty
WEAK: Minimal edge, high quantum noise
Performance Metrics
Win Rate: Rolling performance with emoji indicators
Daily P&L: Real-time profit tracking
Adaptive Risk: Current risk multiplier status
Market Regime: Bull/Bear classification
🏆 WHY THIS CHANGES EVERYTHING
Traditional technical analysis operates on 100-year-old principles - moving averages, support/resistance, and pattern recognition. These work because many traders use them, creating self-fulfilling prophecies.
AHFT transcends this limitation by analyzing markets through the lens of fundamental physics:
Markets have geometry - The holonomy calculations reveal this hidden structure
Price has memory - The geometric phase captures path-dependent effects
Anomalies are predictable - Quantum field theory identifies symmetry breaking
Everything is connected - Gauge theory unifies disparate market phenomena
This isn't just a new indicator - it's a new way of thinking about markets . Just as Einstein's relativity revolutionized physics beyond Newton's mechanics, AHFT revolutionizes technical analysis beyond traditional methods.
🔧 OPTIMAL SETTINGS FOR MNQ 10-MINUTE
For the Micro E-mini Nasdaq-100 on 10-minute timeframe:
Signal Sensitivity: 2.5-3.5
Score Amplifier: 50-70
Execution Mode: Adaptive
Min Bars Between: 3-5
Theme: Quantum Nebula or Dark Matter
💭 THE JOURNEY - FROM IMPOSSIBLE THEORY TO TRADING REALITY
Creating AHFT was a mathematical odyssey that pushed the boundaries of what's possible in Pine Script. The journey began with a seemingly impossible question: Could the profound mathematical structures of theoretical physics be translated into practical trading tools?
The Theoretical Challenge:
Months were spent diving deep into differential geometry textbooks, studying the works of Chern, Simons, and Witten. The mathematics of holonomy groups and gauge theory had never been applied to financial markets. Translating abstract mathematical concepts like parallel transport and fiber bundles into discrete price calculations required novel approaches and countless failed attempts.
The Computational Nightmare:
Pine Script wasn't designed for quantum field theory calculations. Implementing the Wilson loop integral, managing complex array structures for anomaly detection, and maintaining computational efficiency while calculating geometric phases pushed the language to its limits. There were moments when the entire project seemed impossible - the script would timeout, produce nonsensical results, or simply refuse to compile.
The Breakthrough Moments:
After countless sleepless nights and thousands of lines of code, breakthrough came through elegant simplifications. The realization that market anomalies follow patterns similar to quantum vacuum fluctuations led to the revolutionary anomaly detection system. The discovery that price paths exhibit holonomic memory unlocked the geometric phase calculations.
The Visual Revolution:
Creating visualizations that could represent 4-dimensional quantum fields on a 2D chart required innovative approaches. The multi-layer holonomy field, recursive quantum portals, and phase space flow representations went through dozens of iterations before achieving the perfect balance of beauty and functionality.
The Balancing Act:
Perhaps the greatest challenge was maintaining mathematical rigor while ensuring practical trading utility. Every formula had to be both theoretically sound and computationally efficient. Every visual had to be both aesthetically pleasing and information-rich.
The result is more than a strategy - it's a synthesis of pure mathematics and market reality that reveals the hidden order within apparent chaos.
📚 INTEGRATED DOCUMENTATION
Once applied to your chart, AHFT includes comprehensive tooltips on every input parameter. The source code contains detailed explanations of the mathematical theory, practical applications, and optimization guidelines. This published description provides the overview - the indicator itself is a complete educational resource.
⚠️ RISK DISCLAIMER
While AHFT employs advanced mathematical models derived from theoretical physics, markets remain inherently unpredictable. No mathematical model, regardless of sophistication, can guarantee future results. This strategy uses realistic commission ($0.62 per contract) and slippage (1 tick) in all calculations. Past performance does not guarantee future results. Always use appropriate risk management and never risk more than you can afford to lose.
🌟 CONCLUSION
The Anomalous Holonomy Field Theory represents a quantum leap in technical analysis - literally. By applying the profound insights of differential geometry, quantum field theory, and gauge theory to market analysis, AHFT reveals structure and opportunities invisible to traditional methods.
From the holonomy calculations that capture market memory to the anomaly detection that identifies phase transitions, from the adaptive intelligence that learns and evolves to the stunning visualizations that make the invisible visible, every component works in mathematical harmony.
This is more than a trading strategy. It's a new lens through which to view market reality.
Trade with the precision of physics. Trade with the power of mathematics. Trade with AHFT.
I hope this serves as a good replacement for Quantum Edge Pro - Adaptive AI until I'm able to fix it.
— Dskyz, Trade with insight. Trade with anticipation.
Donchian x WMA Crossover (2025 Only, Adjustable TP, Real OHLC)Short Description:
Long-only breakout system that goes long when the Donchian Low crosses up through a Weighted Moving Average, and closes when it crosses back down (with an optional take-profit), restricted to calendar year 2025. All signals use the instrument’s true OHLC data (even on Heikin-Ashi charts), start with 1 000 AUD of capital, and deploy 100 % equity per trade.
Ideal parameters configured for Temple & Webster on ASX 30 minute candles. Adjust parameter to suit however best to download candle interval data and have GPT test the pine script for optimum parameters for your trading symbol.
Detailed Description
1. Strategy Concept
This strategy captures trend-driven breakouts off the bottom of a Donchian channel. By combining the Donchian Low with a WMA filter, it aims to:
Enter when volatility compresses and price breaks above the recent Donchian Low while the longer‐term WMA confirms upward momentum.
Exit when price falls back below that same WMA (i.e. when the Donchian Low crosses back down through WMA), but only if the WMA itself has stopped rising.
Optional Take-Profit: you can specify a profit target in decimal form (e.g. 0.01 = 1 %).
2. Timeframe & Universe
In-sample period: only bars stamped between Jan 1 2025 00:00 UTC and Dec 31 2025 23:59 UTC are considered.
Any resolution (e.g. 30 m, 1 h, D, etc.) is supported—just set your preferred timeframe in the TradingView UI.
3. True-Price Execution
All indicator calculations (Donchian Low, WMA, crossover checks, take-profit) are sourced from the chart’s underlying OHLC via request.security(). This guarantees that:
You can view Heikin-Ashi or other styled candles, but your strategy will execute on the real OHLC bars.
Chart styling never suppresses or distorts your backtest results.
4. Position Sizing & Equity
Initial capital: 1 000 AUD
Size per trade: 100 % of available equity
No pyramiding: one open position at a time
5. Inputs (all exposed in the “Inputs” tab):
Input Default Description
Donchian Length 7 Number of bars to calculate the Donchian channel low
WMA Length 62 Period of the Weighted Moving Average filter
Take Profit (decimal) 0.01 Exit when price ≥ entry × (1 + take_profit_perc)
6. How It Works
Donchian Low: ta.lowest(low, DonchianLength) over the specified look-back.
WMA: ta.wma(close, WMALength) applied to true closes.
Entry: ta.crossover(DonchianLow, WMA) AND barTime ∈ 2025.
Exit:
Cross-down exit: ta.crossunder(DonchianLow, WMA) and WMA is not rising (i.e. momentum has stalled).
Take-profit exit: price ≥ entry × (1 + take_profit_perc).
Calendar exit: barTime falls outside 2025.
7. Usage Notes
After adding to your chart, open the Strategy Tester tab to review performance metrics, list of trades, equity curve, etc.
You can toggle your chart to Heikin-Ashi for visual clarity without affecting execution, thanks to the real-OHLC calls.
Kaufman Trend Strategy# ✅ Kaufman Trend Strategy – Full Description (Script Publishing Version)
**Kaufman Trend Strategy** is a dynamic trend-following strategy based on Kaufman Filter theory.
It detects real-time trend momentum, reduces noise, and aims to enhance entry accuracy while optimizing risk.
⚠️ _For educational and research purposes only. Past performance does not guarantee future results._
---
## 🎯 Strategy Objective
- Smooth price noise using Kaufman Filter smoothing
- Detect the strength and direction of trends with a normalized oscillator
- Manage profits using multi-stage take-profits and adaptive ATR stop-loss logic
---
## ✨ Key Features
- **Kaufman Filter Trend Detection**
Extracts directional signal using a state space model.
- **Multi-Stage Profit-Taking**
Automatically takes partial profits based on color changes and zero-cross events.
- **ATR-Based Volatility Stops**
Stops adjust based on swing highs/lows and current market volatility.
---
## 📊 Entry & Exit Logic
**Long Entry**
- `trend_strength ≥ 60`
- Green trend signal
- Price above the Kaufman average
**Short Entry**
- `trend_strength ≤ -60`
- Red trend signal
- Price below the Kaufman average
**Exit (Long/Short)**
- Blue trend color → TP1 (50%)
- Oscillator crosses 0 → TP2 (25%)
- Trend weakens → Final exit (25%)
- ATR + swing-based stop loss
---
## 💰 Risk Management
- Initial capital: `$3,000`
- Order size: `$100` per trade (realistic, low-risk sizing)
- Commission: `0.002%`
- Slippage: `2 ticks`
- Pyramiding: `1` max position
- Estimated risk/trade: `~0.1–0.5%` of equity
> ⚠️ _No trade risks more than 5% of equity. This strategy follows TradingView script publishing rules._
---
## ⚙️ Default Parameters
- **1st Take Profit**: 50%
- **2nd Take Profit**: 25%
- **Final Exit**: 25%
- **ATR Period**: 14
- **Swing Lookback**: 10
- **Entry Threshold**: ±60
- **Exit Threshold**: ±40
---
## 📅 Backtest Summary
- **Symbol**: USD/JPY
- **Timeframe**: 1H
- **Date Range**: Jan 3, 2022 – Jun 4, 2025
- **Trades**: 924
- **Win Rate**: 41.67%
- **Profit Factor**: 1.108
- **Net Profit**: +$1,659.29 (+54.56%)
- **Max Drawdown**: -$1,419.73 (-31.87%)
---
## ✅ Summary
This strategy uses Kaufman filtering to detect market direction with reduced lag and increased smoothness.
It’s built with visual clarity and strong trade management, making it practical for both beginners and advanced users.
---
## 📌 Disclaimer
This script is for educational and informational purposes only and should not be considered financial advice.
Use with proper risk controls and always test in a demo environment before live trading.
Supply/Demand Zones + Engulfment-based ExecutionSupply/Demand Zones + Engulfment-Based Execution
Strategy Overview
This strategy combines institutional trading concepts—supply/demand zones and engulfing candle patterns—to generate high-probability long and short trade setups. The system uses aggregated price action to identify potential reversal zones and confirms entries with engulfing candle patterns, ensuring trades are only taken when market structure shows commitment in the direction of the trade.
Core Concepts
• Supply & Demand Zones: These are automatically detected by analyzing aggregated bullish and bearish candle structures over user-defined intervals. Supply zones are formed after bearish continuation patterns; demand zones appear after bullish continuation patterns.
• Engulfing Entries: Once price enters a zone, the strategy waits for a bullish engulfing pattern (in a demand zone) or a bearish engulfing pattern (in a supply zone) before executing a trade. This adds confirmation and reduces false signals.
• Risk Management: Stop-loss is placed at the low (for long trades) or high (for short trades) of the engulfed candle. Take-profit can be calculated using a fixed R-multiple (risk-to-reward ratio) or a user-defined target price.
Key Features
Fully customizable aggregation factor for zone detection
Visual zone boxes, entry/SL/TP boxes, and engulfing pattern labels
Optional removal of mitigated zones for cleaner charting
Configurable trade mode (Long only, Short only, or Both)
Support for trading sessions and date filtering
Alerts for price entering supply or demand zones
How to Use
Select Aggregation Factor: Choose how many candles to group together for identifying key zones (e.g., 4x timeframe).
Enable Zones: Turn on supply and/or demand zones as needed.
Set Execution Parameters:
– Choose R-multiple (e.g., 2:1 risk-reward)
– Or use a fixed take-profit price
Define Trade Time Window:
– Set the date and time ranges to restrict execution
– Use Start Hour and End Hour to limit trades to specific sessions (e.g., London/New York)
Run on Desired Timeframe: Typically used on 15m–4H charts, depending on your strategy and the asset’s volatility.
Ideal For
• Traders using Smart Money Concepts (SMC)
• Those who value high-confluence entries
• Intraday to swing traders looking for structure-based automation
⚠️ Important Notes
• The strategy requires engulfing confirmation within the zone to enter a position.
• This script does not repaint and executes trades on a bar close basis.
• Backtest results may vary based on session filters and aggregation factor.
© Attribution
This strategy was developed by The_Forex_Steward and is licensed under the Mozilla Public License 2.0.
You are free to use, modify, and distribute it under the terms of that license.
Grid TLong V1The “Grid TLong V1” strategy is based on the classic Grid strategy, but in the mode of buying and selling in favor of the trend and only on Long. This allows to take advantage of large uptrend movements to maximize profits in bull markets. For this reason, excessively sideways or bearish markets may not be very conducive to this strategy.
Like our Grid strategies in favor of the trend, you can enter and exit with the balance with controlled risk, as the distance between each grid functions as a natural and adaptable stop loss and take profit. What differentiates it from bidirectional strategies is that Short uses a minimum amount of follow-through, so that the percentage distance between the grids is maintained.
In this version of the script the entries and exits can be chosen at market or limit , and are based on the profit or loss of the current position, not on the percentage change in price.
The user may also notice that the strategy setup is risk-controlled, because it risks 5% on each trade, has a fairly standard commission and modest initial capital, all in order to protect the strategy user from unrealistic results.
As with all strategies, it is strongly recommended to optimize the parameters for the strategy to be effective for each asset and for each time frame.
Volatility Bias ModelVolatility Bias Model
Overview
Volatility Bias Model is a purely mathematical, non-indicator-based trading system that detects directional probability shifts during high volatility market phases. Rather than relying on classic tools like RSI or moving averages, this strategy uses raw price behavior and clustering logic to determine potential breakout direction based on recent market bias.
How It Works
Over a defined lookback window (default 10 bars), the strategy counts how many candles closed in the same direction (i.e., bullish or bearish).
Simultaneously, it calculates the price range during that window.
If volatility is above a minimum threshold and a clear directional bias is detected (e.g., >60% of closes are bullish), a trade is opened in the direction of that bias.
This approach assumes that when high volatility is coupled with directional closing consistency, the market is probabilistically more likely to continue in that direction.
ATR-based stop-loss and take-profit levels are applied, and trades auto-exit after 20 bars if targets are not hit.
Key Features
- 100% non-indicator-based logic
- Statistically-driven directional bias detection
- Works across all timeframes (1H, 4H, 1D)
- ATR-based risk management
- No pyramiding, slippage and commissions included
- Compatible with real-world backtesting conditions
Realism & Assumptions
To make this strategy more aligned with actual trading environments, it includes 0.05% commission per trade and a 1-point slippage on every entry and exit.
Additionally, position sizing is set at 10% of a $10,000 starting capital, and no pyramiding is allowed.
These assumptions help avoid unrealistic backtest results and make the performance metrics more representative of live conditions.
Parameter Explanation
Bias Window (10 bars): Number of past candles used to evaluate directional closings
Bias Threshold (0.60): Required ratio of same-direction candles to consider a bias valid
Minimum Range (1.5%): Ensures the market is volatile enough to avoid noise
ATR Length (14): Used to dynamically define stop-loss and target zones
Risk-Reward Ratio (2.0): Take-profit is set at twice the stop-loss distance
Max Holding Bars (20): Trades are closed automatically after 20 bars to prevent stagnation
Originality Note
Unlike common strategies based on oscillators or moving averages, this script is built on pure statistical inference. It models the market as a probabilistic process and identifies directional intent based on historical closing behavior, filtered by volatility. This makes it a non-linear, adaptive model grounded in real-world price structure — not traditional technical indicators.
Disclaimer
This strategy is for educational and experimental purposes only. It does not constitute financial advice. Always perform your own analysis and test thoroughly before applying with real capital.
Price Statistical Strategy-Z Score V 1.01
Price Statistical Strategy – Z Score V 1.01
Overview
A technical breakdown of the logic and components of the “Price Statistical Strategy – Z Score V 1.01”.
This script implements a smoothed Z-Score crossover mechanism applied to the closing price to detect potential statistical deviations from local price mean. The strategy operates solely on price data (close) and includes signal spacing control and momentum-based candle filters. No volume-based or trend-detection components are included.
Core Methodology
The strategy is built on the statistical concept of Z-Score, which quantifies how far a value (closing price) is from its recent average, normalized by standard deviation. Two moving averages of the raw Z-Score are calculated: a short-term and a long-term smoothed version. The crossover between them generates long entries and exits.
Signal Conditions
Entry Condition:
A long position is opened when the short-term smoothed Z-Score crosses above the long-term smoothed Z-Score, and additional entry conditions are met.
Exit Condition:
The position is closed when the short-term Z-Score crosses below the long-term Z-Score, provided the exit conditions allow.
Signal Gapping:
A minimum number of bars (Bars gap between identical signals) must pass between repeated entry or exit signals to reduce noise.
Momentum Filter:
Entries are prevented during sequences of three or more consecutively bullish candles, and exits are prevented during three or more consecutively bearish candles.
Z-Score Function
The Z-Score is calculated as:
Z = (Close - SMA(Close, N)) / STDEV(Close, N)
Where N is the base period selected by the user.
Input Parameters
Enable Smoothed Z-Score Strategy
Enables or disables the Z-Score strategy logic. When disabled, no trades are executed.
Z-Score Base Period
Defines the number of bars used to calculate the simple moving average and standard deviation for the Z-Score. This value affects how responsive the raw Z-Score is to price changes.
Short-Term Smoothing
Sets the smoothing window for the short-term Z-Score. Higher values produce smoother short-term signals, reducing sensitivity to short-term volatility.
Long-Term Smoothing
Sets the smoothing window for the long-term Z-Score, which acts as the reference line in the crossover logic.
Bars gap between identical signals
Minimum number of bars that must pass before another signal of the same type (entry or exit) is allowed. This helps reduce redundant or overly frequent signals.
Trade Visualization Table
A table positioned at the bottom-right displays live PnL for open trades:
Entry Price
Unrealized PnL %
Text colors adapt based on whether unrealized profit is positive, negative, or neutral.
Technical Notes
This strategy uses only close prices — no trend indicators or volume components are applied.
All calculations are based on simple moving averages and standard deviation over user-defined windows.
Designed as a minimal, isolated Z-Score engine without confirmation filters or multi-factor triggers.