Fibonacci ATR Fusion - Strategy [presentTrading]Open-script again! This time is also an ATR-related strategy. Enjoy! :)
If you have any questions, let me know, and I'll help make this as effective as possible.
█ Introduction and How It Is Different
The Fibonacci ATR Fusion Strategy is an advanced trading approach that uniquely integrates Fibonacci-based weighted averages with the Average True Range (ATR) to identify and capitalize on significant market trends.
Unlike traditional strategies that rely on single indicators or static parameters, this method combines multiple timeframes and dynamic volatility measurements to enhance precision and adaptability. Additionally, it features a 4-step Take Profit (TP) mechanism, allowing for systematic profit-taking at various levels, which optimizes both risk management and return potential in long and short market positions.
BTCUSD 6hr Performance
█ Strategy, How It Works: Detailed Explanation
The Fibonacci ATR Fusion Strategy utilizes a combination of technical indicators and weighted averages to determine optimal entry and exit points. Below is a breakdown of its key components and operational logic.
🔶 1. Enhanced True Range Calculation
The strategy begins by calculating the True Range (TR) to measure market volatility accurately.
TR = max(High - Low, abs(High - Previous Close), abs(Low - Previous Close))
High and Low: Highest and lowest prices of the current trading period.
Previous Close: Closing price of the preceding trading period.
max: Selects the largest value among the three calculations to account for gaps and limit movements.
🔶 2. Buying Pressure (BP) Calculation
Buying Pressure (BP) quantifies the extent to which buyers are driving the price upwards within a period.
BP = Close - True Low
Close: Current period's closing price.
True Low: The lower boundary determined in the True Range calculation.
🔶 3. Ratio Calculation for Different Periods
To assess the strength of buying pressure relative to volatility, the strategy calculates a ratio over various Fibonacci-based timeframes.
Ratio = 100 * (Sum of BP over n periods) / (Sum of TR over n periods)
n: Length of the period (e.g., 8, 13, 21, 34, 55).
Sum of BP: Cumulative Buying Pressure over n periods.
Sum of TR: Cumulative True Range over n periods.
This ratio normalizes buying pressure, making it comparable across different timeframes.
🔶 4. Weighted Average Calculation
The strategy employs a weighted average of ratios from multiple Fibonacci-based periods to smooth out signals and enhance trend detection.
Weighted Avg = (w1 * Ratio_p1 + w2 * Ratio_p2 + w3 * Ratio_p3 + w4 * Ratio_p4 + Ratio_p5) / (w1 + w2 + w3 + w4 + 1)
w1, w2, w3, w4: Weights assigned to each ratio period.
Ratio_p1 to Ratio_p5: Ratios calculated for periods p1 to p5 (e.g., 8, 13, 21, 34, 55).
This weighted approach emphasizes shorter periods more heavily, capturing recent market dynamics while still considering longer-term trends.
🔶 5. Simple Moving Average (SMA) of Weighted Average
To further smooth the weighted average and reduce noise, a Simple Moving Average (SMA) is applied.
Weighted Avg SMA = SMA(Weighted Avg, m)
- m: SMA period (e.g., 3).
This smoothed line serves as the primary signal generator for trade entries and exits.
🔶 6. Trading Condition Thresholds
The strategy defines specific threshold values to determine optimal entry and exit points based on crossovers and crossunders of the SMA.
Long Condition = Crossover(Weighted Avg SMA, Long Entry Threshold)
Short Condition = Crossunder(Weighted Avg SMA, Short Entry Threshold)
Long Exit = Crossunder(Weighted Avg SMA, Long Exit Threshold)
Short Exit = Crossover(Weighted Avg SMA, Short Exit Threshold)
Long Entry Threshold (T_LE): Level at which a long position is triggered.
Short Entry Threshold (T_SE): Level at which a short position is triggered.
Long Exit Threshold (T_LX): Level at which a long position is exited.
Short Exit Threshold (T_SX): Level at which a short position is exited.
These conditions ensure that trades are only executed when clear trends are identified, enhancing the strategy's reliability.
Previous local performance
🔶 7. ATR-Based Take Profit Mechanism
When enabled, the strategy employs a 4-step Take Profit system to systematically secure profits as the trade moves in the desired direction.
TP Price_1 Long = Entry Price + (TP1ATR * ATR Value)
TP Price_2 Long = Entry Price + (TP2ATR * ATR Value)
TP Price_3 Long = Entry Price + (TP3ATR * ATR Value)
TP Price_1 Short = Entry Price - (TP1ATR * ATR Value)
TP Price_2 Short = Entry Price - (TP2ATR * ATR Value)
TP Price_3 Short = Entry Price - (TP3ATR * ATR Value)
- ATR Value: Calculated using ATR over a specified period (e.g., 14).
- TPxATR: User-defined multipliers for each take profit level.
- TPx_percent: Percentage of the position to exit at each TP level.
This multi-tiered exit strategy allows for partial position closures, optimizing profit capture while maintaining exposure to potential further gains.
█ Trade Direction
The Fibonacci ATR Fusion Strategy is designed to operate in both long and short market conditions, providing flexibility to traders in varying market environments.
Long Trades: Initiated when the SMA of the weighted average crosses above the Long Entry Threshold (T_LE), indicating strong upward momentum.
Short Trades: Initiated when the SMA of the weighted average crosses below the Short Entry Threshold (T_SE), signaling robust downward momentum.
Additionally, the strategy can be configured to trade exclusively in one direction—Long, Short, or Both—based on the trader’s preference and market analysis.
█ Usage
Implementing the Fibonacci ATR Fusion Strategy involves several steps to ensure it aligns with your trading objectives and market conditions.
1. Configure Strategy Parameters:
- Trading Direction: Choose between Long, Short, or Both based on your market outlook.
- Trading Condition Thresholds: Set the Long Entry, Short Entry, Long Exit, and Short Exit thresholds to define when to enter and exit trades.
2. Set Take Profit Levels (if enabled):
- ATR Multipliers: Define how many ATRs away from the entry price each take profit level is set.
- Take Profit Percentages: Allocate what percentage of the position to close at each TP level.
3. Apply to Desired Chart:
- Add the strategy to the chart of the asset you wish to trade.
- Observe the plotted Fibonacci ATR and SMA Fibonacci ATR indicators for visual confirmation.
4. Monitor and Adjust:
- Regularly review the strategy’s performance through backtesting.
- Adjust the input parameters based on historical performance and changing market dynamics.
5. Risk Management:
- Ensure that the sum of take profit percentages does not exceed 100% to avoid over-closing positions.
- Utilize the ATR-based TP levels to adapt to varying market volatilities, maintaining a balanced risk-reward ratio.
█ Default Settings
Understanding the default settings is crucial for optimizing the Fibonacci ATR Fusion Strategy's performance. Here's a precise and simple overview of the key parameters and their effects:
🔶 Key Parameters and Their Effects
1. Trading Direction (`tradingDirection`)
- Default: Both
- Effect: Determines whether the strategy takes both long and short positions or restricts to one direction. Selecting Both allows maximum flexibility, while Long or Short can be used for directional bias.
2. Trading Condition Thresholds
Long Entry (long_entry_threshold = 58.0): Higher values reduce false positives but may miss trades.
Short Entry (short_entry_threshold = 42.0): Lower values capture early short trends but may increase false signals.
Long Exit (long_exit_threshold = 42.0): Exits long positions early, securing profits but potentially cutting trends short.
Short Exit (short_exit_threshold = 58.0): Delays short exits to capture favorable movements, avoiding premature exits.
3. Take Profit Configuration (`useTakeProfit` = false)
- Effect: When enabled, the strategy employs a 4-step TP mechanism to secure profits at multiple levels. By default, it is disabled to allow users to opt-in based on their trading style.
4. ATR-Based Take Profit Multipliers
TP1 (tp1ATR = 3.0): Sets the first TP at 3 ATRs for initial profit capture.
TP2 (tp2ATR = 8.0): Targets larger trends, though less likely to be reached.
TP3 (tp3ATR = 14.0): Optimizes for extreme price moves, seldom triggered.
5. Take Profit Percentages
TP Level 1 (tp1_percent = 12%): Secures 12% at the first TP.
TP Level 2 (tp2_percent = 12%): Exits another 12% at the second TP.
TP Level 3 (tp3_percent = 12%): Closes an additional 12% at the third TP.
6. Weighted Average Parameters
Ratio Periods: Fibonacci-based intervals (8, 13, 21, 34, 55) balance responsiveness.
Weights: Emphasizes recent data for timely responses to market trends.
SMA Period (weighted_avg_sma_period = 3): Smoothens data with minimal lag, balancing noise reduction and responsiveness.
7. ATR Period (`atrPeriod` = 14)
Effect: Sets the ATR calculation length, impacting TP sensitivity to volatility.
🔶 Impact on Performance
- Sensitivity and Responsiveness:
- Shorter Ratio Periods and Higher Weights: Make the weighted average more responsive to recent price changes, allowing quicker trade entries and exits but increasing the likelihood of false signals.
- Longer Ratio Periods and Lower Weights: Provide smoother signals with fewer false positives but may delay trade entries, potentially missing out on significant price moves.
- Profit Taking:
- ATR Multipliers: Higher multipliers set take profit levels further away, targeting larger price movements but reducing the probability of reaching these levels.
- Fixed Percentages: Allocating equal percentages at each TP level ensures consistent profit realization and risk management, preventing overexposure.
- Trade Direction Control:
- Selecting Specific Directions: Restricting trades to Long or Short can align the strategy with market trends or personal biases, potentially enhancing performance in trending markets.
- Risk Management:
- Take Profit Percentages: Dividing the position into smaller percentages at multiple TP levels helps lock in profits progressively, reducing risk and allowing the remaining position to ride further trends.
- Market Adaptability:
- Weighted Averages and ATR: By combining multiple timeframes and adjusting to volatility, the strategy adapts to different market conditions, maintaining effectiveness across various asset classes and timeframes.
---
If you want to know more about ATR, can also check "SuperATR 7-Step Profit".
Enjoy trading.
Truerange
IsAlgo - CandleWave Channel Strategy► Overview:
The CandleWave Channel Strategy uses an exponential moving average (EMA) combined with a custom true range function to dynamically calculate a multi-level price channel, helping traders identify potential trend reversals and price pullbacks.
► Description:
The CandleWave Channel Strategy is built around an EMA designed to identify potential reversal points in the market. The channel’s main points are calculated using this EMA, which serves as the foundation for the strategy’s dynamic price channel. The channel edges are determined using a proprietary true range function that measures the distance between the highs and lows of price movements over a specific period. By factoring in the maximum distance between highs and lows and averaging these values over the period, the strategy creates a responsive channel that adapts to current market conditions. The channel consists of five levels, each representing different degrees of trend tension.
The strategy continuously monitors the price in relation to the channel edges. When a candle closes outside one of these edges, it indicates a potential price reversal. This outside-close candle acts as a signal for a possible trend change, prompting the strategy to prepare for a trade entry. Upon detecting an outside-close candle, the strategy triggers an entry. The logic behind this is that when the price moves outside the defined channel, it is likely to revert back within the channel and move towards the opposite edge. The strategy aims to capitalize on this reversion by entering trades based on these signals.
Traders can adjust the channel’s length, levels, and minimum distance to tailor it to different market conditions. They can also define the characteristics of the entry candle, such as its size, body, and relative position to previous candles, to ensure it meets specific conditions before triggering a trade. Additionally, the strategy permits the specification of trading hours and days, enabling traders to focus on preferred market periods. Exit can be configured based on profit/loss limits, trade duration, and band reversal signals or other criteria.
How it Works:
Channel Calculation: The strategy continuously updates the channel edges using the EMA and true range function.
Signal Detection: It waits for a candle to close outside the channel edges.
Trade Entry: When an outside-close candle is detected, the strategy enters a trade expecting the price to revert to the opposite channel edge.
Customization: Users can define the characteristics of the entry candle, such as its size relative to previous candles, to ensure it meets specific conditions before triggering a trade.
↑ Long Trade Example:
The entry candle closes below the channel level, indicating a potential upward reversal. The strategy enters a long position expecting the price to move towards the upper levels.
↓ Short Trade Example:
The entry candle closes above the channel level, signaling a potential downward reversal. The strategy enters a short position anticipating the price to revert towards the lower levels.
► Features and Settings:
⚙︎ Channel: Adjust the channel’s length, levels, and minimum distance to suit different market conditions and trading styles.
⚙︎ Entry Candle: Customize entry criteria, including candle size, body, and relative position to previous candles for accurate signal generation.
⚙︎ Trading Session: Define specific trading hours during which the strategy operates, restricting trades to preferred market periods.
⚙︎ Trading Days: Specify active trading days to avoid certain days of the week.
⚙︎ Backtesting: backtesting for a selected period to evaluate strategy performance. This feature can be deactivated if not needed.
⚙︎ Trades: Configure trade direction (long, short, or both), position sizing (fixed or percentage-based), maximum number of open trades, and daily trade limits.
⚙︎ Trades Exit: Set profit/loss limits, specify trade duration, or exit based on band reversal signals.
⚙︎ Stop Loss: Choose from various stop-loss methods, including fixed pips, ATR-based, or highest/lowest price points within a specified number of candles. Trades can also be closed after a certain number of adverse candle movements.
⚙︎ Break Even: Adjust stop loss to break even once predefined profit levels are reached, protecting gains.
⚙︎ Trailing Stop: Implement a trailing stop to adjust the stop loss as the trade becomes profitable, securing gains and potentially capturing further upside.
⚙︎ Take Profit: Set up to three take-profit levels using methods such as fixed pips, ATR, or risk-to-reward ratios. Alternatively, specify a set number of candles moving in the trade’s direction.
⚙︎ Alerts: Comprehensive alert system to notify users of significant actions, including trade openings and closings. Supports dynamic placeholders for take-profit levels and stop-loss prices.
⚙︎ Dashboard: Visual display on the chart providing detailed information about ongoing and past trades, aiding users in monitoring strategy performance and making informed decisions.
► Backtesting Details:
Timeframe: 30-minute GBPJPY chart
Initial Balance: $10,000
Order Size: 500 units
Commission: 0.02%
Slippage: 5 ticks
[MACLEN] TRUE RANGEThis is a true range (TR) based strategy with weighted moving average (WMA) smoothing to remove noise.
In addition, it includes a risk management strategy using 4 "safes" in the same operation to always seek to make a profit.
This is for evaluation only, and it is not recommended to use with real money.
It is a work in progress. I read your comments.
Rosebud Trend Backtest [DepthHouse]*Past Performance Does Not Guarantee Future Results*
*Strategy created for backtesting purposes only.
*Backtesting assesses the viability of a trading strategy or pricing model by discovering how it would have played out retrospectively using historical data.
* Please be sure to read all updates below as the information below could change with future updates.
Rosebud Trend Indicator uses complex range calculations to easily detect trend changes, critical support and resistance levels, and even aid in spotting reversals. The Critical Support & Resistance Zones are plotted via the red and green cloud. This cloud not only visually displays the expected trend direction but often acts as major support and resistance zones. The outer band measures the expected range in which the assets trade over longer periods of time.
The Rosebud Trend Backtest combines the calculations of the ATR Auto Oscillator & the Rosebud Trend Indicator to demonstrate backtest performance.
// Settings //
Users can switch the ‘ Trend Sensitivity ’ between ‘ Low ', ' Med ', and ‘ High ’ to increase or decrease the rate at which the cloud changes.
By altering the S/R Band Thickness users can furthermore increase or decrease the rate at which a trend changes by altering the thickness of the cloud. Default is .50 however this can be lowered if needed.
Bar colors are generated by a combination of Rosebuds primary function and our ATR AUTO Oscillator base functions. Users have 3 bar color options to select from: Simple, Complex, and Off.
Simple: Bars colors alternate between shades of red and green based on the trend direction and the ATR Auto strength. The stronger the shade, the stronger the trend.
Complex: This adds a few extra variables to the script which generates a more complex bar color display. Using this option, Rosebud will generate light red bars in a bull trend if downward movement is strong and vice versa in a bear trend. It also will generate a purple bar if the candle successfully closes above or below the Top & Bottom Range Bands; We call this a range break, and it could be an early sign of strong upward or downward movement.
Off: In case you like to keep things even simpler, this option hides all overlay bar colors.
ATR Options: Used for Light & Strong Entries/Exits // Bar Colors also based on these settings
ATR Smoothed Signal Option: Turns advance smoothing on or off. On will reduce signal noise, while Off could land you that perfect bottom signal with a lower success rate.
ATR Candlestick Length: Default factor for bar color and shape generation, the higher the number the fewer signals that will generate.
ATR Candlestick Smoothing: Default smoothing for the Candlestick Length
Signal Lookback: Adjust the factor at which Bull, Bear, Up, and Down. Lower this to 2 for more signals.
// ⇅ BackTest Settings ⇅ //
Short Trading: Option to see backtest results for both long and short positions. Default is Long Only.
Strategy Entry Options:
Trend Only: Positions are entered right as there is a cloud trend change.
Light Entry: This enters a trade as soon as there is a breakout or breakdown signal generated from the ATR settings.
Strong Entry: Multiple conditions must be met; Price action must be near the Trend Base and must receive either a bullish or bearish crossover in the oversold or overbought range of the ATR Settings.
Strategy Exit Options:
Trend Only: Exits all positions after there is a primary trend change.
Light Exit: Exits a user set percentage of open positions when the ATR generates a breakdown or breakout. Will continue to do this at each occurrence. Presets are built in to keep these from triggering too often in volatile conditions.
Strong Exit: Exits a user set percentage of open positions when the ATR generates a bullish or bearish crossover in the overbought or oversold ranges. Will continue to do this with each occurrence. Presets are built in to keep these from triggering too often in volatile conditions.
Profit Points: Exits a set percentage of the position up to 3 times at a user set percentage gap from the entry. Any remaining amount in the position exits upon a trend change.
Profit QTY Percent: Percent of the position to exit when an exit condition triggers. This does not apply to the “Trend Only” exit option.
Profit Percent Gap: Percent gap for Profit Point Exits. Recommend adjusting based on timeframe. See example below.
Volatility Backtest The Volatility function measures the market volatility by plotting a
smoothed average of the True Range. It returns an average of the TrueRange
over a specific number of bars, giving higher weight to the TrueRange of
the most recent bar.
You can change long to short in the Input Settings
WARNING:
- For purpose educate only
- This script to change bars colors.