Enhanced Divergence Indicator / Strategy (many oscillators)Hi, Guys!
So, I am publishing a divergence script, with the ability to choose from many indicators, which is equipped to serve either as a strategy or an indicator (or both).
In my opinion, trading with indicators is not something that can consistently bring you profit. But one of the most effective ways to use an indicator is precisely divergence, since it also contains information about imbalance in the price action. This is still one of the main tasks of technical analysis of price movements.
That is why I decided to make a script public, which I myself use with some additional functions, and here I am publishing the main ones. Most of its elements can be found in other community scripts, but not quite collected in one, and not all. The main difference is that here I provide an opportunity to refine the divergences, by using a filter for the minimum price difference in the two extremes, the minimum difference in the extremes of the indicator and something else that you will not find anywhere in free code. As far as I can, I have also made a filter for the minimum reverse movement of the indicator between its two extremes, which make up the divergence. In the settings, I have called it "Minimum Oscillator Pullback".
I'm not a programmer, so my script is crude and inelegant, but overall it does the job.
I added the ability to use a few more widespread filters, but with some small additional options. For example, you can display a fast and slow moving average, but the good thing is that among them there is also T3 - one of the best MAs for showing a trend. You should keep in mind, however, that this way of using a trend is not very good when using divergences.
I also added an underestimated indicator as a filter, which could be quite effective here. It is the Stochastic Momentum Index. I have given the option to use a different timeframe for it. Usually, in oscillators, overbought and oversold zones are searched for, but here its more effective use is rather the opposite. It actually shows the strength of the trend. That's why I made an option for its reversed use, and in addition, its limit levels are also variable.
There is also a filter for eliminating trading days and/or trading hours.
To make the code more informative, I have provided an opportunity to test the strategy with leverage.
There is an option to use TP and SL.
Regarding closing a position, there are also several options. I have not seen anyone else use it, but with a lot of testing, I have found that the SMI mentioned and used as a filter is a very good indicator for exiting a position. This is one thing. But something even better that I have found and put in the code is the use of standard deviation. Most algo-traders use Average True Range for exit. Well, I have personally found with a lot of historical data that Standard Deviation is actually much more effective for this.
For variety, and also because such trading systems exist, I have added the option to close after a certain number of candles. Here I have also added an additional functionality - closing on a candle in the opposite direction of the open position, after the specified number of candles have passed.
Apart from this, there is also an option to use VWAP for exit.
You will see that there are more than a dozen indicators to choose from for divergence. I have tested dozens, maybe hundreds of others, which at first glance seem very suitable for this. But in practice I have found that they do not really add anything.
Keep in mind that in different timeframes, in different market conditions, and different assets behave differently. For some, some indicators are better, but in another timeframe they are weak.
In addition, the filters for improving divergence sometimes behave strangely (for example, for an oscillator it may be good to accept a negative and very large value for the minimum movement between its extremes). This is because they are not standardized and have different scales. But if you play around with the options enough, you will understand what works for you.
Now I can't think of anything more to say, inside the options things should be relatively clear. If there are adequate questions that I am able to answer (I remind you that I am an amateur), I will write in the comments. I am sure that this code will be useful for many, but do not rely too much on it and do not take risks without testing - both with historical data and paper trading. As you know, in any case, nothing is guaranteed in the future.
I think I missed something important.
When you use the script as an indicator, a line will always appear when there is a divergence. It may seem strange to you on the price movement, but keep in mind that it shows exactly where the extremes of the oscillator, which is not visible on the chart, are. A sign will appear on this line when the divergence meets your other conditions - the filters and enhancements included.
In addition, there are options to limit the divergence indication to a number of candles. In practice, this is necessary and improves the results. It is very important to understand that in order for the script to indicate the last extreme, which we will use to open a position, it must first have determined that we have already gone in the opposite direction. Therefore, the options specify candles to the left, but also candles to the right after the peak, to verify that this is really a peak (or bottom). Many believe that this makes divergences bad for trading, since the signal is actually received later. Well, this is not entirely true and you can check it yourself. You can safely set the right candles to 0 and you will see that there are many false signals. Usually it is best to use 2 candles on the right for a signal and if the divergence is good, they still give a good entry. In certain conditions it is good with just one candle.
"entry"に関するスクリプトを検索
Adaptive SuperTrend StrategyThe Adaptive SuperTrend Trading Strategy is an advanced trading algorithm inspired by the Machine Learning Adaptive SuperTrend @AlgoAlpha indicator. This strategy enhances the traditional SuperTrend concept by integrating volatility clustering, adaptive ATR-based trend detection, and a structured entry/exit system. It aims to maximize trading efficiency by reducing false signals and capturing trends with optimized risk management.
How It Works
The strategy revolves around the following key components:
1. Adaptive SuperTrend Calculation
The core SuperTrend is calculated using the ATR (Average True Range) with an adjustable factor to detect trend direction.
Trend shifts are confirmed using directional crossovers (ta.crossunder(dir, 0) for bullish shifts and ta.crossover(dir, 0) for bearish shifts).
2. Volatility Clustering via Machine Learning
The strategy applies a k-means-like clustering method to segment market volatility into three categories:
High Volatility (Cluster 0): Avoids trend entries due to unstable market conditions.
Medium Volatility (Cluster 1): Accepts entries but with cautious stop-loss management.
Low Volatility (Cluster 2): Ideal conditions for trend-following entries.
Clustering is derived from historical ATR values, ensuring adaptability to changing market conditions.
3. Entry and Exit Rules
Long Entry Conditions:
Bullish trend shift (ta.crossunder(dir, 0)).
Market is in low or medium volatility to avoid choppy conditions.
Price is above the SuperTrend line.
Short Entry Conditions:
Bearish trend shift (ta.crossover(dir, 0)).
Market is in high volatility, indicating a strong downward move.
Price is below the SuperTrend line.
Exit Conditions:
Stop-loss and take-profit are determined by ATR multipliers.
A long trade is exited when price crosses below the SuperTrend line.
A short trade is exited when price crosses above the SuperTrend line.
How It Captures Profit
Trend Following: By entering trades at trend shifts and staying in the trend, the strategy maximizes profit potential.
Volatility Filtering: Avoids trading in highly volatile, unpredictable conditions, reducing drawdowns.
Risk Management: Uses ATR-based stop-loss and take-profit to dynamically adjust for different market conditions.
Best Markets & Timeframes
This strategy is versatile and can be applied across multiple markets and timeframes:
Best Markets
Forex (EUR/USD, GBP/USD, USD/JPY): Works well due to trending nature.
Cryptocurrency (Bitcoin, Ethereum, Solana): Captures major trend moves with volatility filtering.
Stocks (AAPL, TSLA, AMZN): Ideal for swing trading on daily or 4H charts.
Commodities (Gold, Oil, Silver): Performs well in breakout trends and trending cycles.
Recommended Timeframes
Intraday (15m, 30m, 1H): Works well for active traders who want frequent trades.
Swing Trading (4H, Daily): Captures major trends for medium-term traders.
Long-Term (Weekly, Monthly): Useful for filtering macro trends and long-term investing.
Conclusion
The Adaptive SuperTrend Trading Strategy builds upon the Machine Learning Adaptive SuperTrend concept by incorporating trend confirmation, volatility clustering, and risk management into a robust trading system. It provides high-probability trade entries while minimizing risk through volatility-based filtering.
With its adaptability across different markets and timeframes, it serves as a powerful tool for traders looking to optimize their trend-following strategies while maintaining strong risk control mechanisms.
EBL - Enigma BOS LogicThe EBL - Enigma BOS Logic indicator is designed to detect key trend reversal points with precision by leveraging a unique concept based on two-candle price action analysis. Inspired by the balance of pairs in creation, this indicator identifies trend changes by focusing on significant bullish and bearish candle pairs, storing key levels, and waiting for confirmation to provide actionable trade signals. It goes beyond conventional trend-following indicators by offering real-time alerts and clear visual cues for traders.
How It Works
Bullish Setup:
The indicator identifies a bullish candle followed by a bearish candle. It then stores the high of the bullish candle as a potential reversal level.
A bullish confirmation occurs when a future bullish candle closes above the stored high. When this happens:
A green arrow is plotted below the confirming candle.
A horizontal green line is drawn at the stored high level, extending forward by a user-defined number of bars.
An alert is triggered to notify the trader of a confirmed bullish trend.
Bearish Setup:
The indicator identifies a bearish candle followed by a bullish candle. It stores the low of the bearish candle as a potential reversal level.
A bearish confirmation occurs when a future bearish candle closes below the stored low. When this happens:
A red arrow is plotted above the confirming candle.
A horizontal red line is drawn at the stored low level, extending forward by a user-defined number of bars.
An alert is triggered to notify the trader of a confirmed bearish trend.
Touch or Cross Alerts:
In addition to initial trend confirmation, the indicator tracks price movements relative to the drawn horizontal lines.
If the price returns to touch or cross a previously drawn horizontal line, an alert is triggered, indicating a potential re-entry or retracement opportunity.
Customization Options
To make the indicator versatile and adaptable for different trading styles, several customization options are provided:
Line Colors: Traders can customize the colors of the bullish and bearish lines.
Show/Hide Arrows and Lines: Users can choose whether to display the arrows and horizontal lines on the chart.
Line Length: The length of the horizontal lines (number of bars they extend into the future) is user-defined, offering flexibility based on trading timeframes and preferences.
Use Cases
Trend Reversal Detection: EBL is ideal for identifying key trend reversals, allowing traders to enter trades with a high probability of success.
Breakout Confirmation: The indicator provides visual and alert-based confirmation of breakouts beyond critical support or resistance levels.
Re-entry Opportunities: With alerts for price touching or crossing horizontal lines, traders can spot potential re-entry points during retracements.
Conceptual Foundation
The methodology behind this indicator is rooted in the principle that markets often move in pairs of bullish and bearish forces. By tracking the interaction between consecutive bullish and bearish candles and waiting for clear confirmations, this indicator ensures that only high-probability trend changes are signaled. This reduces noise and enhances trading accuracy, making it suitable for scalping, day trading, and swing trading across various timeframes.
How to Use
Apply the indicator to any chart and timeframe of your choice.
Set your preferred customization options, including line colors, arrow display, and line length.
Watch for arrows and listen for alerts to identify confirmed trend changes.
Pay attention to touch or cross alerts on horizontal lines, as these can signal potential re-entry or secondary trade opportunities.
Combine with other analysis: While EBL is powerful on its own, combining it with support/resistance analysis, moving averages, or volume indicators can further enhance its effectiveness.
This indicator is a powerful tool for traders seeking precision in identifying trend changes and actionable trade signals. Its unique logic, real-time alerts, and clear visual cues make it a valuable addition to any trader’s toolkit.
Mean Reversion Pro Strategy [tradeviZion]Mean Reversion Pro Strategy : User Guide
A mean reversion trading strategy for daily timeframe trading.
Introduction
Mean Reversion Pro Strategy is a technical trading system that operates on the daily timeframe. The strategy uses a dual Simple Moving Average (SMA) system combined with price range analysis to identify potential trading opportunities. It can be used on major indices and other markets with sufficient liquidity.
The strategy includes:
Trading System
Fast SMA for entry/exit points (5, 10, 15, 20 periods)
Slow SMA for trend reference (100, 200 periods)
Price range analysis (20% threshold)
Position management rules
Visual Elements
Gradient color indicators
Three themes (Dark/Light/Custom)
ATR-based visuals
Signal zones
Status Table
Current position information
Basic performance metrics
Strategy parameters
Optional messages
📊 Strategy Settings
Main Settings
Trading Mode
Options: Long Only, Short Only, Both
Default: Long Only
Position Size: 10% of equity
Starting Capital: $20,000
Moving Averages
Fast SMA: 5, 10, 15, or 20 periods
Slow SMA: 100 or 200 periods
Default: Fast=5, Slow=100
🎯 Entry and Exit Rules
Long Entry Conditions
All conditions must be met:
Price below Fast SMA
Price below 20% of current bar's range
Price above Slow SMA
No existing position
Short Entry Conditions
All conditions must be met:
Price above Fast SMA
Price above 80% of current bar's range
Price below Slow SMA
No existing position
Exit Rules
Long Positions
Exit when price crosses above Fast SMA
No fixed take-profit levels
No stop-loss (mean reversion approach)
Short Positions
Exit when price crosses below Fast SMA
No fixed take-profit levels
No stop-loss (mean reversion approach)
💼 Risk Management
Position Sizing
Default: 10% of equity per trade
Initial capital: $20,000
Commission: 0.01%
Slippage: 2 points
Maximum one position at a time
Risk Control
Use daily timeframe only
Avoid trading during major news events
Consider market conditions
Monitor overall exposure
📊 Performance Dashboard
The strategy includes a comprehensive status table displaying:
Strategy Parameters
Current SMA settings
Trading direction
Fast/Slow SMA ratio
Current Status
Active position (Flat/Long/Short)
Current price with color coding
Position status indicators
Performance Metrics
Net Profit (USD and %)
Win Rate with color grading
Profit Factor with thresholds
Maximum Drawdown percentage
Average Trade value
📱 Alert Settings
Entry Alerts
Long Entry (Buy Signal)
Short Entry (Sell Signal)
Exit Alerts
Long Exit (Take Profit)
Short Exit (Take Profit)
Alert Message Format
Strategy name
Signal type and direction
Current price
Fast SMA value
Slow SMA value
💡 Usage Tips
Consider starting with Long Only mode
Begin with default settings
Keep track of your trades
Review results regularly
Adjust settings as needed
Follow your trading plan
⚠️ Disclaimer
This strategy is for educational and informational purposes only. It is not financial advice. Always:
Conduct your own research
Test thoroughly before live trading
Use proper risk management
Consider your trading goals
Monitor market conditions
Never risk more than you can afford to lose
📝 Credits
Inspired by:
"Mean Reversion Trading Strategy for a High Win Rate" - YouTube channel "The Transparent Trader"
"Highly Reliable Mean Reversion Trading Strategy Backtested x Millions of Trades" - YouTube channel "seriousbacktester"
"Trade with Discipline, Manage Risk, Stay Consistent" - tradeviZion
Fibonacci Trend [ChartPrime]Fibonacci Trend Indicator
This powerful indicator leverages supertrend analysis to detect market direction while overlaying dynamic Fibonacci levels to highlight potential support, resistance, and optimal trend entry zones. With its straightforward design, it is perfect for traders looking to simplify their workflow and enhance decision-making.
⯁ KEY FEATURES AND HOW TO USE
⯌ Supertrend Trend Identification :
The indicator uses a supertrend algorithm to identify market direction. It displays purple for downtrends and green for uptrends, ensuring quick and clear trend analysis.
⯌ Fibonacci Levels for Current Swings :
Automatically calculates Fibonacci retracement levels (0.236, 0.382, 0.618, 0.786) for the current swing leg.
- These levels act as key zones for potential support, resistance, and trend continuation.
- The high and low swing points are labeled with exact prices, ensuring clarity.
- If the swing range is insufficient (less than five times ATR), Fibonacci levels are not displayed, avoiding irrelevant data.
⯌ Extended Fibonacci Levels :
User-defined extensions project Fibonacci levels into the future, aiding traders in planning price targets or projecting key zones.
⯌ Optimal Trend Entry Zone :
A filled area between 0.618 and 0.786 levels visually highlights the optimal entry zone for trend continuation. This allows traders to refine their entry points during pullbacks.
⯌ Diagonal Trend Line :
A dashed diagonal line connects the swing high and low, visually confirming the range and trend strength of the current swing.
⯌ Visual Labels for Fibonacci Levels :
Each Fibonacci level is marked with a label displaying its value for quick reference.
⯁ HOW TRADERS CAN POTENTIALLY USE THIS TOOL
Fibonacci Retracements:
Use the Fibonacci retracement levels to find key support or resistance zones where the price may pull back before continuing its trend.
Example: Enter long trades when the price retraces to 0.618–0.786 levels in an uptrend.
Fibonacci Extensions:
Use Fibonacci extensions to project future price targets based on the current trend's swing leg. Levels like 127.2% and 161.8% are commonly used as profit-taking zones.
Reversal Identification:
Spot potential reversals by monitoring price reactions at key Fibonacci retracement levels (e.g., 0.236 or 0.382) or the swing high/low.
Optimal Trend Entries:
The filled zone between 0.618 and 0.786 is a statistically strong area for entering a position in the direction of the trend.
Example: Enter long positions during retracements to this range in an uptrend.
Risk Management:
Set stop-losses below key Fibonacci levels or the swing low/high, and take profits at extension levels, enhancing your trade management strategies.
⯁ CONCLUSION
The Fibonacci Trend Indicator is a straightforward yet effective tool for identifying trends and key Fibonacci levels. It simplifies analysis by integrating supertrend-based trend identification with Fibonacci retracements, extensions, and optimal entry zones. Whether you're a beginner or experienced trader, this indicator is an essential addition to your toolkit for trend trading, reversal spotting, and risk management.
000 RSI Divergence with Trendline v2Updated version of the strategy RSI Divergence with Trendline.
Calculates the RSI indicator using the specified settings
Detects pivot points (highs and lows) in the RSI with a 5-period lookback
Uses these pivots to identify four types of divergences:
Regular bullish divergence: Price makes lower lows but RSI makes higher lows
Hidden bullish divergence: Price makes higher lows but RSI makes lower lows
Regular bearish divergence: Price makes higher highs but RSI makes lower highs
Hidden bearish divergence: Price makes lower highs but RSI makes higher highs
Creates dynamic trendlines on the RSI indicator
Uses different colors to distinguish between divergence types:
Green: Regular bullish divergence
Blue: Hidden bullish divergence
Red: Regular bearish divergence
Orange: Hidden bearish divergence
Automatically deletes and redraws trendlines when new divergences are detected
Entry Signals
Long entries:
Triggered when RSI crosses above the bullish trendline
Sets take profit price at entry price + 5%
Sets stop loss price at entry price - 5%
Short entries:
Triggered when RSI crosses below the bearish trendline
Sets take profit price at entry price - 5%
Sets stop loss price at entry price + 5%
Exit Rules
Takes profit when price reaches the TP level
Exits with a loss when price hits the SL level
Additional exit conditions:
Exits long positions when hidden bearish divergence appears
Exits short positions when hidden bullish divergence appears
Plots the RSI indicator in purple
Shows overbought and oversold levels as horizontal lines
Displays active take profit and stop loss levels with circular markers:
Green circles for take profit levels
Red circles for stop loss levels
ema,atr and with Bollinger Bands (Indicator)1. Indicator Overview
The indicator:
Displays EMA and Bollinger Bands on the chart.
Tracks price behavior during a user-defined trading session.
Generates long/short signals based on crossover conditions of EMA or Bollinger Bands.
Provides alerts for potential entries and exits.
Visualizes tracked open and close prices to help traders interpret market conditions.
2. Key Features
Inputs
session_start and session_end: Define the active trading session using timestamps.
E.g., 17:00:00 (5:00 PM) for session start and 15:40:00 (3:40 PM) for session end.
atr_length: The lookback period for the Average True Range (ATR), used for price movement scaling.
bb_length and bb_mult: Control the Bollinger Bands' calculation, allowing customization of sensitivity.
EMA Calculation
A 21-period EMA is calculated using:
pinescript
Copy code
ema21 = ta.ema(close, 21)
Purpose: Acts as a dynamic support/resistance level. Price crossing above or below the EMA indicates potential trend changes.
Bollinger Bands
Purpose: Measure volatility and identify overbought/oversold conditions.
Formula:
Basis: Simple Moving Average (SMA) of closing prices.
Upper Band: Basis + (Standard Deviation × Multiplier).
Lower Band: Basis - (Standard Deviation × Multiplier).
Code snippet:
pinescript
Copy code
bb_basis = ta.sma(close, bb_length)
bb_dev = bb_mult * ta.stdev(close, bb_length)
bb_upper = bb_basis + bb_dev
bb_lower = bb_basis - bb_dev
Session Tracking
The in_session variable ensures trading signals are only generated within the defined session:
pinescript
Copy code
in_session = time >= session_start and time <= session_end
3. Entry Conditions
EMA Crossover
Long Signal: When the price crosses above the EMA during the session:
pinescript
Copy code
ema_long_entry_condition = ta.crossover(close, ema21) and in_session and barstate.isconfirmed
Short Signal: When the price crosses below the EMA during the session:
pinescript
Copy code
ema_short_entry_condition = ta.crossunder(close, ema21) and in_session and barstate.isconfirmed
Bollinger Bands Crossover
Long Signal: When the price crosses above the upper Bollinger Band:
pinescript
Copy code
bb_long_entry_condition = ta.crossover(close, bb_upper) and in_session and barstate.isconfirmed
Short Signal: When the price crosses below the lower Bollinger Band:
pinescript
Copy code
bb_short_entry_condition = ta.crossunder(close, bb_lower) and in_session and barstate.isconfirmed
4. Tracked Prices
The script keeps track of key open/close prices using the following logic:
If a long signal is detected and the close is above the open, it tracks the open price.
If the close is below the open, it tracks the close price.
Tracked values are scaled using *4 (custom scaling logic).
These tracked prices are plotted for visual feedback:
pinescript
Copy code
plot(tracked_open, color=color.red, title="Tracked Open Price", linewidth=2)
plot(tracked_close, color=color.green, title="Tracked Close Price", linewidth=2)
5. Exit Conditions
Long Exit: When the price drops below the tracked open and close price:
pinescript
Copy code
exit_long_condition = (close < open) and (tracked_close < tracked_open) and barstate.isconfirmed
Short Exit: When the price rises above the tracked open and close price:
pinescript
Copy code
exit_short_condition = (close > open) and (tracked_close > tracked_open) and barstate.isconfirmed
6. Visualization
Plots:
21 EMA, Bollinger Bands (Basis, Upper, Lower).
Tracked open/close prices for additional context.
Background Colors:
Green for long signals, red for short signals (e.g., ema_long_entry_condition triggers a green background).
7. Alerts
The script defines alerts to notify the user about key events:
Entry Alerts:
pinescript
Copy code
alertcondition(ema_long_entry_condition, title="EMA Long Entry", message="EMA Long Entry")
alertcondition(bb_long_entry_condition, title="BB Long Entry", message="BB Long Entry")
Exit Alerts:
pinescript
Copy code
alertcondition(exit_long_condition, title="Exit Long", message="Exit Long")
8. Purpose
Trend Following: EMA crossovers help identify trend changes.
Volatility Breakouts: Bollinger Band crossovers highlight overbought/oversold regions.
Custom Sessions: Trading activity is restricted to specific time periods for precision.
Outside Bar Strategy % (Alessio)Outside Bar Strategy %
This strategy is based on identifying Outside Bars, which occur when the current bar's high is higher than the previous bar's high and its low is lower than the previous bar's low. The strategy enters trades in the direction of the Outside Bar, offering a powerful way to capture price moves following a strong price expansion.
Key Features:
Long and Short Entries: The strategy enters a Long trade when the Outside Bar closes bullish (current close > open), and a Short trade when the Outside Bar closes bearish (current close < open).
Customizable Entry Levels: The entry point is calculated based on a customizable percentage of the Outside Bar's range, allowing flexibility for traders to fine-tune their entries at 50% or 70% of the bar's range.
Stop Loss (SL) and Take Profit (TP):
Stop Loss (SL) is automatically placed at the Outside Bar's low for Long trades and at its high for Short trades.
Take Profit (TP) is calculated as a percentage of the Outside Bar's range, with customizable settings for take-profit levels.
Visual Indicators:
Entry, Stop Loss, and Take Profit levels are plotted as lines on the chart, with customizable colors and widths for easy identification.
Labels are placed on the chart to indicate whether the trade is Long or Short, positioned above or below the Outside Bar's candlestick.
Alerts: Users can enable alerts to receive notifications when a trade is triggered, including details such as entry points and stop loss levels.
Strategy Parameters:
Entry Percentage: Set the entry level as a percentage of the Outside Bar's range (e.g., 50%, 70%).
Take Profit Percentage: Customize the Take Profit level as a percentage of the Outside Bar's range.
Customizable Colors and Line Widths: Adjust the colors and thickness of the entry, stop loss, and take profit lines to fit your preferences.
Alerts: Enable alerts to be notified when a trade is executed or when the entry level is reached.
This strategy is ideal for traders who want to capitalize on significant price moves after a breakout, with clear risk management through Stop Loss and Take Profit levels. The customizable features make it suitable for various market conditions and trading styles.
Breakout StrategyThe strategy aims to capture upward price movements (breakouts) by observing when the price exceeds a predefined range, known as the Donchian Channel, while also ensuring trading volume supports the move.
When Does It Open a Long Trade?
The strategy opens a long trade (buy position) when both of these conditions are met:
1. Price Breaks Above the Upper Band
- The current closing price is higher than the Upper Band of the Donchian Channel.
- This indicates a potential breakout, signaling upward momentum.
2. High Volume Confirmation
- The current trading volume is greater than 1.9 times the average volume over the Donchian Channel's length.
- This ensures the breakout is backed by significant market activity, reducing the chance of false signals.
Only when both conditions are true, the strategy will execute a long entry.
When Does It Close the Trade?
The strategy closes the long trade (exits the position) when:
1. Price Falls Below the Middle Band
- The closing price drops below the Middle Band of the Donchian Channel.
- This acts as a reversal signal, suggesting the upward momentum has weakened, and it’s time to exit the trade.
Stop Loss & TargetHow to Use the SL/TP Indicator
The SL/TP indicator is a versatile tool designed for traders to easily visualize entry, stop-loss (SL), and take-profit (TP) levels on their charts. This guide will walk you through the steps to configure and use the indicator effectively.
Features:
Configure Long Trades and Short Trades independently.
Define Entry Price, Stop Loss, and up to three Take Profit levels for each trade.
Customize line colors for better visualization.
Works for both risk-reward and target-based trading.
Adding the Indicator:
Open the TradingView platform.
Search for the indicator name: SL/TP.
Click the Add to Chart button to apply it.
Configuration:
1. Long Trade Settings
Enable Long Trade: Check this option to activate long trade lines on the chart.
Long Entry Price: Input the price at which you plan to enter the long trade.
Long Stop Loss: Input your stop-loss level for the long trade.
Line Colors: You can customize the colors for the Entry, SL, and TP lines in the Long Trade settings group.
Take Profit Levels (Calculated Automatically):
TP1: 1:1 Risk-Reward ratio (difference between Entry and SL added to Entry).
TP2: 1:2 Risk-Reward ratio.
TP3: 1:3 Risk-Reward ratio.
2. Short Trade Settings
Enable Short Trade: Check this option to activate short trade lines on the chart.
Short Entry Price: Input the price at which you plan to enter the short trade.
Short Stop Loss: Input your stop-loss level for the short trade.
Line Colors: You can customize the colors for the Entry, SL, and TP lines in the Short Trade settings group.
Take Profit Levels (Calculated Automatically):
TP1: 1:1 Risk-Reward ratio (difference between Entry and SL subtracted from Entry).
TP2: 1:2 Risk-Reward ratio.
TP3: 1:3 Risk-Reward ratio.
Visualizing on the Chart:
Once you configure the settings and enable the trade, the indicator will draw horizontal lines on the chart for:
Entry Price
Stop Loss
Take Profit Levels (TP1, TP2, TP3)
Each line will extend to three bars ahead of the current bar index.
Customization:
Adjust colors for better visibility depending on your chart theme.
The width and style of lines can also be modified in the source code if needed.
Example Usage:
Long Trade Example:
Enable Long Trade: Check the box.
Set Entry Price: 100.
Set Stop Loss: 95.
The indicator will draw the following lines:
Entry Line: At 100 (customizable color).
Stop Loss Line: At 95 (customizable color).
TP1 Line: At 105 (1:1 Risk-Reward).
TP2 Line: At 110 (1:2 Risk-Reward).
TP3 Line: At 115 (1:3 Risk-Reward).
Short Trade Example:
Enable Short Trade: Check the box.
Set Entry Price: 200.
Set Stop Loss: 205.
The indicator will draw the following lines:
Entry Line: At 200 (customizable color).
Stop Loss Line: At 205 (customizable color).
TP1 Line: At 195 (1:1 Risk-Reward).
TP2 Line: At 190 (1:2 Risk-Reward).
TP3 Line: At 185 (1:3 Risk-Reward).
Notes:
Ensure that you input valid and realistic price levels for Entry and Stop Loss.
The indicator will only display lines if both the Entry Price and Stop Loss are non-zero.
Use this indicator for planning trades visually but always confirm levels with your trading strategy.
Disclaimer: This indicator is a tool to assist in trading. Use it with proper risk management and your own due diligence.
P/L CalculatorDescription of the P/L Calculator Indicator
The P/L Calculator is a dynamic TradingView indicator designed to provide traders with real-time insights into profit and loss metrics for their trades. It visualizes key levels such as entry price, profit target, and stop-loss, while also calculating percentage differences and net profit or loss, factoring in fees.
Features:
Customizable Input Parameters:
Entry Price: Define the starting price of the trade.
Profit and Stop-Loss Levels (%): Set percentage thresholds for targets and risk levels.
USDT Amount: Specify the trade size for precise calculations.
Trade Type: Choose between "Long" or "Short" positions.
Visual Representation:
Entry Price, Profit Target, and Stop-Loss levels are plotted as horizontal lines on the chart.
Line styles, colors, and thicknesses are fully customizable for better visibility.
Real-Time Metrics:
Percentage difference between the live price and the entry price is calculated dynamically.
Profit/Loss (P/L) and fees are computed in real time to display net profit or loss.
Alerts:
Alerts are triggered when:
The live price hits the profit target.
The live price crosses the stop-loss level.
The price reaches the specified entry level.
A user-defined percentage difference is reached.
Labels and Annotations:
Displays percentage difference, P/L, and fee information in a clear label near the live price.
Custom Fee Integration:
Allows input of trading fees (%), enabling accurate net profit or loss calculations.
Price Scale Visualization:
Displays the percentage difference on the price scale for enhanced context.
Use Case:
The P/L Calculator is ideal for traders who want to monitor their trades' performance and make informed decisions without manually calculating metrics. Its visual cues and alerts ensure you stay updated on critical levels and price movements.
This indicator supports a wide range of trading styles, including swing trading, scalping, and position trading, making it a versatile tool for anyone in the market.
Autonomous 5-Minute RobotKey Components of the Strategy:
Trend Detection:
A 50-period simple moving average (SMA) is used to define the market trend. If the current close is above the SMA, the market is considered to be in an uptrend (bullish), and if it's below, it's considered a downtrend (bearish).
The strategy also looks at the trend over the last 30 minutes (6 candles in a 5-minute chart). The strategy compares the previous close with the current close to detect an uptrend or downtrend.
Volume Analysis:
The strategy calculates buyVolume and sellVolume based on price movement within each candle.
The condition for entering a long position is when the market is in an uptrend, and the buy volume is greater than the sell volume.
The condition for entering a short position is when the market is in a downtrend, and the sell volume is greater than the buy volume.
Trade Execution:
The strategy enters a long position when the trend is up and the buy volume is higher than the sell volume.
The strategy enters a short position when the trend is down and the sell volume is higher than the buy volume.
Positions are closed based on stop-loss and take-profit conditions.
Stop-loss is set at 3% below the entry price.
Take-profit is set at 29% above the entry price.
Exit Conditions:
Long trades will be closed if the price falls 3% below the entry price or rises 29% above the entry price.
Short trades will be closed if the price rises 3% above the entry price or falls 29% below the entry price.
Visuals:
The SMA (50-period) is plotted on the chart to show the trend.
Buy and sell signals are marked with labels on the chart for easy identification.
With this being said this algo is still being worked on to be autonomous
Analyze the Market Direction: Determine whether the market is in an uptrend or downtrend over the past 30 minutes (using the last 6 candles in a 5-minute chart).
Use Trend Indicators and Volume: Implement trend-following indicators like moving averages or the SMA/EMA crossover and consider volume to decide when to enter or exit a trade.
Enter and Exit Trades: The robot will enter long positions when the trend is up and short positions when the trend is down. Additionally, it will close positions based on volume signals and price action (e.g., volume spikes, price reversals).
Nen Star Harmonic Pattern [TradingFinder] NenStar Reversal Auto🔵 Introduction
The Nen-Star Harmonic Pattern is an advanced reversal pattern in technical analysis, designed to identify market trend changes and predict key price reversal points. This pattern is defined by a combination of Fibonacci ratios and critical concepts such as Potential Reversal Zones (PRZ), market structure, and corrective waves.
The key points of this pattern include X, A, B, C, and D, and it appears in both bullish and bearish forms. In its bullish form, the pattern resembles the letter M, while in its bearish form, it takes the shape of W. The critical Fibonacci ratios for this pattern are 0.382 to 0.786 for the XA wave, 1.13 to 1.414 for the AB wave, and 1.272 to 2.618 for the BC wave.
The Nen-Star Harmonic Pattern is one of the most precise tools for identifying market reversals and executing reversal trades. Traders can use it to pinpoint optimal entry and exit points and benefit from high risk-to-reward ratios.
By emphasizing Fibonacci retracement levels, XABCD waves, the formation of bullish and bearish patterns, and precise trade entry points, this pattern has become a practical tool in advanced technical analysis.
Bullish Nen-Star Pattern :
Bearish Nen-Star Pattern :
🔵 How to Use
The Nen-Star Harmonic Pattern indicator allows traders to automatically identify the bullish and bearish structures of this pattern and locate optimal entry and exit points. By accurately analyzing Fibonacci ratios and determining points X, A, B, C, and D, the indicator highlights Potential Reversal Zones (PRZ) on the chart. Traders can rely on the generated signals to manage their trades with greater precision.
🟣 Bullish Nen-Star Pattern
The bullish Nen-Star pattern begins with a price increase from point X to point A, followed by a retracement to point B, which lies between 0.382 and 0.786 of the XA wave.
After this retracement, the price moves to point C, located between 1.13 and 1.414 of the AB wave. The final movement is a price decline to point D, which is between 1.272 and 2.618 of the BC wave and 1.13 to 1.272 of the XA wave.
Point D : Serves as the key Potential Reversal Zone (PRZ).
Entry : A buy trade is initiated at point D, signaling the end of the corrective movement and the beginning of a price increase.
Price Targets :
61.8% retracement of the CD wave
Point A
Point C
1.272 and 1.618 extensions of the CD wave if resistance at point C is broken
Stop Loss : Placed slightly below point D.
🟣 Bearish Nen-Star Pattern
The bearish Nen-Star pattern starts with a price decrease from point X to point A, followed by a retracement to point B, which lies between 0.382 and 0.786 of the XA wave.
After this retracement, the price moves to point C, located between 1.13 and 1.414 of the AB wave. The final movement is a price increase to point D, which is between 1.272 and 2.618 of the BC wave and 1.13 to 1.272 of the XA wave.
Point D : Serves as the key Potential Reversal Zone (PRZ).
Entry : A sell trade is initiated at point D, signaling the end of the corrective movement and the beginning of a price decline.
Price Targets :
61.8% retracement of the CD wave
Point A
Point C
1.272 and 1.618 extensions of the CD wave if support at point C is broken
Stop Loss : Placed slightly above point D.
🔵 Setting
🟣 Logical Setting
ZigZag Pivot Period : You can adjust the period so that the harmonic patterns are adjusted according to the pivot period you want. This factor is the most important parameter in pattern recognition.
Show Valid Forma t: If this parameter is on "On" mode, only patterns will be displayed that they have exact format and no noise can be seen in them. If "Off" is, the patterns displayed that maybe are noisy and do not exactly correspond to the original pattern.
Show Formation Last Pivot Confirm : if Turned on, you can see this ability of patterns when their last pivot is formed. If this feature is off, it will see the patterns as soon as they are formed. The advantage of this option being clear is less formation of fielded patterns, and it is accompanied by the latest pattern seeing and a sharp reduction in reward to risk.
Period of Formation Last Pivot : Using this parameter you can determine that the last pivot is based on Pivot period.
🟣 Genaral Setting
Show : Enter "On" to display the template and "Off" to not display the template.
Color : Enter the desired color to draw the pattern in this parameter.
LineWidth : You can enter the number 1 or numbers higher than one to adjust the thickness of the drawing lines. This number must be an integer and increases with increasing thickness.
LabelSize : You can adjust the size of the labels by using the "size.auto", "size.tiny", "size.smal", "size.normal", "size.large" or "size.huge" entries.
🟣 Alert Setting
Alert : On / Off
Message Frequency : This string parameter defines the announcement frequency. Choices include: "All" (activates the alert every time the function is called), "Once Per Bar" (activates the alert only on the first call within the bar), and "Once Per Bar Close" (the alert is activated only by a call at the last script execution of the real-time bar upon closing). The default setting is "Once per Bar".
Show Alert Time by Time Zone : The date, hour, and minute you receive in alert messages can be based on any time zone you choose. For example, if you want New York time, you should enter "UTC-4". This input is set to the time zone "UTC" by default.
🔵 Conclusion
The Nen-Star Harmonic Pattern is a highly effective analytical tool in global financial markets, playing a crucial role in identifying reversal points and market trend changes. By leveraging Fibonacci principles and price structure, this pattern enables precise analysis across various assets, including stocks, cryptocurrencies, forex, and commodities.
Traders operating in global markets can use this pattern to identify high risk-to-reward trading opportunities. Its clear entry and exit points, defined Potential Reversal Zones (PRZ), and accurate price targets make it an excellent tool for risk management and profitability enhancement.
In the global context, the Nen-Star pattern is widely used by professional analysts in both advanced and emerging markets due to its versatility in analyzing long-term and short-term charts. Beyond trend prediction, it enhances trading strategies and optimizes investment decisions.
Combining this pattern with complementary tools such as volume analysis, technical indicators, and macroeconomic conditions can provide traders with deeper market insights, helping them capitalize on global opportunities.
4Vietnamese 3x SupertrendThis strategy attempts to capture long positions in the Vietnamese stock market using a combination of three Supertrend indicators and additional filters. It utilizes pyramiding to enter up to three long positions with a 33.33% allocation each.
Key Elements:
Supertrend Indicators: Three Supertrend indicators are used with different lengths and multipliers to identify potential trend changes.
Entry Conditions:
The strategy looks for a downtrend on the slowest Supertrend (Supertrend3) followed by uptrends on the medium (Supertrend2) and fast (Supertrend1) Supertrends.
Alternatively, if Supertrend3 is still downtrending, but Supertrend1 is downtrending and a significant previous high (highestGreen) exists, an entry signal is generated.
An optional filter allows using the highest of the last two red candles for highestGreen calculation.
Entry Stop Loss:
An optional stop loss can be set based on the entry price of previous long positions, preventing further losses if the price falls below entry prices.
Exit Conditions:
Three exit options are available:
- All Downtrend Exit: Close all positions if all Supertrends turn uptrend and a bearish candlestick pattern (close price lower than open price) is formed.
- Average Price in Loss Exit: Close all positions if the average entry price of open positions is higher than the current closing price (indicating a loss).
- All Positions in Loss Exit: Close all positions if any of the following conditions are met:
A single open position exists, and its entry price is higher than the current close price.
Two open positions exist, and their entry prices are both higher than the current close price.
Three open positions exist, and their entry prices are all higher than the current close price.
Pyramiding: The strategy allows entering up to three long positions with a fixed allocation of 33.33% each.
Customization Options:
The strategy provides various input parameters to customize its behavior:
Supertrend lengths and multipliers for each indicator.
Option to use the highest of the last two red candles for highestGreen calculation.
Enabling/disabling Entry Stop Loss and different exit conditions.
Further Enhancements:
Explore additional entry and exit filters to refine trade signals.
Consider incorporating risk management techniques like position sizing and trailing stops.
Backtest the strategy with historical data to evaluate its effectiveness and identify potential areas for improvement.
Fibonacci Trading Strategy (Auto Levels)How It Works
Swing Highs and Lows Detection:
The script identifies the highest high and lowest low over a specified lookback period (default: 50 candles). These points are used as the basis for Fibonacci calculations.
Fibonacci Levels:
Fibonacci retracement levels: 0%, 38.2%, 50%, 61.8%, 78.6%, and 100%.
Fibonacci extension levels: 127.2%, 161.8%, 200%, 261.8%, and 361.8%.
Each level is plotted on the chart with a specific color and labeled with the corresponding price.
Entry Zones:
Pullback Area: Between the 50% and 61.8% retracement levels. This area is highlighted in green, indicating a potential entry for conservative traders.
Full Margin Area: Between the 61.8% and 78.6% retracement levels. This area is highlighted in red, suggesting a higher-risk entry for aggressive traders.
Stop Loss (SL):
The Stop Loss is placed at the 78.6% Fibonacci retracement level. A dotted red line is drawn at this level to provide a visual reference for risk management.
Entry labels include the Stop Loss price for clarity.
Take Profit (TP) Levels:
Multiple take-profit targets are identified using Fibonacci extension levels (127.2%, 161.8%, 200%, 261.8%, and 361.8%).
Each level is labeled with the price and target percentage.
Visual Aids:
The script dynamically labels each Fibonacci level with its corresponding price.
Entry points (Pullback and Full Margin) are marked with clear labels, including the recommended Stop Loss.
Background highlights help distinguish the Pullback and Full Margin areas.
Strategy Highlights
Risk Management:
Incorporates a well-defined Stop Loss at the 78.6% level to limit downside risk.
Multiple take-profit levels help traders scale out of positions gradually.
Automation:
Automatically recalculates levels when new swing highs or lows are detected, ensuring accuracy in dynamic markets.
Customizability:
Users can adjust the lookback period to suit different timeframes or trading styles.
Clarity:
Clean visuals and detailed labels ensure the strategy is easy to interpret and apply.
When to Use
The strategy is suitable for trend-following traders looking to enter during pullbacks in an established trend.
It works best in trending markets where Fibonacci levels often act as strong support or resistance.
Example Scenario
Bullish Setup:
Price retraces to the 50%-61.8% area (Pullback Area) after a swing high.
A buy order is placed in this zone, with the Stop Loss at the 78.6% level.
Profit targets are set at the 127.2%, 161.8%, and higher Fibonacci extensions.
Bearish Setup:
In a downtrend, price retraces upward to the 50%-61.8% zone.
A sell order is placed, with the Stop Loss at the 78.6% level and take-profit levels below.
EMA Crossover Strategy with Take Profit and Candle HighlightingStrategy Overview:
This strategy is based on the Exponential Moving Averages (EMA), specifically the EMA 20 and EMA 50. It takes advantage of EMA crossovers to identify potential trend reversals and uses multiple take-profit levels and a stop-loss for risk management.
Key Components:
EMA Crossover Signals:
Buy Signal (Uptrend): A buy signal is generated when the EMA 20 crosses above the EMA 50, signaling the start of a potential uptrend.
Sell Signal (Downtrend): A sell signal is generated when the EMA 20 crosses below the EMA 50, signaling the start of a potential downtrend.
Take Profit Levels:
Once a buy or sell signal is triggered, the strategy calculates multiple take-profit levels based on the range of the previous candle. The user can define multipliers for each take-profit level.
Take Profit 1 (TP1): 50% of the previous candle's range above or below the entry price.
Take Profit 2 (TP2): 100% of the previous candle's range above or below the entry price.
Take Profit 3 (TP3): 150% of the previous candle's range above or below the entry price.
Take Profit 4 (TP4): 200% of the previous candle's range above or below the entry price.
These levels are adjusted dynamically based on the previous candle's high and low, so they adapt to changing market conditions.
Stop Loss:
A stop-loss is set to manage risk. The default stop-loss is 3% from the entry price, but this can be adjusted in the settings. The stop-loss is triggered if the price moves against the position by this amount.
Trend Direction Highlighting:
The strategy highlights the bars (candles) with colors:
Green bars indicate an uptrend (when EMA 20 crosses above EMA 50).
Red bars indicate a downtrend (when EMA 20 crosses below EMA 50).
These visual cues help users easily identify the market direction.
Strategy Entries and Exits:
Entries: The strategy enters a long (buy) position when the EMA 20 crosses above the EMA 50 and a short (sell) position when the EMA 20 crosses below the EMA 50.
Exits: The strategy exits the positions at any of the defined take-profit levels or the stop-loss. Multiple exit levels provide opportunities to take profit progressively as the price moves in the favorable direction.
Entry and Exit Conditions in Detail:
Buy Entry Condition (Uptrend):
A buy position is opened when EMA 20 crosses above EMA 50, signaling the start of an uptrend.
The strategy calculates take-profit levels above the entry price based on the previous bar's range (high-low) and the multipliers for TP1, TP2, TP3, and TP4.
Sell Entry Condition (Downtrend):
A sell position is opened when EMA 20 crosses below EMA 50, signaling the start of a downtrend.
The strategy calculates take-profit levels below the entry price, similarly based on the previous bar's range.
Exit Conditions:
Take Profit: The strategy attempts to exit the position at one of the take-profit levels (TP1, TP2, TP3, or TP4). If the price reaches any of these levels, the position is closed.
Stop Loss: The strategy also has a stop-loss set at a default value (3% below the entry for long trades, and 3% above for short trades). The stop-loss helps to protect the position from significant losses.
Backtesting and Performance Metrics:
The strategy can be backtested using TradingView's Strategy Tester. The results will show how the strategy would have performed historically, including key metrics like:
Net Profit
Max Drawdown
Win Rate
Profit Factor
Average Trade Duration
These performance metrics can help users assess the strategy's effectiveness over historical periods and optimize the input parameters (e.g., multipliers, stop-loss level).
Customization:
The strategy allows for the adjustment of several key input values via the settings panel:
Take Profit Multipliers: Users can customize the multipliers for each take-profit level (TP1, TP2, TP3, TP4).
Stop Loss Percentage: The user can also adjust the stop-loss percentage to a custom value.
EMA Periods: The default periods for the EMA 50 and EMA 20 are fixed, but they can be adjusted for different market conditions.
Pros of the Strategy:
EMA Crossover Strategy: A classic and well-known strategy used by traders to identify the start of new trends.
Multiple Take Profit Levels: By taking profits progressively at different levels, the strategy locks in gains as the price moves in favor of the position.
Clear Trend Identification: The use of green and red bars makes it visually easier to follow the market's direction.
Risk Management: The stop-loss and take-profit features help to manage risk and optimize profit-taking.
Cons of the Strategy:
Lagging Indicators: The strategy relies on EMAs, which are lagging indicators. This means that the strategy might enter trades after the trend has already started, leading to missed opportunities or less-than-ideal entry prices.
No Confirmation Indicators: The strategy purely depends on the crossover of two EMAs and does not use other confirming indicators (e.g., RSI, MACD), which might lead to false signals in volatile markets.
How to Use in Real-Time Trading:
Use for Backtesting: Initially, use this strategy in backtest mode to understand how it would have performed historically with your preferred settings.
Paper Trading: Once comfortable, you can use paper trading to test the strategy in real-time market conditions without risking real money.
Live Trading: After testing and optimizing the strategy, you can consider using it for live trading with proper risk management in place (e.g., starting with a small position size and adjusting parameters as needed).
Summary:
This strategy is designed to identify trend reversals using EMA crossovers, with customizable take-profit levels and a stop-loss to manage risk. It's well-suited for traders looking for a systematic way to enter and exit trades based on clear market signals, while also providing flexibility to adjust for different risk profiles and trading styles.
EMA SHIFT & PARALLEL [n_dot]BINANCE:ETHUSDT.P
This strategy was developed for CRYPTO FUTURES, (the settings for ETHUSDT.P) . I aimed for the strategy to function in a live environment, so I focused on making its operation realistic:
When determining the position, only 80% (adjustable) of the available cash is invested to reduce the risk of position liquidation.
I account for a 0.05% commission, typical on the futures market, for each entry and exit.
Concept:
I modified a simple, well-known method: the crossover of two exponential moving averages (FAST, SLOW) generates the entry and exit signals.
I enhanced the base idea as follows:
For the fast EMA, I incorporated a multiplier (offset) to filter out market noise and focus only on strong signals.
I use different EMAs for long and short entry points; both have their own FAST and SLOW EMAs and their own offset. For longs, the FAST EMA is adjusted downward (<1), while for shorts, it is adjusted upward (>1). Consequently, the signal is generated when the modified FAST EMA crosses the SLOW EMA.
Risk Management:
The position includes the following components:
Separate stop-losses for long and short positions.
Separate trailers for long and short positions.
The strategy operates so that the entry point is determined by the EMA crossover, while the exit is governed only by the Stop Loss or Trailer. Optionally, it can be set to close the position at the EMA recrossing ("Close at Signal").
Trailer Operation:
An entry percentage and offset are defined. The trailer activates when the price surpasses the entry price, calculated automatically by the system.
The trailer closes the position when the price drops by the offset percentage from the highest reached price.
Example for trailer:
Purchase Price = 100
Trailer Enter = 5% → Activation Price = 105 (triggers trailer if market price crosses it).
Trailer Offset = 2%
If the price rises to 110, the exit price becomes 107.8.
If the price goes to 120, the exit price becomes 117.6.
If the price falls below 117.6, the trailer closes the position.
Settings:
Source: Determines the market price reference.
End Close: Closes positions at the end of the simulation to avoid "shadow positions" and provide an objective result.
Lot proportional to free cash (%): Only a portion of free cash is invested to meet margin requirements.
Plot Short, Plot Long: Simplifies displayed information by toggling indicator lines on/off.
Long Position (toggleable):
EMA Fast ws: Window size for FAST EMA.
EMA Slow ws: Window size for SLOW EMA.
EMA Fast down shift: Adjustment factor for FAST EMA.
Stop Loss long (%): Percent drop to close the position.
Trailer enter (%): Percent above the purchase price to activate the trailer.
Trailer offset (%): Percent drop to close the position.
Short Position (toggleable):
EMA Fast ws: Window size for FAST EMA.
EMA Slow ws: Window size for SLOW EMA.
EMA Fast up shift: Adjustment factor for FAST EMA.
Stop Loss short (%): Percent rise to close the position.
Trailer enter (%): Percent below the purchase price to activate the trailer.
Trailer offset (%): Percent rise to close the position.
Operational Framework:
If in a long position and a short EMA crossover occurs, the strategy closes the long and opens a short (flip).
If in a short position and a long EMA crossover occurs, the strategy closes the short and opens a long (flip).
A position can close in three ways:
Stop Loss
Trailer
Signal Recrossing
If none are active, the position remains open until the end of the simulation.
Observations:
Shifts significantly deviating from 1 increase overfitting risk. Recommended ranges: 0.96–0.99 (long) and 1.01–1.05 (short).
The strategy's advantage lies in risk management, crucial in leveraged futures markets. It operates with relatively low DrawDown.
Recommendations:
Bullish Market: Higher entry threshold (e.g., 6%) and larger offset (e.g., 3%).
Volatile/Sideways Market: Tighter parameters (e.g., 3%, 1%).
The method is stable, and minor parameter adjustments do not significantly impact results, helping assess overfitting: if small changes lead to drastic differences, the strategy is over-optimized.
EMA Settings: Adjust FAST and SLOW EMAs based on the asset's volatility and cyclicality.
On the crypto market, especially in the Futures market, short time periods (1–15 minutes) often show significant noise, making patterns/repetitions hard to identify. I recommend setting the interval to at least 1 hour.
I hope this contributes to your success!
DCA Strategy with HedgingThis strategy implements a dynamic hedging system with Dollar-Cost Averaging (DCA) based on the 34 EMA. It can hold simultaneous long and short positions, making it suitable for ranging and trending markets.
Key Features:
Uses 34 EMA as baseline indicator
Implements hedging with simultaneous long/short positions
Dynamic DCA for position management
Automatic take-profit adjustments
Entry confirmation using 3-candle rule
How it Works
Long Entries:
Opens when price closes above 34 EMA for 3 candles
Adds positions every 0.1% price drop
Takes profit at 0.05% above average entry
Short Entries:
Opens when price closes below 34 EMA for 3 candles
Adds positions every 0.1% price rise
Takes profit at 0.05% below average entry
Settings
EMA Length: Controls the EMA period (default: 34)
DCA Interval: Price movement needed for additional entries (default: 0.1%)
Take Profit: Profit target from average entry (default: 0.05%)
Initial Position: Starting position size (default: 1.0)
Indicators
L: Long Entry
DL: Long DCA
S: Short Entry
DS: Short DCA
LTP: Long Take Profit
STP: Short Take Profit
Alerts
Compatible with all standard TradingView alerts:
Position Opens (Long/Short)
DCA Entries
Take Profit Hits
Note: This strategy works best on lower timeframes with high liquidity pairs. Adjust parameters based on asset volatility.
Arrow-SimplyTrade vol1.5-FinalTitle: Arrow-SimplyTrade vol1.5-Final
Description:
This advanced trading indicator is designed to assist traders in analyzing market trends and identifying optimal entry signals. It combines several popular technical analysis tools and strategies, including EMA (Exponential Moving Average), MA (Simple Moving Averages), Bollinger Bands, and candlestick patterns. This indicator provides both trend-following and counter-trend signals, making it suitable for various trading styles, such as scalping and swing trading.
Main Features:
EMA (Exponential Moving Average):
EMA200 is the main trend line that helps determine the overall market direction. When the price is above EMA200, the trend is considered bullish, and when the price is below EMA200, the trend is considered bearish.
It helps filter out signals that go against the prevailing market trend.
Simple Moving Averages (MA5 and MA15):
This indicator uses two Simple Moving Averages: MA5 (Fast) and MA15 (Slow). Their crossovers create buy or sell signals:
Buy Signal: When MA5 crosses above MA15, signaling a potential upward trend.
Sell Signal: When MA5 crosses below MA15, signaling a potential downward trend.
Bollinger Bands:
Bollinger Bands measure market volatility and can identify periods of overbought or oversold conditions. The Upper and Lower Bands help detect potential breakout points, while the Middle Line (Basis) serves as dynamic support or resistance.
This tool is particularly useful for identifying volatile conditions and potential reversals.
Arrows:
The indicator plots arrows on the chart to signal entry opportunities:
Green Arrows signal buy opportunities (when MA5 crosses above MA15 and price is above EMA200).
Red Arrows signal sell opportunities (when MA5 crosses below MA15 and price is below EMA200).
Opposite Arrows: Optionally, the indicator can also display arrows for counter-trend signals, triggered by MA5 and MA15 crossovers, regardless of the price's position relative to EMA200.
Candlestick Patterns:
The indicator detects popular candlestick patterns such as Bullish Engulfing, Bearish Engulfing, Hammer, and Doji.
These patterns are important for confirming entry points or anticipating trend reversals.
How to Use:
EMA200: The main trend line. If the price is above EMA200, consider long positions. If the price is below EMA200, consider short positions.
MA5 and MA15: Short-term trend indicators. The crossover of these averages generates buy or sell signals.
Bollinger Bands: Use these bands to spot overbought/oversold conditions. Breakouts from the bands may signal potential entry points.
Arrows: Green arrows represent buy signals, and red arrows represent sell signals. Opposite direction arrows can be used for counter-trend strategies.
Candlestick Patterns: Patterns like Bullish Engulfing or Doji can help confirm the signals.
Customizable Settings:
Fully customizable colors, line styles, and display settings for EMA, MAs, Bollinger Bands, and arrows.
The Candlestick Patterns feature can be toggled on or off based on user preference.
Important Notes:
This indicator is intended to be used in conjunction with other analysis tools.
Past performance does not guarantee future results.
Polish:
Tytuł: Arrow-SimplyTrade vol1.5-Final
Opis:
Ten zaawansowany wskaźnik handlowy jest zaprojektowany, aby pomóc traderom w analizie trendów rynkowych oraz identyfikowaniu optymalnych sygnałów wejścia. Łączy w sobie kilka popularnych narzędzi analizy technicznej i strategii, w tym EMA (Wykładnicza Średnia Ruchoma), MA (Prosta Średnia Ruchoma), Bollinger Bands oraz formacje świecowe. Wskaźnik generuje zarówno sygnały podążające za trendem, jak i przeciwnym trendowi, co sprawia, że jest odpowiedni do różnych stylów handlu, takich jak scalping oraz swing trading.
Główne Funkcje:
EMA (Wykładnicza Średnia Ruchoma):
EMA200 to główna linia trendu, która pomaga określić ogólny kierunek rynku. Gdy cena znajduje się powyżej EMA200, trend jest uznawany za wzrostowy, a gdy poniżej EMA200, za spadkowy.
Pomaga to filtrować sygnały, które są niezgodne z głównym trendem rynkowym.
Proste Średnie Ruchome (MA5 i MA15):
Wskaźnik używa dwóch Prostych Średnich Ruchomych: MA5 (szybka) oraz MA15 (wolna). Ich przecięcia generują sygnały kupna lub sprzedaży:
Sygnał Kupna: Kiedy MA5 przecina MA15 od dołu, sygnalizując potencjalny wzrost.
Sygnał Sprzedaży: Kiedy MA5 przecina MA15 od góry, sygnalizując potencjalny spadek.
Bollinger Bands:
Bollinger Bands mierzą zmienność rynku i mogą pomóc w identyfikowaniu okresów wykupienia lub wyprzedania rynku. Górna i dolna linia pomagają wykrywać punkty wybicia, a Środkowa Linia (Basis) działa jako dynamiczny poziom wsparcia lub oporu.
Narzędzie to jest szczególnie przydatne w wykrywaniu warunków zmienności i potencjalnych odwróceń trendu.
Strzałki:
Wskaźnik wyświetla strzałki na wykresie, które wskazują sygnały kupna i sprzedaży:
Zielona strzałka wskazuje sygnał kupna (gdy MA5 przecina MA15 i cena jest powyżej EMA200).
Czerwona strzałka wskazuje sygnał sprzedaży (gdy MA5 przecina MA15 i cena jest poniżej EMA200).
Strzałki w przeciwnym kierunku: Opcjonalna funkcja, która pokazuje strzałki w przeciwnym kierunku, uruchamiane przez przecięcia MA5 i MA15, niezależnie od pozycji ceny względem EMA200.
Formacje Świecowe:
Wskaźnik wykrywa popularne formacje świecowe, takie jak Bullish Engulfing, Bearish Engulfing, Hammer oraz Doji.
Formacje te pomagają traderom potwierdzić punkty wejścia i przewidzieć możliwe odwrócenia trendu.
Jak Używać:
EMA200: Główna linia trendu. Jeśli cena jest powyżej EMA200, rozważaj pozycje długie. Jeśli cena jest poniżej EMA200, rozważaj pozycje krótkie.
MA5 i MA15: Śledzą krótkoterminowe zmiany trendu. Przecięcia tych średnich generują sygnały kupna lub sprzedaży.
Bollinger Bands: Używaj tych pasm do wykrywania wykupionych lub wyprzedanych warunków. Wybicia z pasm mogą wskazywać potencjalne punkty wejścia.
Strzałki: Zielona strzałka wskazuje sygnał kupna, a czerwona strzałka sygnał sprzedaży. Strzałki w przeciwnym kierunku mogą być używane do strategii przeciwtrendowych.
Formacje Świecowe: Formacje takie jak Bullish Engulfing czy Doji mogą pomóc w potwierdzaniu sygnałów.
Ustawienia Personalizacji:
W pełni personalizowalne kolory, style linii i ustawienia wyświetlania dla EMA, MAs, Bollinger Bands oraz strzałek.
Funkcja Formacji Świecowych może być włączana lub wyłączana według preferencji użytkownika.
Ważne Uwagi:
Ten wskaźnik powinien być używany w połączeniu z innymi narzędziami analizy rynku.
Wyniki z przeszłości nie gwarantują wyników w przyszłości.
Omega_galskyThe strategy uses three Exponential Moving Averages (EMAs) — EMA8, EMA21, and EMA89 — to decide when to open buy or sell trades. It also includes a mechanism to move the Stop Loss (SL) to the Break-Even (BE) point, which is the entry price, once the price reaches a Risk-to-Reward (R2R) ratio of 1:1.
Key Steps:
Calculating EMAs: The script computes the EMA values for the specified periods. These help identify market trends and potential entry points.
Buy Conditions:
EMA8 crosses above EMA21.
The candle that causes the crossover is green (closing price is higher than the opening price).
The closing price is above EMA89.
If all conditions are met, a buy order is executed.
Sell Conditions:
EMA8 crosses below EMA21.
The candle that causes the crossover is red (closing price is lower than the opening price).
The closing price is below EMA89.
If all conditions are met, a sell order is executed.
Stop Loss and Take Profit:
Initial Stop Loss and Take Profit levels are calculated based on the entry price and a percentage defined by the user.
These levels help protect against large losses and lock in profits.
Break-Even Logic:
When the price moves favorably to reach a 1:1 R2R ratio:
For a buy trade, the Stop Loss is moved to the entry price if the price increases sufficiently.
For a sell trade, the Stop Loss is moved to the entry price if the price decreases sufficiently.
This ensures the trade is risk-free after the price reaches the predefined level.
Visual Representation:
The EMAs are plotted on the chart for easy visualization of trends and crossovers.
Entry and exit points are also marked on the chart to track trades.
Purpose:
The strategy is designed to capitalize on EMA crossovers while minimizing risks using Break-Even logic and predefined Stop Loss/Take Profit levels. It automates decision-making for trend-following traders and ensures disciplined risk management.
IronBot v3Introduction
IronBot V3 is a TradingView indicator that analyzes market trends, identifies potential trading opportunities, and helps manage trades by visualizing entry points, stop-loss levels, and take-profit targets.
How It Works
The indicator evaluates price action within a specified analysis window to determine market trends. It uses Fibonacci retracement levels to identify key price levels for trend detection and trading signals. Based on user-defined inputs, it calculates and displays trade levels, including entry points, stop-loss, and multiple take-profit levels.
Trend Definition:
The highest high and lowest low are calculated over a specified number of candles.
The price range is determined as the difference between the highest high and lowest low.
Three Fibonacci levels are calculated within this range:
- Fib Level 0.236
- Trend Line (0.5 level)
- Fib Level 0.786
Determining Long and Short Conditions:
Long Conditions (Buy):
The closing price must be above both the trend line (0.5 level) and the Fib Level 0.236.
Additionally, the market must not currently be in a bearish trend.
Short Conditions (Sell):
The closing price must be below both the trend line and the Fib Level 0.786.
The market must not currently be in a bullish trend.
Trend State Updates:
When a condition is met, the indicator sets the trend to bullish or bearish and turns off bearish or bullish trend conditions.
If neither buy nor sell conditions are met, the trend remains unchanged, and no new trade signals are generated.
Inputs and Their Role in the Algorithm
General Settings
Analysis Window: Specifies the number of historical candles to analyze. This influences the calculation of key levels such as highs and lows, which are critical for determining Fibonacci retracement levels.
First Trade: Defines the start date for generating trading signals.
Trade Configuration
Display TP/SL: Enables or disables the visualization of take-profit and stop-loss levels on the chart.
Leverage: Defines the leverage applied to trades for risk and position size calculations.
Initial Capital: Specifies the starting capital, which is used for calculating position sizes and profits.
Exchange Fees (%): Sets the percentage of fees applied by the exchange, which is factored into profit calculations.
Country Tax (%): Allows users to define applicable taxes, which are subtracted from net profits.
Stop-Loss Configuration
Break Even: Toggles the break-even functionality. When enabled, the stop-loss level adjusts dynamically as take-profit levels are reached.
Stop Loss (%): Defines the percentage distance from the entry price to the stop-loss level.
Take-Profit Settings
The indicator supports up to four take-profit levels:
- TP1 through TP4 Ratios: Specify the price levels for each take-profit target as a percentage of the entry price.
- Profit Percentages: Allocate a percentage of the position size to each take-profit level.
Visualization Elements
Trend Indicators: Displays Fibonacci-based trend lines and markers for bullish or bearish conditions.
Trade Levels: Entry, stop-loss, and take-profit levels are visualized on the chart by dotted lines for clarity. Additionally, a semi-transparent background is applied when a portion of the trade is closed to enhance visualization. Positive profits from a closed trade are green; otherwise, they are red.
Trade Profit Indicator: On each trade, every time a part of the trade is closed (e.g., take profit is reached), the profit indicator will be updated.
Performance Panel: Summarizes key account statistics, including net balance, profit/loss, and trading performance metrics.
Usage Guidelines
Add the indicator to your TradingView chart.
Configure the input settings based on your trading strategy.
Use the displayed levels and trend signals to make informed trading decisions.
Contact
For further assistance, including automation inquiries, feel free to contact me through TradingView’s messaging system.
Purpose and Disclaimer
IronBot V3 is designed for educational purposes and to assist in analyzing market trends. It is not financial advice, and users should perform their own due diligence before making any trading decisions.
Trading involves significant risk, and past performance is not indicative of future results. Use this indicator responsibly.
RISK MANAGEMENT TABLEThis updated Risk Management Indicator is a powerful and customizable tool designed to help traders effectively manage risk on every trade. By dynamically calculating position size, stop-loss, and take-profit levels, it enables traders to stay disciplined and follow predefined risk parameters directly on their charts.
Features:
Dynamic Stop-Loss and Take-Profit Levels:
Stop-loss is based on the Average True Range (ATR), offering a flexible way to account for
market volatility.
Take-profit levels can be customized as a percentage of the entry price, providing a clear
target for trade exits.
Position Sizing Calculation:
The indicator computes the maximum position size by considering:
Trade amount (montant_ligne).
Risk percentage per trade.
Transaction fees.
Visual Representation:
Displays stop-loss and take-profit levels on the chart as customizable lines.
Optional visibility of these lines through checkboxes in the settings panel.
Comprehensive Risk Table:
A table on the chart summarizes essential risk metrics:
Stop-loss value.
Distance from entry in percentage.
Position size (maximum suggested).
Take-profit price.
Customizable:
Adjust parameters like ATR length, smoothing type, risk percentage, transaction fees,
and take-profit percentage.
Modify the visual length of lines representing stop-loss and take-profit levels.
How It Works:
Stop-Loss Calculation:
The stop-loss level is calculated using ATR and a volatility factor (default: 2).
This ensures your stop-loss adapts to market conditions.
Take-Profit Calculation:
Take-profit is derived as a percentage increase from the entry price.
Position Size:
The optimal position size is computed as:
Position Size = Risk per Trade /ATR-based Stop Distance
The risk per trade deducts transaction fees to provide a more accurate calculation.
Visual Lines:
Risk Table:
The table displays updated stop-loss, position size, and take-profit metrics at a glance.
Settings Panel:
Length: ATR length for calculating market volatility.
Smoothing: Choose RMA, SMA, EMA, or WMA for ATR smoothing.
Trade Amount: The capital allocated to a single trade.
Risk by Trade (%): Define how much of your trade capital is at risk per trade.
Transaction Fees: Input fees to ensure realistic calculations.
Take Profit (%): Specify your desired take-profit percentage.
Show Entry Stop Loss: Toggle visibility of the stop-loss line.
Show Entry Take Profit: Toggle visibility of the take-profit line.
Fair Value Breakout Strategy by @tradingbauhausThe **Breakaway Fair Value Gaps (BFVG) Strategy** is a trading approach designed to identify and capitalize on significant price gaps that occur within the context of a strong trend. These gaps, known as Fair Value Gaps (FVGs), represent areas where the price moves sharply, leaving behind an imbalance between supply and demand. When these gaps occur during a breakout or a strong trend continuation, they are referred to as **Breakaway Fair Value Gaps (BFVGs)**. This strategy uses these gaps as key levels for entering trades and managing risk.
---
### **Key Concepts**
1. **Fair Value Gap (FVG)**:
- A FVG occurs when the price moves sharply, leaving a gap between the high/low of previous candles and the current candle.
- It represents an imbalance in the market where buyers or sellers are overwhelmingly dominant.
2. **Breakaway Fair Value Gap (BFVG)**:
- A BFVG is a FVG that occurs during a strong trend or breakout, signaling potential continuation of the trend.
- It acts as a key level for entering trades in the direction of the trend.
3. **Mitigation Levels**:
- These are price levels where the market might retrace to "fill the gap" before continuing in the direction of the trend.
- The strategy monitors these levels to determine if the gap is still valid or if it has been mitigated.
---
### **Strategy Rules**
#### **Entry Conditions**
1. **Bullish BFVG**:
- A bullish BFVG occurs when:
- The current low is higher than the high of two candles ago (`low > high `).
- The close of the previous candle is higher than the high of two candles ago (`close > high `).
- **Entry**: Go long (buy) when a bullish BFVG is detected and the price has not yet mitigated the gap.
2. **Bearish BFVG**:
- A bearish BFVG occurs when:
- The current high is lower than the low of two candles ago (`high < low `).
- The close of the previous candle is lower than the low of two candles ago (`close < low `).
- **Entry**: Go short (sell) when a bearish BFVG is detected and the price has not yet mitigated the gap.
#### **Exit Conditions**
1. **Stop Loss**:
- The stop loss is placed at a fixed percentage below the entry price for long trades (`stop = close * (1 - stopLossPerc / 100)`).
- For short trades, the stop loss is placed at a fixed percentage above the entry price (`stop = close * (1 + stopLossPerc / 100)`).
2. **Take Profit**:
- The take profit is placed at a fixed percentage above the entry price for long trades (`limit = close * (1 + takeProfitPerc / 100)`).
- For short trades, the take profit is placed at a fixed percentage below the entry price (`limit = close * (1 - takeProfitPerc / 100)`).
#### **Mitigation Levels**
- If the price retraces and closes within the gap (mitigates the FVG), the gap is considered invalid, and the strategy stops monitoring it.
---
### **Visualization**
- **BFVG Boxes**:
- Bullish BFVGs are highlighted with a green box.
- Bearish BFVGs are highlighted with a red box.
- **Mitigation Lines**:
- Horizontal lines are drawn at the high/low of the gap to indicate the mitigation levels.
---
### **Dashboard**
The strategy includes a dashboard that displays key statistics:
1. **Total BFVGs Detected**:
- The number of bullish and bearish BFVGs identified.
2. **Mitigation Percentage**:
- The percentage of BFVGs that have been mitigated.
3. **Average/Median Duration**:
- The average or median number of candles it takes for a BFVG to be mitigated.
---
### **How It Works**
1. **Trend Identification**:
- The strategy uses a moving window of `length` candles to determine the current trend (highs and lows).
2. **Gap Detection**:
- It scans for FVGs that meet the criteria for BFVGs (strong trend context).
3. **Trade Execution**:
- Enters trades in the direction of the BFVG and manages risk using stop loss and take profit levels.
4. **Mitigation Monitoring**:
- Tracks whether the price retraces to fill the gap, invalidating the BFVG.
---
### **Advantages**
1. **Trend-Following**:
- The strategy capitalizes on strong trends, which often lead to significant price movements.
2. **Clear Entry and Exit Levels**:
- BFVGs provide well-defined levels for entering trades and managing risk.
3. **Flexibility**:
- Parameters like `length`, `stopLossPerc`, and `takeProfitPerc` can be adjusted to suit different trading styles.
---
### **Example**
- **Bullish BFVG**:
- The price is in an uptrend. A bullish BFVG is detected, and a long trade is entered.
- The stop loss is placed 1% below the entry price, and the take profit is placed 2% above.
- **Bearish BFVG**:
- The price is in a downtrend. A bearish BFVG is detected, and a short trade is entered.
- The stop loss is placed 1% above the entry price, and the take profit is placed 2% below.
---
### **Conclusion**
The **Breakaway Fair Value Gaps Strategy** is a systematic approach to trading strong trends by identifying and exploiting price gaps. It combines clear entry signals with robust risk management, making it suitable for traders who prefer trend-following strategies. By monitoring mitigation levels and using a dashboard for performance tracking, the strategy provides a comprehensive framework for trading BFVGs.