Channels With Patterns [ChartPrime]The Channels With Patterns indicator is an attempt at minimizing the delay in forming a trend channel. This indicator uses a single pivot in conjunction with a smooth version of the price to estimate the direction of an emerging trend. Using ATR, this indicator estimates the volatility of the new trend by adjusting the channel size by a multiple of the current ATR.
One of the biggest complains for any trend indicator is that it takes too long to create a channel or trend line. This indicator estimates the trend channel by checking if the price is moving in the correct direction and then it projects the channel from a single pivot. To allow for some margin of error, this script uses an offset to help center the channel.
This offset is generated from the ATR at the time of formation. In conjunction with forming estimated trend channels, this indicator features select candle stick patterns. These candle stick patterns are filtered by location in the formed trend channel. If the price is within an extremity of the trend channel it will appear. Filtering classical vanilla candle stick patterns using this methodology can result in some interesting results and possible confluence points for traders. For example; a bearish hammer appearing when filtered in an upper zone might add an extra level of realtime unique confluence traders.
Traders can use this script as a general trend line indicator that is a bit more forward looking than others, or it can be used it as its full blown trend channel estimator. Due to the fact that this is an estimate using the minimum possible information to make the channel, its accuracy will not always be perfect and can suffer compared to alternative methods.
When configuring the indicator it is important to understand the role of each input. Here is a description of all of the settings provided:
Presets (`preset`): This input allows users to quickly configure the indicator based on the market they are trading in. Selecting "Stocks," "Forex," or "Crypto" automatically adjusts various parameters to settings deemed optimal for these markets. The "User" option lets traders manually configure settings for a more personalized approach.
Style (`style`): This setting determines how pivot points are calculated. "Wick" uses the high and low of candlesticks (including wicks), which can be more sensitive to market extremes. "Body" uses only the open and close prices (the body of the candlesticks), potentially offering a more stable pivot point calculation.
Break Style (`break_style`): This option defines what price is used to determine if a channel has been broken. "Close" uses the closing price of a candlestick, while "High/Low" uses the highest and lowest prices. This affects how channel breaks are identified and can influence trading signals.
Instant Mode (`instant`): When enabled, this feature allows the indicator to form channels more quickly by initiating them as soon as potential formations are detected. This can provide earlier signals but may increase the risk of false positives.
ATR Length (`atr_length`): This input sets the period for the Average True Range (ATR), a common volatility indicator. A longer ATR period may smooth out the channel but could delay responsiveness to market changes. A shorter period might make the channel more responsive but potentially more erratic.
Offset Center (`offset`): Adjusts the vertical positioning of the channel. This can help in aligning the channel more accurately with the price action, depending on market conditions and personal trading strategies.
Size (`atr_multiplier`): Alters the channel's size relative to the ATR. A higher multiplier makes a wider channel, which might be useful in more volatile markets. A lower multiplier tightens the channel, which could be better for less volatile conditions.
Padding % (`padding`): This setting adjusts the padding within the top and bottom quarters of the channel. It essentially fine-tunes the channel's sensitivity to price movements near its boundaries.
Pivot Length (`pivot_length`): Determines the number of bars used to calculate pivot points. A longer length may provide more significant pivot points but can reduce the number of channels formed.
Pivot Look Forward (`look_forward`): Sets the number of bars to look forward in the pivot calculation, affecting how quickly the channel adapts to new pivots.
Average H/L Length (`avg_length`): Controls the smoothing of the high and low prices used in the channel calculation. A longer average length can lead to smoother, more gradual channel slopes.
Enable Hammer (`enable_hammer`): When enabled, the indicator will highlight Hammer candlestick patterns, which are often considered bullish reversal indicators.
Enable Inverted Hammer (`enable_ihammer`): This toggles the display of Inverted Hammer patterns, typically viewed as potential bullish reversal signals.
Enable Bullish Engulfing (`enable_bullish_engulfing`): Enables the identification of Bullish Engulfing patterns, another type of bullish reversal indicator.
Enable Bearish Engulfing (`enable_bearish_engulfing`): When activated, this highlights Bearish Engulfing patterns, which are often interpreted as bearish reversal signals.
Extend Channel (`extend`): This option, when enabled, extends the drawn channels forward until they are either broken or a new channel is formed.
Show Break Label (`show_break_label`): Toggles the display of labels indicating where the channel has been broken, providing visual cues for potential trade entries or exits.
Channel History Length (`history_length`): Determines how many historical channels are displayed on the chart. This can be useful for analyzing past performance and patterns.
Channel Colors (`top_color`, `bottom_color`, `center_color`): These settings allow customization of the channel's appearance by setting the colors of the top, bottom, and center lines.
Line Transparency (`line_trans`): Adjusts the transparency of the channel lines, helping to balance visibility with chart readability.
Center Line Transparency (`center_trans`): Specifically sets the transparency level of the center line of the channel.
Channel Fill Transparency (`fill_trans`): Modifies the transparency of the filled areas between the channel lines, which can enhance chart clarity and focus on the price action.
Break Colors (`break_up_color`, `break_down_color`): Sets the colors for labels that appear when the channel is broken, either upwards or downwards.
Break Label Text Color (`text_color`): Determines the color of the text in the break labels, enhancing readability based on the chart's background and color scheme.
Candle Pattern Colors (`h_color`, `ih_color`, `bullish_engulfing_color`, `bearish_engulfing_color`): These inputs allow for the customization of the colors used to highlight various candle patterns on the chart.
Candle Pattern Text Color (`candle_text_color`): Sets the color of the text for labels associated with candle pattern indicators.
Alerts (`new_channel_alert`, `break_alert`, `hammer_alert`, `ihammer_alert`, `bullish_engulfing_alert`, `bearish_engulfing_alert`): These toggles enable or disable alerts for different events, such as the formation of new channels, channel breaks, or the appearance of specific candle patterns. This feature is crucial for traders who rely on timely notifications for potential trading opportunities.
We have provided a few presets to allow you to get a feeling for how the indicator works with different settings easily. Here is a description of the settings used in each preset:
Stocks Preset:
Style: "Wick"
Break Style: False (High/Low)
Instant Mode: True
ATR Length: 10
Size (ATR Multiplier): 4
Pivot Length: 10
Pivot Look Forward: 15
Average H/L Length: 18
Forex Preset:
Style: "Wick"
Break Style: False (High/Low)
Instant Mode: True
ATR Length: 100
Size (ATR Multiplier): 5
Pivot Length: 10
Pivot Look Forward: 15
Average H/L Length: 18
Crypto Preset:
Style: "Wick"
Break Style: False (High/Low)
Instant Mode: True
ATR Length: 10
Size (ATR Multiplier): 4
Pivot Length: 10
Pivot Look Forward: 15
Average H/L Length: 18
This script first starts by defining and collecting the relevant data for the main body of the code with data(). This generates the pivot data, the levels, the ranges, the averages, the deltas, and finally the candle sticks. Once there is a higher low, or lower high detected via the pivots and the current price it triggers the formation of the new channel. It takes the delta between the last pivot and the current average price and projects the trend channel using this delta. If the price exceeds the extremities of the channel it will classify this as a break from the estimated structure and begin looking for a new channel. The idea is that when trending, the price will oscillate between extremities as defined by a range and direction. If the price is inside of one of these extremities the script will look for candle stick patterns. This is how the script operates.
On a more technical level, this script is meant to showcase Pine Script's custom types and methods. We have made use of a properties pattern allows functions to use a minimal number of arguments. This allows you to add new inputs without modifying a string of functions. The use of methods and data structures allows the main body of the code to be easy to understand and for the script as a whole to be easily modified. We have made sure that the script is modular so that users can incorporate this into their own custom scripts. It should be easy to expand on this script as the main logic is fairly compact and open for easy modification. All features are packed into their own function for easy use elsewhere. This is particularly evident in the candle stick section. I have simplified the process of creating candle stick patterns by creating a type. All users have to do is make methods for this type.
candle()=>
polarity = open < close
body_top = math.max(open, close)
body_bottom = math.min(open, close)
body_range = body_top - body_bottom
top_wick = high - body_top
bottom_wick = body_bottom - low
average_body = ta.ema(body_range, 14)
average_top_wick = ta.ema(top_wick, 14)
average_bottom_wick = ta.ema(bottom_wick, 14)
has_body = body_range != 0
has_top_wick = top_wick != 0
has_bottom_wick = bottom_wick != 0
above_average_body = body_range > average_body
above_average_top_wick = top_wick > average_top_wick
above_average_bottom_wick = bottom_wick > average_bottom_wick
candle_data.new(
polarity
, body_top
, body_bottom
, body_range
, top_wick
, bottom_wick
, average_body
, average_top_wick
, average_bottom_wick
, has_body
, has_top_wick
, has_bottom_wick
, above_average_body
, above_average_top_wick
, above_average_bottom_wick
)
In conclusion, this script offers a blend of rapid trend channel formation and candlestick pattern recognition, making it a unique tool for traders looking for a more proactive approach to trend analysis.
Wstęgi i Kanały
Donchian Channels StrengthTL;DR - A different approach calculating strength based on Donchain channels
My approach calculating strength by using the difference between price and donchain average. It is possible to use the highest/lowest value of a given source (like close) or to use the highest high/lowest low (by using the option 'include wicks') for the strength calculation
I added multiple moving averages which can be used in the calculations incl. SMMA (RMA) which is used in RSI calculation and works best for me.
Usage is similar to RSI: DC Strength oscillates between 0 and 100. Low values (<20) indicate a bearish situation while high values (>80) indicate bullish ones. Center line (50) crossings can also indicate a possible trend change.
Adaptive Trend Finder (log)In the dynamic landscape of financial markets, the Adaptive Trend Finder (log) stands out as an example of precision and professionalism. This advanced tool, equipped with a unique feature, offers traders a sophisticated approach to market trend analysis: the choice between automatic detection of the long-term or short-term trend channel.
Key Features:
1. Choice Between Long-Term or Short-Term Trend Channel Detection: Positioned first, this distinctive feature of the Adaptive Trend Finder (log) allows traders to customize their analysis by choosing between the automatic detection of the long-term or short-term trend channel. This increased flexibility adapts to individual trading preferences and changing market conditions.
2. Autonomous Trend Channel Detection: Leveraging the robust statistical measure of the Pearson coefficient, the Adaptive Trend Finder (log) excels in autonomously locating the optimal trend channel. This data-driven approach ensures objective trend analysis, reducing subjective biases, and enhancing overall precision.
3. Precision of Logarithmic Scale: A distinctive characteristic of our indicator is its strategic use of the logarithmic scale for regression channels. This approach enables nuanced analysis of linear regression channels, capturing the subtleties of trends while accommodating variations in the amplitude of price movements.
4. Length and Strength Visualization: Traders gain a comprehensive view of the selected trend channel, with the revelation of its length and quantification of trend strength. These dual pieces of information empower traders to make informed decisions, providing insights into both the direction and intensity of the prevailing trend.
In the demanding universe of financial markets, the Adaptive Trend Finder (log) asserts itself as an essential tool for traders, offering an unparalleled combination of precision, professionalism, and customization. Highlighting the choice between automatic detection of the long-term or short-term trend channel in the first position, this indicator uniquely caters to the specific needs of each trader, ensuring informed decision-making in an ever-evolving financial environment.
2bandHello traders
In this script, I have defined two bands with a deviation of 2 and 3
I designed the setup so that the upper lines represent red resistance, the lower lines represent green support, and the blue line represents the average price of the previous 20 candles in each time frame.
This code can be used mostly in time frames above 30 minutes and somehow predict possible price targets.
For example, if the price closes above the blue line in the one-hour time frame, the two fixed lines above are considered as targets and vice versa.
I have also added the pivot point calculation formula in orange
Most importantly, I added the closing price of the previous days in black
I hope it will be used by dear traders and you will support more for new works.
ZenTrend Price CyclesZenTrend attempts to plot the cycles that occur as the price cycles between the top and bottom of long- and short-term price linear regression channels.
The indicator observes a fast (35-period) and a slow (100-period) linear regression channel and plots their slopes on an oscillator. When the slope of the fast channel crosses above or below the slope of the slow channel, a signal is plotted.
The red line is the slope of the fast channel; blue is the slope of the slow channel
A green dot and background indicates the slope of recent price action has crossed above the slope of long-term price action.
A red dot and background indicates the slope of recent price action has crossed below the slope of long-term price action.
A gray dot indicates the slope of recent price action is slowing. The difference between the long- and short-term slopes is narrowing.
Here are things I look for when observing price cycles
Where does the cross occur? Crosses high above or below the 'zero line' indicate a more extreme change in price channel slopes.
Flat line: crosses that occur while the lines are flat often indicate chop.
"Curve" of the line - a cross that occurs as the slope lines are starting to curve up/down indicates a sharper and more extreme change in price channel slope.
Donchian Channels %I enjoy Donchian Channels for identifying trends. However, I hate having them on my chart. They are next to impossible to interpret at a glance. This script converts DCs to a % making a useful oscillator. The horizontal lines on the chart correspond to the Fib retracements below 50%. There are many ways to trade using this script and it works on any time frame. Moving average crosses are worth your attention, particularly, the 34 period MA (purple line). Enjoy and happy trading.
Inside Bars/Candles [CodeCraftedTrading]This Pine Script indicator is designed to identify and visually represent inside bars or candles. Here's a breakdown of its features and functionality:
1. Inputs:
insideCandlesColor: Color of the inside bars or candles.
highColor: Color of the horizontal line representing the high of the inside bar.
lowColor: Color of the horizontal line representing the low of the inside bar.
showHighLowLabel: Option to display labels for the high and low prices.
2. Logic:
The script checks for the conditions of an inside bar:
high < high and low > low
If an inside bar is detected and is not already in the range:
* Stores the high and low prices of the previous bar.
* Records the parent bar index and sets the broken flag to false.
If the current bar's high exceeds the stored high or the low falls below the stored low, the broken flag is set to true.
If the current bar is within the stored high and low range, it is considered in-range.
The script then dynamically plots horizontal lines at the high and low prices of the parent bar until the inside bar is broken.
3. Visualization:
The inside bars are colored based on the insideCandlesColor.
Horizontal lines are drawn at the high and low prices of the parent bar within the inside bar.
Optional labels display the rounded values of the high and low prices.
4. Usage:
Apply the script to your chart.
Adjust the input parameters according to your preferences.
The indicator will highlight inside bars with colored bars and draw lines representing the high and low prices. Labels are optional.
5. Note:
Inside bars are bars where the entire price range is within the high and low of the previous bar.
The script uses historical bar information and visualizes the inside bars dynamically on the chart.
Blockunity Excess Index (BEI)Identify excess zones resulting in market reversals by visualizing price deviations from an average.
The Excess Index (BEI) is designed to identify excess zones resulting in reversals, based on price deviations from a moving average. This moving average is fully customizable (type, period to be taken into account, etc.). This indicator also multiplies the moving average with a configurable coefficient, to give dynamic support and resistance levels. Finally, the BEI also provides reversal signals to alert you to any risk of trend change, on any asset.
The Idea
The goal is to provide the community with a visual and customizable tool for analyzing large price deviations from an average.
How to Use
Very simple to use, this indicator plots colored zones according to the price's deviation from the moving average. Moving average extensions also provide dynamic support and resistance. Finally, signals alert you to potential reversal points.
Elements
The Moving Average
The Moving Average, which defaults to a gray line over 200 periods, serves as a stable reference point. It is accompanied by an Index, whose color varies from yellow to orange to red, offering an overview of market conditions.
Extensions
These dynamic lines can be used to determine effective supports and resistances.
Signals
Green and red triangles serve as clear indicators for buy and sell signals.
Settings
Mainly, the type of moving average is configurable. The default is an SMA.
A Simple Moving Average (SMA) calculates the average of a selected range of prices by the number of periods in that range.
But you can also, for example, switch the mode to EMA.
The Exponential Moving Average (EMA) is a moving average that places a greater weight and significance on the most recent data points:
You also have WMA.
A Weighted Moving Average (WMA) gives more weight on recent data and less on past data:
And finally, the possibility of having a PCMA.
PCMA takes into account the highest and lowest points in the lookback period and divides this by two to obtain an average:
You can change other parameters such as lookback periods, as well as the coefficient used to define extension lines.
You can refer to the tooltips directly in the indicator parameters.
For those who prefer a minimalist display, you can activate a "Bar Color" in the settings (You must also uncheck "Borders" and "Wick" in your Chart Settings), and deactivate all other elements as you wish:
Finally, you can customize all the different colors, as well as the parameters of the table that indicates the Index value and the asset trend.
How it Works
The Index is calculated using the following method:
abs_distance = math.abs(close - base_ma)
bei = (abs_distance - ta.lowest(abs_distance, lookback_norm)) / (ta.highest(abs_distance, lookback_norm) - ta.lowest(abs_distance, lookback_norm)) * 100
Signals are triggered according to the following conditions:
A Long (buy) signal is triggered when the Index falls below 100, when the closing price is lower than 5 periods ago, and when the price is under the moving average.
A Short (sell) signal is triggered when the Index falls below 100, when the closing price is greater than 5 periods ago, and when the price is above the moving average.
TrailingTakeProfit exampleQuite recently I came upon a concept of Trailing Take Profit and I couldn't find a PineScript which implements it for the fastest possible execution, so here it is :)
Everybody knows Trailing StopLoss - an invisible mechanism follows the price and exits the trade once the price retreats too much from its recent most extended favourable value. Trailing TakeProfit does the similar thing, but at the opposite end - the trade gets closed if a price moves too well, in too favourable extent.
Why close the trade if it is going so good? Well, whatever goes up, must go down and vice versa. It is expected, that after fast rally a market will soon fall and after a dump it will go up. So Trailing TakeProfit's role is to secure profits.
But how does Trailing TakeProfit differ from the standard one? "Trailing" means, the exit level is moving. Its role is to be executed only after a rapid favourable move within 1-2 candles, not more. We never know when a rapid move happens, but when it does, we wanna catch those pips and quickly exit without looking back.
Visually Trailing TakeProfit levels are... bands. In this script example these are ATR multiplied bands (aka Keltner Channel), but they could also be Bollinger Bands or something else.
The code is simple just to focus on this single functionality, so you can quickly copy-paste it into your script. Entries are triggered by default SMA crosses.
P.S. I wouldn't be myself, if I didn't add alert messages compatible with the syntax of recently revamped TradingConnector - both in the code already and in the table showing them.
[blackcat] L1 Triple EMA ChannelHey, friends! blackcat is here to bring you an interesting and professional article today, talking about the "Triple Exponential Moving Average (TEMA) Channel" - a powerful tool as a trend indicator in volatile markets.
First of all, let's delve into the origins of the TEMA indicator. It was invented by Patrick Mulloy in the mid-90s with the aim to address the lagging issue encountered when using oscillators or Exponential Moving Averages (EMA). The TEMA indicator smooths out short-term fluctuations by utilizing multiple moving averages. What sets it apart is its unique approach of continuously using the EMA's EMA and adjusting for lag in its formula.
In this article, we will primarily focus on the functionality of the TEMA channel as a trend indicator. However, it's worth noting that its effectiveness is diminished in choppy or sideways markets. Instead, the TEMA indicator shines brightest in long-term trend trading. By utilizing TEMA, analysts can easily filter out and disregard periods of volatility, allowing them to focus on the overall trend.
To gain a comprehensive understanding of market trends, it is often recommended to combine TEMA with other oscillators or technical indicators. This combination can help traders and analysts interpret sharp price movements and assess the level of volatility. For example, some analysts suggest combining the Moving Average Convergence Divergence (MACD) with the TEMA channel to evaluate market trends more accurately.
Now, let's explore how the TEMA channel can be used as a tool to showcase interesting features of price support and resistance. In this script, the TEMA channel is represented by three bands: the upper band, the middle band, and the lower band. The upper band is depicted in white, the middle band in yellow, and the lower band in magenta.
So, let's dive deep into the world of the TEMA channel and enjoy the benefits it brings to understanding market trends. Join us on this exciting journey!
G2RIntroducing G2R – The Universal Indicator! Unlock the secret to trading success with G2R an extraordinary indicator that provides automatic signals across every time frame and market, from forex, crypto, stocks, & options with over 80% signal accuracy. Say goodbye to guesswork and hello to precision as G2R empowers you with real-time insights , giving you the edge to seize opportunities in any market condition . Elevate your trading strategy and conquer the financial world with G2R – your ultimate guide to profitable trading!
Features
• Bollinger bands
• 2 exponential moving averages
• Automatic buy and sell signals
• Works for Forex, Crypto, Indices, Stocks, & Options
• Tailored for all Timeframes
Trading Tips
• Trading Signals
• 30 Secs - 1 Min | SCALPING
• 3 Min - 5 Min | DAY TRADING
• 15 Min - 1 Hr | SWING & POSITION
• Take signal trades during London, New York, & Asia sessions
• Take Profits are found on the 15 Min, 30 Min, & 1 Hr timeframe at the trend channel or Moving Averages
• Stop loss are found above or below trend channel or moving averages
Warning
Never blindly take a trade on a G2R - wait for a proper market structure to occur before considering a trade.
DUCANH - KELTNER CHANNELS + EMA STRATEGY This is a strategy/combination of warning indicators using 3EMA and Keltner Channels.
I set up this strategy with the aim of reducing analytical labor in the market. When this strategy warns signals, then buy or sell.
This strategy setup works for timeframes, however it can still work for different timeframes.
It works well with Gold in various timeframes. If you want to apply it to other currency pairs, you must fine-tune the parameters for maximum efficiency.
The strategy details are as follows:
Ingredient:
EMA50 + EMA120 + SMA
Keltner Channels
Long position Alert:
EMA50 is above EMA120
The candlestick touches the lower KC band
Long position alert will trigger when the candlestick reaches the above conditions and the candlestick starts crossing up to the SMA
Short position Alert:
EMA50 is below EMA120
The candlestick touches the upper KC band
A short position alert will trigger when the candlestick reaches the above conditions and starts crossing down to SMA
Recommended RR: 1:3
If you have any questions please let me know !
Contrarian Donchian Channel Indicator with Alerts and VisualsTitle: Contrarian Donchian Channel Indicator with Alerts and Visuals
Description:
The Contrarian Donchian Channel Indicator is designed for traders who seek to implement a contrarian approach using the time-tested Donchian Channel method. This indicator not only signals potential entry points but also enhances trading visualization by marking hypothetical stop loss and take profit levels.
Key Features:
Donchian Channel Signals: Utilizes the Donchian Channel to identify potential reversal points in the market. The indicator generates buy signals when the price touches or breaches the lower band, suggesting a potential upward reversal. Conversely, sell signals are generated when the price touches or exceeds the upper band, indicating a possible downward reversal.
Pause After Stop Loss: Incorporates a unique feature that pauses signal generation for a user-defined number of candles after a stop loss is hit. This helps in avoiding immediate re-entries in volatile market conditions.
Stop Loss and Take Profit Visualization: For each signal, the indicator draws dashed lines on the chart to represent the hypothetical stop loss (red) and take profit (green) levels. These levels are calculated based on user-input percentages for stop loss and the risk-reward ratio.
Alerts for Entry Signals: Traders can set up alerts for buy and sell signals, allowing them to stay informed of potential trading opportunities.
How to Use:
Entry Signal: A triangle symbol (green for buy, red for sell) accompanied by an alert (if set) indicates a potential entry point.
Stop Loss and Take Profit Lines: Use the drawn lines as a guide for setting stop loss and take profit levels if the signal aligns with your trading strategy.
Pause Feature: After a stop loss is triggered, observe the pause period before considering new signals to avoid overtrading in choppy markets.
Suitable For:
Traders who prefer a contrarian approach.
Those who use Donchian Channels as part of their trading strategy.
Traders who appreciate visual aids for better decision-making.
Customization Options:
Length of the Donchian Channel.
Risk/Reward Ratio.
Stop Loss Percentage.
Pause duration after a stop loss is hit.
DISCLAIMER:
This indicator is intended for educational and informational purposes only and should not be construed as financial advice. Trade responsibly and always consider your risk tolerance and investment objectives.
Contrarian DC Strategy - w Entry SL Pause and TrailingStopDonchian Channel Setup:
The strategy uses a tool called the Donchian Channel. Imagine this as two lines (bands) on a chart that show the highest and lowest prices over a certain number of past trading days (default is 20 days).
There's also a centerline, which is the average of these two bands.
Entry Conditions for Trades:
Buying (Going Long): The strategy considers buying when the price touches or falls below the lower band of the Donchian Channel. However, this only happens if there has been a pause after a previous losing trade. This pause is a number of candles where no new trades are taken.
Selling (Going Short): Similarly, the strategy considers selling when price reaches or exceeds the upper band of the Donchian Channel. Again, this is subject to a pause after a losing trade.
Stop Loss and Take Profit:
Each trade has a "Stop Loss" and "Take Profit" set. The Stop Loss is a preset price level where the trade will close to prevent further losses if the market moves against your position. The Take Profit does the same but locks in profit if the market moves in your favor.
The Stop Loss is set based on a percentage of the price at which you entered the trade.
The Take Profit is determined by the Risk/Reward Ratio. This ratio helps balance how much you're willing to risk versus the potential reward.
Trailing Stop Loss:
When a trade is profitable, the strategy should involve a "Trailing Stop Loss." This means the Stop Loss level moves (or trails) the price movement to lock in profits as the market moves in your favor.
For a buy trade, if the price moves above the centerline of the Donchian Channel, the Trailing Stop Loss should be adjusted in the middle between the entry price and the centerline. Viceversa for a sell trade, it should be adjusted in the same way if the price goes below the centerline.
IMPORTANT: There's no allert for the trailing stop at the moment.
Post-Stop Loss Pause:
If a trade hits the Stop Loss (i.e., it's a losing trade), the strategy takes a break before opening another trade in the same direction. This pause helps to avoid entering another trade immediately in a potentially unfavorable market.
In summary, this strategy is designed to make trades based on the Donchian Channel, with specific rules for when to enter and exit trades, and mechanisms to manage risk and protect profits. It's contrarian because it tends to buy when the price is low and sell when the price is high, which is opposite to what many traders might do.
ATR StopThe "ATR Stop" indicator is designed to provide traders with insights into potential stop levels based on Average True Range (ATR) calculations specifically tailored for profitable (green candles) and unprofitable (red candles) price movements. This tool aims to assist traders in identifying potential stop levels that adjust dynamically based on the volatility of distinct market conditions.
The indicator functions by calculating two types of ATR: one for profitable movements and the other for unprofitable movements. The Average True Range is calculated separately for green and red candles, allowing users to assess potential stop levels more accurately based on the nature of price movements.
Key features of the "ATR Stop" indicator include:
Custom ATR Calculation: It calculates the ATR for profitable (green) and unprofitable (red) movements separately, considering only specific candle types based on their closing price relative to their opening price.
Dynamic Multiplier: Users can adjust the multiplier to fine-tune the sensitivity of the ATR-based stop levels, accommodating different risk preferences and market conditions.
Clear Visualization: The indicator plots the ATR levels for profitable (green) and unprofitable (red) movements one candle ahead on the chart, providing a visual representation of potential stop levels.
To use the indicator effectively, traders can adjust the ATR length and multiplier parameters based on their trading strategies and risk management preferences. By considering distinct price movements, this tool can assist in setting more informed stop levels in varying market conditions.
Please note that while the "ATR Stop" indicator can be a valuable addition to a trader's toolbox, it should be used in conjunction with other technical analysis tools and risk management strategies to make well-informed trading decisions.
No Wick Bull/Bear Candlesticks with Arrow premiumNo Wick Bull/Bear Candlesticks with Arrow premium
This script is for a custom trading indicator called "No Wick Bull/Bear Candlesticks with Arrow premium" developed by ClearTradingMind. It is designed for use with trading platforms that support scripting, such as TradingView. This indicator combines several technical analysis tools to help traders identify potential buy and sell signals in a financial market.
Key Components of the Indicator:
Moving Average (MA): The script allows users to select from various types of moving averages (SMA, EMA, HMA, etc.), which smooth out price data to identify trends. Users can set the length and type of the moving average.
Upper and Lower Bands: These bands are set at a specified deviation percentage above and below the chosen moving average. They help in identifying overbought and oversold conditions.
No Wick Bull/Bear Candlestick Identification:
Bullish Condition: A bullish candlestick is identified when the closing price is higher than the opening price, the low equals the open, and the close is above the moving average.
Bearish Condition: A bearish candlestick is identified when the closing price is lower than the opening price, the high equals the open, and the close is below the moving average.
No Wick: These conditions also imply that the candlesticks have no wicks, suggesting strong buying or selling pressure.
Arrows for Trading Signals:
No lower wick bull bar
No upper wick bear bar
When a bullish condition is met, a green upward-pointing triangle is plotted below the candlestick, indicating a potential buy signal.
When a bearish condition is met, a red downward-pointing triangle is plotted above the candlestick, indicating a potential sell signal.
EMA 20: An additional Exponential Moving Average with a length of 20 periods is plotted for further trend analysis.
Background Color Changes: The script changes the background color to blue if the EMA 20 is above the upper band, and to red if it is below the lower band, providing visual cues about the market trend.
How It Works:
Traders can input their preferences for the moving average type and length, source of the MA (like closing prices), and the deviation percentage for the bands.
The script then calculates the moving average, upper and lower bands, and checks for bullish or bearish candlestick conditions without wicks.
When such conditions are met, it plots arrows to suggest buy or sell signals.
The EMA 20 and background color changes offer additional trend information.
Usage:
This indicator is particularly useful in markets with clear trends. The no wick bull/bear candlesticks indicate strong buying or selling pressure, and the arrows provide clear visual signals for traders to consider entering or exiting positions. As with all trading indicators, it's recommended to use this tool in conjunction with other forms of analysis to confirm trading signals.
NAS100 - 5 Minute Opening Range with EMAsThis indicator is designed for traders who focus on the opening range breakout strategy and use EMAs as part of their trading decisions. The script markes the first 5 min opening candle and generates Buy and Sell signals calculating EMA.
Basic features are :
User Inputs: Allows users to enable/disable alerts and choose to display Exponential Moving Averages (EMAs) for 5, 20, and 50 periods.
Opening Range Calculation: It calculates the first five minutes of the trading day, adjusting for different chart timeframes.
New Day Detection: Determines if the current bar is the first bar of a new day.
Data Storage: Utilizes arrays to store opening range highs, lows, start bars, and last bars for the last five days.
Daily Updates: Updates the stored data at the start of each new day, maintaining data for only the last five days.
Opening Range Plotting: Plots the opening ranges (high and low) for the past five days, with special plotting and filling for the current day.
EMA Calculation and Plotting: Calculates and plots EMAs (5, 20, and 50 periods) if enabled.
Alert Conditions: Sets up conditions for alerts when the price crosses above or below the current day's opening range.
Signal Generation: Generates buy and sell signals based on the relationship of the closing price to the opening range and the position of EMA5 relative to EMA50.
Signal Plotting: Plots buy and sell signals as triangles on the chart.
Moving Fib Based on Donchain/Pivot/BBThis script's purpose is to provide the user with an indicator that automatically plots Fibonacci levels. The user has three main options for determining the Fibonacci's high and low. This indicator offers an ample number of settings, making it a modular Fibonacci overlay.
The default setting is based on Donchian high and low.
Another option is to base the high and low on TradingView's Pivot indicator.
The last option is to determine Fibonacci levels based on Bollinger Bands.
Add up to 16 Fib levels with customizable settings, plot them on a log scale, and explore various other settings to personalize the Fib overlay.
This indicator can be utilized for trading momentum or mean reversion strategies
Bolingger Bands + Inside Bar BoxesBollinger Bands are a technical analysis tool consist of three bands—an upper, middle, and lower band—that are used to spotlight extreme short-term prices in a security. The upper band represents overbought territory, while the lower band can show you when a security is oversold. Most technicians will use Bollinger Bands® in conjunction with other analysis tools to get a better picture of the current state of a market or security.
An Inside Bar is a two-bar price action trading strategy in which the inside bar is smaller and within the high to low range of the prior bar. Inside bars show a period of consolidation in a market. They often form following a strong move in a market, as it ‘pauses’ to consolidate before making its next move. However, they can also form at market turning points and act as reversal signals from key support or resistance levels.
Donchian Quest Research// =================================
Trend following strategy.
// =================================
Strategy uses two channels. One channel - for opening trades. Second channel - for closing.
Channel is similar to Donchian channel, but uses Close prices (not High/Low). That helps don't react to wicks of volatile candles (“stop hunting”). In most cases openings occur earlier than in Donchian channel. Closings occur only for real breakout.
// =================================
Strategy waits for beginning of trend - when price breakout of channel. Default length of both channels = 50 candles.
Conditions of trading:
- Open Long: If last Close = max Close for 50 closes.
- Close Long: If last Close = min Close for 50 closes.
- Open Short: If last Close = min Close for 50 closes.
- Close Short: If last Close = max Close for 50 closes.
// =================================
Color of lines:
- black - channel for opening trade.
- red - channel for closing trade.
- yellow - entry price.
- fuchsia - stoploss and breakeven.
- vertical green - go Long.
- vertical red - go Short.
- vertical gray - close in end, don't trade anymore.
// =================================
Order size calculated with ATR and volatility.
You can't trade 1 contract in BTC and 1 contract in XRP - for example. They have different price and volatility, so 1 contract BTC not equal 1 contract XRP.
Script uses universal calculation for every market. It is based on:
- Risk - USD sum you ready to loss in one trade. It calculated as percent of Equity.
- ATR indicator - measurement of volatility.
With default setting your stoploss = 0.5 percent of equity:
- If initial capital is 1000 USD and used parameter "Permit stop" - loss will be 5 USD (0.5 % of equity).
- If your Equity rises to 2000 USD and used parameter "Permit stop"- loss will be 10 USD (0.5 % of Equity).
// =================================
This Risk works only if you enable “Permit stop” parameter in Settings.
If this parameter disabled - strategy works as reversal strategy:
⁃ If close Long - channel border works as stoploss and momentarily go Short.
⁃ If close Short - channel border works as stoploss and momentarily go Long.
Channel borders changed dynamically. So sometime your loss will be greater than ‘Risk %’. Sometime - less than ‘Risk %’.
If this parameter enabled - maximum loss always equal to 'Risk %'. This parameter also include breakeven: if profit % = Risk %, then move stoploss to entry price.
// =================================
Like all trend following strategies - it works only in trend conditions. If no trend - slowly bleeding. There is no special additional indicator to filter trend/notrend. You need to trade every signal of strategy.
Strategy gives many losses:
⁃ 30 % of trades will close with profit.
⁃ 70 % of trades will close with loss.
⁃ But profit from 30% will be much greater than loss from 70 %.
Your task - patiently wait for it and don't use risky setting for position sizing.
// =================================
Recommended timeframe - Daily.
// =================================
Trend can vary in lengths. Selecting length of channels determine which trend you will be hunting:
⁃ 20/10 - from several days to several weeks.
⁃ 20/20 or 50/20 - from several weeks to several months.
⁃ 50/50 or 100/50 or 100/100 - from several months to several years.
// =================================
Inputs (Settings):
- Length: length of channel for trade opening/closing. You can choose 20/10, 20/20, 50/20, 50/50, 100/50, 100/100. Default value: 50/50.
- Permit Long / Permit short: Longs are most profitable for this strategy. You can disable Shorts and enable Longs only. Default value: permit all directions.
- Risk % of Equity: for position sizing used Equity percent. Don't use values greater than 5 % - it's risky. Default value: 0.5%.
⁃ ATR multiplier: this multiplier moves stoploss up or down. Big multiplier = small size of order, small profit, stoploss far from entry, low chance of stoploss. Small multiplier = big size of order, big profit, stop near entry, high chance of stoploss. Default value: 2.
- ATR length: number of candles to calculate ATR indicator. It used for order size and stoploss. Default value: 20.
- Close in end - to close active trade in the end (and don't trade anymore) or leave it open. You can see difference in Strategy Tester. Default value: don’t close.
- Permit stop: use stop or go reversal. Default value: without stop, reversal strategy.
// =================================
Properties (Settings):
- Initial capital - 1000 USD.
- Script don't uses 'Order size' - you need to change 'Risk %' in Inputs instead.
- Script don't uses 'Pyramiding'.
- 'Commission' 0.055 % and 'Slippage' 0 - this parameters are for crypto exchanges with perpetual contracts (for example Bybit). If use on other markets - set it accordingly to your exchange parameters.
// =================================
Big dataset used for chart - 'BITCOIN ALL TIME HISTORY INDEX'. It gives enough trades to understand logic of script. It have several good trends.
// =================================
[imba]lance algo🟩 INTRODUCTION
Hello, everyone!
Please take the time to review this description and source code to utilize this script to its fullest potential.
🟩 CONCEPTS
This is a trend indicator. The trend is the 0.5 fibonacci level for a certain period of time.
A trend change occurs when at least one candle closes above the level of 0.236 (for long) or below 0.786 (for short). Also it has massive amout of settings and features more about this below.
With good settings, the indicator works great on any market and any time frame!
A distinctive feature of this indicator is its backtest panel. With which you can dynamically view the results of setting up a strategy such as profit, what the deposit size is, etc.
Please note that the profit is indicated as a percentage of the initial deposit. It is also worth considering that all profit calculations are based on the risk % setting.
🟩 FEATURES
First, I want to show you what you see on the chart. And I’ll show you everything closer and in more detail.
1. Position
2. Statistic panel
3. Backtest panel
Indicator settings:
Let's go in order:
1. Strategies
This setting is responsible for loading saved strategies. There are only two preset settings, MANUAL and UNIVERSAL. If you choose any strategy other than MANUAL, then changing the settings for take profits, stop loss, sensitivity will not bring any results.
You can also save your customized strategies, this is discussed in a separate paragraph “🟩HOW TO SAVE A STRATEGY”
2. Sensitive
Responsible for the time period in bars to create Fibonacci levels
3. Start calculating date
This is the time to start backtesting strategies
4. Position group
Show checkbox - is responsible for displaying positions
Fill checkbox - is responsible for filling positions with background
Risk % - is responsible for what percentage of the deposit you are willing to lose if there is a stop loss
BE target - here you can choose when you reach which take profit you need to move your stop loss to breakeven
Initial deposit- starting deposit for profit calculation
5. Stoploss group
Fixed stoploss % checkbox - If choosed: stoploss will be calculated manually depending on the setting below( formula: entry_price * (1 - stoploss percent)) If NOT choosed: stoploss will be ( formula: fibonacci level(0.786/0.236) * (1 + stoploss percent))
6. Take profit group
This group of settings is responsible for how far from the entry point take profits will be and what % of the position to fix
7. RSI
Responsible for configuring the built-in RSI. Suitable bars will be highlighted with crosses above or below, depending on overbought/oversold
8. Infopanels group
Here I think everything is clear, you can hide or show information panels
9. Developer mode
If enabled, all events that occur will be shown, for example, reaching a take profit or stop loss with detailed information about the unfixed balance of the position
🟩 HOW TO USE
Very simple. All you need is to wait for the trend to change to long or short, you will immediately see a stop loss and four take profits, and you will also see prices. Like in this picture:
🟩 ALERTS
There are 3 types of alerts:
1. Long signal
2. Short signal
3. Any alert() function call - will be send to you json with these fields
{
"side": "LONG",
"entry": "64.454",
"tp1": "65.099",
"tp2": "65.743",
"tp3": "66.388",
"tp4": "67.032",
"winrate": "35.42%",
"strategy": "MANUAL",
"beTargetTrigger": "1",
"stop": "64.44"
}
🟩 HOW TO SAVE A STRATEGY
First, you need to make sure that the “MANUAL” strategy is selected in the strategy settings.
After this, you can start selecting parameters that will show the largest profit in the statistics panel.
I have highlighted what you need to pay attention to when choosing a strategy
Let's assume you have set up a strategy. The main question is how to preserve it?
Let’s say the strategy turned out with the following parameters:
Next we need to find this section of code:
// STRATS
selector(string strategy_name) =>
strategy_settings = Strategy_settings.new()
switch strategy_name
"MANUAL" =>
strategy_settings.sensitivity := 18
strategy_settings.risk_percent := 1
strategy_settings.break_even_target := "1"
strategy_settings.tp1_percent := 1
strategy_settings.tp1_percent_fix := 40
strategy_settings.tp2_percent := 2
strategy_settings.tp2_percent_fix := 30
strategy_settings.tp3_percent := 3
strategy_settings.tp3_percent_fix := 20
strategy_settings.tp4_percent := 4
strategy_settings.tp4_percent_fix := 10
strategy_settings.fixed_stop := false
strategy_settings.sl_percent := 0.0
"UNIVERSAL" =>
strategy_settings.sensitivity := 20
strategy_settings.risk_percent := 1
strategy_settings.break_even_target := "1"
strategy_settings.tp1_percent := 1
strategy_settings.tp1_percent_fix := 40
strategy_settings.tp2_percent := 2
strategy_settings.tp2_percent_fix := 30
strategy_settings.tp3_percent := 3
strategy_settings.tp3_percent_fix := 20
strategy_settings.tp4_percent := 4
strategy_settings.tp4_percent_fix := 10
strategy_settings.fixed_stop := false
strategy_settings.sl_percent := 0.0
// "NEW STRATEGY" =>
// strategy_settings.sensitivity := 20
// strategy_settings.risk_percent := 1
// strategy_settings.break_even_target := "1"
// strategy_settings.tp1_percent := 1
// strategy_settings.tp1_percent_fix := 40
// strategy_settings.tp2_percent := 2
// strategy_settings.tp2_percent_fix := 30
// strategy_settings.tp3_percent := 3
// strategy_settings.tp3_percent_fix := 20
// strategy_settings.tp4_percent := 4
// strategy_settings.tp4_percent_fix := 10
// strategy_settings.fixed_stop := false
// strategy_settings.sl_percent := 0.0
strategy_settings
// STRATS
Let's uncomment on the latest strategy called "NEW STRATEGY" rename it to "SOL 5m" and change the sensitivity:
// STRATS
selector(string strategy_name) =>
strategy_settings = Strategy_settings.new()
switch strategy_name
"MANUAL" =>
strategy_settings.sensitivity := 18
strategy_settings.risk_percent := 1
strategy_settings.break_even_target := "1"
strategy_settings.tp1_percent := 1
strategy_settings.tp1_percent_fix := 40
strategy_settings.tp2_percent := 2
strategy_settings.tp2_percent_fix := 30
strategy_settings.tp3_percent := 3
strategy_settings.tp3_percent_fix := 20
strategy_settings.tp4_percent := 4
strategy_settings.tp4_percent_fix := 10
strategy_settings.fixed_stop := false
strategy_settings.sl_percent := 0.0
"UNIVERSAL" =>
strategy_settings.sensitivity := 20
strategy_settings.risk_percent := 1
strategy_settings.break_even_target := "1"
strategy_settings.tp1_percent := 1
strategy_settings.tp1_percent_fix := 40
strategy_settings.tp2_percent := 2
strategy_settings.tp2_percent_fix := 30
strategy_settings.tp3_percent := 3
strategy_settings.tp3_percent_fix := 20
strategy_settings.tp4_percent := 4
strategy_settings.tp4_percent_fix := 10
strategy_settings.fixed_stop := false
strategy_settings.sl_percent := 0.0
"SOL 5m" =>
strategy_settings.sensitivity := 15
strategy_settings.risk_percent := 1
strategy_settings.break_even_target := "1"
strategy_settings.tp1_percent := 1
strategy_settings.tp1_percent_fix := 40
strategy_settings.tp2_percent := 2
strategy_settings.tp2_percent_fix := 30
strategy_settings.tp3_percent := 3
strategy_settings.tp3_percent_fix := 20
strategy_settings.tp4_percent := 4
strategy_settings.tp4_percent_fix := 10
strategy_settings.fixed_stop := false
strategy_settings.sl_percent := 0.0
strategy_settings
// STRATS
Now let's find this code:
strategy_input = input.string(title = "STRATEGY", options = , defval = "MANUAL", tooltip = "EN: To manually configure the strategy, select MANUAL otherwise, changing the settings won't have any effect RU: Чтобы настроить стратегию вручную, выберите MANUAL в противном случае изменение настроек не будет иметь никакого эффекта")
And let's add our new strategy there, it turned out like this:
strategy_input = input.string(title = "STRATEGY", options = , defval = "MANUAL", tooltip = "EN: To manually configure the strategy, select MANUAL otherwise, changing the settings won't have any effect RU: Чтобы настроить стратегию вручную, выберите MANUAL в противном случае изменение настроек не будет иметь никакого эффекта")
That's all. Our new strategy is now saved! It's simple! Now we can select it in the list of strategies:
Linear Regression Channel 200█ OVERVIEW
This a simplified version of linear regression channel which use length 200 instead of traditional length 100.
█ FEATURES
Color change depends light / dark mode.
█ LIMITATIONS
Limited to source of closing price and max bars back is 1500.
█ SIMILAR
Regression Channel Alternative MTF
Regression Channel Alternative MTF V2
Monday range by MatboomThe "Monday Range" Pine Script indicator calculates and displays the lowest and highest prices during a specified trading session, focusing on Mondays. Users can configure the trading session parameters, such as start and end times and time zone. The indicator visually highlights the session range on the chart by plotting the session low and high prices and applying a background color within the session period. The customizable days of the week checkboxes allow users to choose which days the indicator should consider for analysis.
Session Configuration:
session = input.session("0000-0000", title="Trading Session")
timeZone = input.string("UTC", title="Time Zone")
monSession = input.bool(true, title="Mon ", group="Trading Session", inline="d1")
tueSession = input.bool(true, title="Tue ", group="Trading Session", inline="d1")
Users can configure the trading session start and end times and the time zone.
Checkboxes for Monday (monSession) and Tuesday (tueSession) sessions are provided.
SessionLow and SessionHigh Functions:
SessionLow(sessionTime, sessionTimeZone=syminfo.timezone) => ...
SessionHigh(sessionTime, sessionTimeZone=syminfo.timezone) => ...
Custom functions to calculate the lowest (SessionLow) and highest (SessionHigh) prices during a specified trading session.
InSession Function:
InSession(sessionTimes, sessionTimeZone=syminfo.timezone) => ...
Determines if the current bar is inside the specified trading session.
Days of Week String and Session String:
sessionDays = ""
if monSession
sessionDays += "2"
if tueSession
sessionDays += "3"
tradingSession = session + ":" + sessionDays
Constructs a string representing the selected days of the week for the session.
Fetch Session Low and High:
sessLow = SessionLow(tradingSession, timeZone)
sessHigh = SessionHigh(tradingSession, timeZone)
Calls the custom functions to obtain the session low and high prices.
Plot Session Low and High and Background Color for Session
plot(sessLow, color=color.red, title="Session Low")
plot(sessHigh, color=color.red, title="Session Low")
bgcolor(InSession(tradingSession, timeZone) ? color.new(color.aqua, 90) : na)