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.
Bands and Channels
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.
[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)
Channel CorridorOVERVIEW
The Channel Corridor indicator is designed to operate on a log chart of asset prices (e.g., BTCUSD), specifically on a weekly timeframe.
The intent of the indicator is to provide a visual representation of market dynamics, focusing on a dynamically adjusted corridor around a Simple Moving Average (SMA) of an asset's price. The corridor adapts to changing market conditions. The indicator includes channels within the corridor for additional reference points.
PURPOSE
Trend Identification: The channel corridor can aid in visualising the overall trend, as it dynamically adjusts the corridor based on an SMA and user-defined parameters.
Volatility Assessment: The width of the channel corridor can may act as a gauge of market volatility.
Reversal Points: The channel corridor may signal potential trend reversals or corrections when an asset price approaches the upper or lower bounds of the corridor.
Long-Term Trend Analysis: The channel corridor may aid in longer-term trend analysis.
CONSIDERATIONS
Validation: It's recommended that careful back-testing over historical data be done before acting on any identified opportunities.
User Discretion: Trading decisions should not rely solely on this script. Users should exercise judgment and consider market conditions.
CREDIT
Ideation: Thanks @Sw1ngTr4der for the idea and corridor seed code
ATR Based Stoploss - TakeProfit [CharmyDexter]
This script combines the power of Average True Range (ATR) and a Moving Average (MA) to dynamically set stop-loss and take-profit levels. It introduces a volatility surge condition and includes a risk management table for comprehensive trade insights.
1) **Originality:**
- This script is original in its approach to combining Average True Range (ATR) with a Moving Average (MA) to create a dynamic stop-loss and take-profit strategy. The addition of a volatility surge condition and the inclusion of a risk management table further contribute to its uniqueness.
2) **Functionality:**
- The script aims to provide traders with a dynamic stop-loss and take-profit strategy based on ATR, incorporating a volatility surge condition and a moving average. The risk management table displays crucial information, including the fund size, potential profit/loss, ATR values, and risk.
3) **Operation:**
- The script uses ATR to calculate volatility, identifying surges in volatility. It adjusts the stop-loss and take-profit levels based on the average of ATR during these surge periods. The moving average acts as a trend indicator, and the script dynamically adjusts stop-loss and take-profit levels accordingly.
4) **Usage:**
- Traders can use this script by applying it to their preferred financial instrument's chart. The script automatically plots the moving average and dynamically adjusts stop-loss and take-profit levels based on ATR and volatility surges. Users can observe the levels on the chart for potential trade management.
5) **Concepts:**
- The script employs concepts of ATR for volatility, moving average for trend identification, and a dynamic adjustment mechanism during volatility surges. Risk management is incorporated by calculating potential profit/loss percentages based on user-defined risk.
6) **Mashup Explanation:**
- The script combines ATR, moving average, and volatility conditions to create a comprehensive strategy. ATR determines the market's volatility, the moving average serves as a trend indicator, and volatility surges trigger dynamic adjustments to stop-loss and take-profit levels. The risk management table enhances the script's utility.
7) **Line Descriptions:**
- Blue Line (Moving Average): Indicates the trend direction.
- Lime Line (Long Take Profit): Represents the level for taking profit in a long position.
- Maroon Line (Short Take Profit): Represents the level for taking profit in a short position.
- Fuchsia Line (Short Stop Loss): Represents the level for setting a stop loss in a short position.
- Orange Line (Long Stop Loss): Represents the level for setting a stop loss in a long position.
8) **Line Usage:**
- Use the blue line for trend identification.
- When taking long positions, the close should be above the blue line.
- For long positions, the lime line is a potential take-profit level, and the orange line is a potential stop-loss level.
- For short positions, the maroon line is a potential take-profit level, and the fuchsia line is a potential stop-loss level.
- The risk management table provides insights into fund size, potential profit/loss, ATR values, and risk.
Note: The profit/loss calculations in this script may not be entirely accurate due to factors like market execution. Market execution may not always occur at the exact levels specified by the script due to slippage or delays in order processing. This can impact the realized profit or loss compared to the calculated levels.
It is crucial to note that this ATR Based Stop-loss - Take-Profit indicator is merely one tool among many that traders can employ to establish trading targets. Additional technical indicators are essential for taking trades and making informed decisions.
Commented-out sections for alerts and shape plotting are provided, allowing for visual and auditory notifications if desired.
It's crucial for traders to be aware of these factors and use the script as a tool within a broader trading strategy. Additionally, regular monitoring and adjustments based on real-time market conditions are recommended to enhance the accuracy of profit/loss assessments.
Choose Symbol, Mode with Hull,Stochatic Mom,EMA,MACD,RSI,TableThis Pine Script code is a comprehensive indicator for the TradingView platform, offering a variety of technical analysis tools. Below is an English introduction to its features and purposes:
Introduction:
This indicator is designed for traders on TradingView and provides a multi-functional analysis toolset. It includes different charting modes (Heikin-Ashi, Linear, and Normal), a Hull Moving Average (Hull), Stochastic Momentum, RSI (Relative Strength Index), MACD (Moving Average Convergence Divergence), EMA (Exponential Moving Average), Bollinger Bands, and a summary table displaying key metrics.
Key Features:
Charting Modes:
Users can choose between "Heikin-Ashi," "Linear," or "Normal" modes to visualize price data in different ways.
Hull Moving Average:
The script incorporates the Hull Moving Average for trend analysis, highlighting potential buy and sell signals.
Stochastic Momentum:
Stochastic Momentum, with customizable parameters (K, D, and Smooth), is included to identify overbought and oversold conditions.
RSI (Relative Strength Index):
RSI is calculated and displayed, aiding in identifying potential trend reversals or exhaustion points.
MACD (Moving Average Convergence Divergence):
The MACD indicator is included, along with a histogram, to highlight changes in momentum and potential crossovers.
RSI Momentum:
RSI Momentum is calculated, providing additional insights into momentum changes.
Exponential Moving Averages (EMA):
The script calculates and displays three EMAs (Exponential Moving Averages) with customizable periods.
Bollinger Bands:
Bollinger Bands are incorporated, offering insights into volatility and potential price reversals.
Summary Table:
A table is displayed on the chart summarizing key metrics, including Stochastic MoM, RSI, MACD, RSI EMA, Hull percentage change, and EMA values.
Customization:
Users have the option to customize various parameters, including chart modes, lengths of moving averages, Stochastic parameters, and more.
Usage:
The indicator aims to provide a comprehensive view of price action and potential trend changes. Traders can use it for technical analysis and decision-making.
Important Note:
This script is provided for educational purposes and does not constitute financial advice. Traders and investors should conduct their research and analysis before making any trading decisions.
Fibonacci Enhanced Bollinger BandsDiscover the synergistic power of Fibonacci ratios with traditional Bollinger Bands in the 'Fibonacci Enhanced Bollinger Bands' indicator. Ideal for traders seeking dynamic price levels for strategic entries and exits, this tool adds a unique Fibonacci twist to your technical analysis toolkit.
Introduction to Fibonacci Enhanced Bollinger Bands
'Fibonacci Enhanced Bollinger Bands' is a trading indicator that combines the classic Bollinger Bands approach with the powerful insights of Fibonacci ratios. By integrating these two concepts, this indicator offers traders a unique perspective on market volatility and potential support/resistance levels.
How It Works
Core Concept : The indicator calculates Bollinger Bands using a selected Fibonacci ratio. This ratio is applied to the standard deviation of the price series, providing a dynamic range around a Simple Moving Average (SMA).
Trading Strategies
Long Opportunities : The area below the lower band can be considered a potential zone for long positions. Prices in this zone may indicate an oversold market condition, suggesting a possible reversal or pullback.
Short Opportunities : Conversely, the area above the upper band might signal short-selling opportunities. Prices in this region could imply an overbought scenario, potentially leading to a price decline.
Versatility : Whether you're a day trader, swing trader, or long-term investor, this indicator adapts to various timeframes and assets, making it a versatile tool in your trading arsenal.
Conclusion
The 'Fibonacci Enhanced Bollinger Bands' indicator is designed for traders who wish to leverage the power of Fibonacci ratios in conjunction with the volatility insights provided by Bollinger Bands. It's an excellent tool for identifying potential reversal zones and refining entry and exit points. Try it out to enhance your market analysis and support your trading decisions with the combined wisdom of Fibonacci and Bollinger Bands.
Logarithmic Bollinger Bands [MisterMoTA]The script plot the normal top and bottom Bollinger Bands and from them and SMA 20 it finds fibonacci logarithmic levels where price can find temporary support/resistance.
To get the best results need to change the standard deviation to your simbol value, like current for BTC the Standards Deviation is 2.61, current Standard Deviation for ETH is 2.55.. etc.. find the right current standard deviation of your simbol with a search online.
The lines ploted by indicators are:
Main line is a 20 SMA
2 retracement Logarithmic Fibonacci 0.382 levels above and bellow 20 sma
2 retracement Logarithmic Fibonacci 0.618 levels above and bellow 20 sma
Top and Bottom Bollindger bands (ticker than the rest of the lines)
2 expansion Logarithmic Fibonacci 0.382 levels above Top BB and bellow Bottom BB
2 expansion Logarithmic Fibonacci 0.618 levels above Top BB and bellow Bottom BB
2 expansion Logarithmic Fibonacci level 1 above Top BB and bellow Bottom BB
2 expansion Logarithmic Fibonacci 1.618 levels above Top BB and bellow Bottom BB
Let me know If you find the indicator useful or PM if you need any custom changes to it.
Zemog Channels[Zemogtrading]Channels Strategy
User Description:
This Channels strategy is a powerful technical analysis tool that empowers traders with a comprehensive view of the market's support and resistance levels. Designed for both beginners and experienced traders, this strategy brings a systematic and adaptable approach to chart analysis.
Default Parameters:
Swing Length (SL): 45
Higher Timeframe: Daily (D)
Multiplier for Level 2: 3.5
Multiplier for Level 3: 12
How It Works:
Swing Analysis: The Swing Length (SL) parameter allows users to fine-tune the sensitivity of the strategy. A higher SL value provides a more smoothed-out analysis, ideal for a broader market perspective, while a lower value enhances responsiveness to short-term price movements.
Higher Timeframe Insights: The Channels fetches high and low prices from a user-specified higher timeframe (default: Daily). This ensures that the strategy is well-informed by significant price levels from a broader market context.
Dynamic ATR Calculation: The Average True Range (ATR) adapts dynamically to changing market conditions. This ensures that support and resistance levels adjust in real-time based on the prevailing volatility, providing traders with adaptive insights.
Smoothed Support and Resistance: Utilizing a Smoothed Moving Average (SMA), the strategy calculates support and resistance levels based on high and low prices from the higher timeframe. This smoothing effect enhances clarity in identifying key levels, facilitating more informed trading decisions.
Additional Levels: The Channels introduces Level 2 and Level 3 support and resistance zones. Users can customize multipliers for these levels, allowing for the identification of secondary zones for potential market reversals.
Visualization: The strategy vividly plots support and resistance levels on the chart. Green lines indicate support, red lines denote resistance, and yellow lines represent additional support at Level 3.
Using Channels is a versatile tool that equips traders with a deeper understanding of crucial market levels. By seamlessly integrating swing analysis, higher timeframe data, and adaptive calculations, this strategy offers a holistic and user-friendly approach to technical analysis.
Fibonacci Displaced Moving Averages with Percentage DisplacementThis indicator combines Fibonacci levels with percentage-based displacement, creating a versatile tool for analyzing moving averages in relation to market trends and potential reversal points. It's designed to adapt to different market conditions and asset types, making it a valuable addition to a trader's toolkit.
Key Features:
Fibonacci-Infused Averages: Leverages Fibonacci ratios (0.618, 0.382, 0.236) to construct displaced moving averages. This method offers a layered perspective of market support and resistance levels.
Adaptive Percentage-Based Displacement: The displacement of the moving average is calculated as a percentage of the average, allowing for flexible and market-responsive band positioning. This feature is particularly crucial for adapting to the unique volatility and price behavior of different trading pairs.
Customizable SMA Core: The core of the indicator is a simple moving average (SMA), which can be tailored in length to suit various trading strategies and timeframes.
Logarithmic Scale Compatibility: Includes an option for logarithmic scaling, making it applicable to a broad range of assets, including those with exponential price trends.
Advanced Alert System: Equipped with a comprehensive alert system, it notifies traders of price crossings over any of the Fibonacci displaced moving averages, aiding timely market responses.
Optimizing for Different Pairs:
To maximize the indicator's effectiveness, it is crucial to fine-tune the Percentage Displacement setting according to the specific volatility and price movement characteristics of each trading pair. This customization ensures that the displaced moving averages accurately reflect the market dynamics of each asset, providing more reliable support and resistance levels for traders.
Ideal Use Cases:
This indicator is ideal for traders who seek a deeper understanding of moving averages, especially in markets where Fibonacci levels play a significant role. It is versatile enough for various trading approaches, including swing and day trading, and adaptable across multiple timeframes.
Custom Price Levels and AveragesThe "Custom Price Levels and Averages" indicator is a versatile tool designed for TradingView. It dynamically calculates and displays key price levels based on user-defined parameters such as distance percentages and position size. The indicator plots three ascending and descending price levels (A, B, C, X, Y, Z) around the last candle close on a specified timeframe. Additionally, it provides the average price for both upward and downward movements, considering the user's specified position size and increase factor. Traders can easily customize the visual appearance by adjusting colors for each plotted line. This indicator assists in identifying potential support and resistance levels and understanding the average price movements within a specified trading context.
Avoid SL hunting by acumulating your position with scaled orders.
Input Parameters:
inputTimeframe: Allows the user to select a specific timeframe (default: "D" for daily).
distancePercentageUp: Determines the percentage increase for ascending price levels (default: 1.5%).
distancePercentageDown: Determines the percentage decrease for descending price levels (default: 1.5%).
position: Specifies the position size in USD for calculating average prices (default: $100).
increaseFactor: Adjusts the increase in position size for each subsequent level (default: 1.5).
calcAvgPrice Function:
Parameters:
priceA, priceB, priceC: Ascending price levels.
priceX, priceY, priceZ: Descending price levels.
position: User-defined position size.
increaseFactor: User-defined increase factor.
Calculation:
Calculates the weighted average price for ascending (priceA, priceB, priceC) and descending (priceX, priceY, priceZ) levels.
Utilizes the specified position size and increase factor to determine the weighted average.
Plotting:
Price Calculations:
priceA, priceB, priceC: Derived by applying percentage increases to the last candle's close.
priceX, priceY, priceZ: Derived by applying percentage decreases to the last candle's close.
avgPriceUp, avgPriceDown: Computed using the calcAvgPrice function for ascending and descending levels, respectively.
Plotting Colors:
User-customizable through input parameters (colorPriceA, colorPriceB, colorPriceC, colorAvgPriceUp, colorPriceX, colorPriceY, colorPriceZ, colorAvgPriceDown).
Styling:
All lines are plotted with minimal thickness (linewidth=1) for a clean visualization.
Overall, the indicator empowers traders to analyze potential support and resistance levels and understand average price movements based on their specified parameters. The flexibility of color customization adds a layer of personalization to suit individual preferences.
[KVA]Donchian Channel Percentage" The 'Donchian Channel Percentage ' (DC%) indicator, developed for TradingView’s Pine Script Version 5, is a unique tool designed to measure the current price’s position within the Donchian Channel. The Donchian Channel, a popular indicator in technical analysis, is defined by the highest high and the lowest low over a user-specified period.
Key Features :
User-Defined Period: Users can customize the lookback period (default 20 periods), allowing flexibility in different trading styles and timeframes.
Channel Calculation: The upper and lower bounds of the Donchian Channel are calculated based on the highest high and lowest low over the chosen period.
Percentage Calculation: DC% quantifies where the current price lies within the channel, presented as a percentage. A value of 0% indicates the price at the channel's low, and 100% signifies the price at the high.
Visualization: The DC% is plotted as a line graph, providing a clear visual representation of the price’s relative position. The indicator includes horizontal lines at 0% and 100%, marked in red and green, respectively, to depict the channel's boundaries.
Market Analysis Tool: DC% offers insights into market trends and potential overbought or oversold conditions, making it a valuable addition for traders who focus on channel-based strategies.
Applications :
The DC% is particularly useful for identifying breakout scenarios and potential reversals.
Traders can use this tool in conjunction with other indicators to enhance their market analysis, especially in strategies that capitalize on price extremes within a defined range.
In summary, the Donchian Channel Percentage offers traders a simple yet powerful tool to gauge the current price’s position within a historical high-low range. Its adaptability across various assets and timeframes makes it a versatile addition to any technical trader’s toolkit."
[KVA]Keltner Channel PercentageThe " Keltner Channel Percentage " (KC%) indicator, designed for TradingView's version 5 language, offers a unique perspective on market volatility and trend analysis, similar yet distinct from the well-known Bollinger Bands Percentage (BB%).
Audience and Applications:
This indicator is suited for traders who prefer a volatility-based approach but seek a smoother, trend-focused alternative to BB%.
It is especially valuable in markets where volatility is not just a byproduct but a central aspect of price dynamics.
In essence, the " Keltner Channel Percentage " stands as a complementary tool to Bollinger Bands Percentage. It offers a different lens through which to view market volatility and trends, providing traders with additional insights and strategies for navigating the financial markets. Its unique combination of simplicity and depth makes it a valuable addition to the technical analyst's toolkit, suitable for a variety of trading scenarios and market conditions.
Logical Trading Indicator V.1Features of the Logical Trading Indicator V.1
ATR-Based Trailing Stop Loss
The Logical Trading Indicator V.1 utilizes the Average True Range (ATR) to implement a dynamic trailing stop loss. You can customize the sensitivity of your alerts by adjusting the ATR Multiple and ATR Period settings.
Higher ATR Multiple values create wider stops, while lower values result in tighter stops. This feature ensures that your trades are protected against adverse price movements. For best practice, use higher values on higher timeframes and lower values on lower term timeframes.
Bollinger Bands
The Logical Trading Indicator V.1 includes Bollinger Bands, which can be customized to use either a Simple Moving Average (SMA) or an Exponential Moving Average (EMA) as the basis.
You can adjust the length and standard deviation multiplier of the Bollinger Bands to fine-tune your strategy. The color of the basis line changes to green when price is above and red when price is below the line to represent the trend.
The bands show a range vs a single band that also represents when the price is in overbought and oversold ranges similar to an RSI. These bands also control the take profit signals.
You also have the ability to change the band colors as well as toggle them off, which only affects the view, they are still active which will still fire the take profit signals.
Momentum Indicator
Our indicator offers a momentum filter option that highlights market momentum directly on the candlesticks, identifying periods of bullish, bearish, or consolidation phases. You can enable or disable this filter as needed, providing valuable insights into market conditions.
By default, you will see the candlestick colors represent the momentum direction as green or red, and consolidation periods as white, but the filter on the BUY and SELL signals is not active. The view options and filter can be toggled on and off in the settings.
Buy and Sell Signals
The Logical Trading Indicator V.1 generates buy and sell signals based on a combination of ATR-based filtering, Bollinger Band basis crossover, and optional momentum conditions if selected in the settings. These signals help you make informed decisions about when to enter or exit a trade. You can also enable a consolidation filter to stay out of trades during tight ranges.
Basically a BUY signal fires when the price closes above the basis line, and the price meets or exceeds the ATR multiple from the previous candle length, which is also editable in the settings.
If the momentum filter is engaged, it will not fire BUY signals when in consolidation periods. It works just the opposite for SELL signals.
Take Profit Signals
We've integrated a Take Profit feature that helps you identify points to exit your trades with profits. The indicator marks Long Take Profit when prices close below the upper zone line of the Bollinger Bands after the previous candle closes inside the band, suggesting an optimal point to exit a long trade or consider a short position.
Conversely, Short Take Profit signals appear when prices close above the lower zone after the previous candle closes inside of it, indicating the right time to exit a short trade or contemplate a long position.
Alerts for Informed Trading
The Logical Trading Indicator V.1 comes equipped with alert conditions for buy signals, sell signals, take profit points, and more. Receive real-time notifications to your preferred devices or platforms to stay updated on market movements and trading opportunities.
OTT CollectionIf you are not yet familiar with OTT, this script could provide an introduction to help you get started.
"Optimized Trend Tracker" (OTT) is an effective trend-following indicator created by Anıl Özekşi . It aims to detect the current trend direction based on an elegant mathematical construct. The key defining characteristic of OTT is its reliance on a trailing-stop mechanism. This enables OTT to identify price movements and follow the price until a reversal occurs. The widespread adoption of OTT in various algo-trading platforms has fostered the development of diverse applications of the indicator over time. Examining its history, eight distinct applications emerge.
1) OTT - Optimized Trend Tracker
2) TOTT - Twin Ott
3) OTT Channel - Half Channel & Fibonacci Channel
4) RISOTTO - Rsi Ott
5) SOTT - Stochastic Ott
6) HOTT & LOTT - Highest-Lowest Ott + Sum Option
7) ROTT - Relative Ott
8) FT - "Fırsatçı" Trend
BONUS: RTR - Relative True Range
Each system functions as an independent indicator and the "OTT Collection" is intended to present all of them in a single script.
ORIGINALITY
Primarily, this script introduces previously unreleased OTT applications on Tradingview (RISOTTO, ROTT, FT). In contrast to previously published examples that treat OTT as a variable, this script portrays OTT as a function, rendering it adaptable for more intricate computations. Consequently, OTT has evolved into a versatile tool capable of facilitating complex analyses. Furthermore, this script offers an innovative feature that permits the blocking of consecutive signals in the same direction, catering to user preferences. (This feature is crucial for all indicators utilizing band structures such as TOTT and HOTT-LOTT).
USAGE
It is simple to use. The settings section of the indicator groups the parameters. In first group, the System parameter allows you to select the OTT system you want to display on the chart. Activating the Pyramiding parameter enables the display of consecutive signals in the same direction (for TOTT and HOTT-LOTT). In the second group you can change the display options with the Barcolor, Signal and Bars parameters. The OTT system you select is configured with the parameters in the group with the corresponding system heading. (For example, suppose you select OTT CHANNEL in the system parameter. The parameters defining the channels are grouped under the heading "OTT CHANNELS" in the settings section.) Also the parameters you chose are displayed in table form on the chart screen. The table also presents the total number of bars on the chart and the number of signals generated by the selected system.
MECHANICS
Let's take a look at how the indicator works. This indicator incorporates eight distinct OTT systems, each characterized by unique parameters, lines, and signals. (Exception: OTT Channel does not include any referenced signals.)
1) WHAT IS "OTT"?
OTT comprises two lines: Support and Target. There's an up-trending market when the Support is superior to the Target, and a down-trending market when the Support is inferior to the Target. It is governed by two parameters. The Support (moving average) is determined by the Length parameter, while the Multiplier parameter is employed for percentage calculations. Lower values are adept at capturing short-term fluctuations, whereas higher values are more adept at identifying long-term trends. These principles apply to all parameters within the indicator.
DETAILED INFO : The OTT function in the script automatically performs the calculation process described in this section. So, if you know how OTT works you can skip the details. To comprehend its functioning, it's essential to grasp the "MOST" indicator, also devised by Anıl Özekşi. The fundamental principle of MOST involves creating bands that function akin to a trailing stop-loss. Initially, a moving average, referred to as the 'Support,' is established. (Anıl Özekşi employs VAR/VIDYA as the moving average type in all his systems.) Subsequently, the Support line is adjusted both upward and downward by a percentage multiplier to establish a band system. In the context of the trailing stop-loss concept, when the Support line approaches either the lower or upper band, the respective band ceases to move in parallel with the Support line and becomes horizontal. Consequently, the Support always intersects the band at some point. The values of the upper or lower bands, determined by this intersection, are referred to as the MOST line. OTT is generated by consolidating the values of MOST shifted upwards and downwards by half the coefficient percentage into a single line using the same method as above, and calculating the value of this line from two bars ago. Support is the data series of OTT and it serves as a source in OTT function. The OTT line is named as "Target" in this scipt. Support and Target will automatically vary according to the OTT application selected in the "System" parameter.
2) WHAT IS "TOTT"?
Twin OTT , also known as the "OTT Band," involves three parameters: Length, Multiplier, and Band Multiplier. It consists of three lines: Support, Upper Line, and Lower Line. OTT is determined by the Length and Multiplier parameters, while TOTT is calculated by adjusting OTT upwards and downwards as per the Band Multiplier parameter. The indicator generates signals based on the intersections of the Support and these two new OTT levels.
3) WHAT IS "OTT CHANNEL"?
Similar to TOTT, the OTT CHANNEL is also based on shifted OTT levels, employing a similar calculation method. The primary distinction lies in the fact that TOTT has a single Band Multiplier, whereas OTT CHANNEL incorporates two line multipliers for the band. It encompasses four parameters: Length, Multiplier, Upper Line Multiplier, and Lower Line Multiplier. OTT is defined by the Length and Multiplier parameters. The Upper Line Multiplier and Lower Line Multiplier parameters establish the channel boundaries by shifting the OTT line. Subsequently, levels are drawn between the upper and lower lines. The additional Channel Type parameter determines which levels are displayed on the chart. The "Half Channel" option draws channels shifted by half the coefficient. The "Fibonacci Channel" option draws channels shifted by 0.382 and 0.618 coefficients. The "Both" option plots all levels.
4) WHAT IS "RISOTTO"?
OTT also has application examples in momentum oscillators. RISOTTO utilizes the RSI indicator and operates with three parameters. The RSI is defined by the Length 1 parameter, while the Support is determined by the Length 2 parameter. The Multiplier parameter is utilized for percentage calculations. RISOTTO comprises two lines: Support and Target. To ensure more stable calculations, a constant (+1000) is added to the oscillator average when applying OTT to momentum oscillators. This approach eradicates nonsensical results stemming from percentage calculations when the oscillator reaches a value of 0. The indicator generates signals based on the intersection of these two lines.
5) WHAT IS "SOTT"?
Stochastic OTT is an another example of application on oscillator. Its working principle is akin to that of RISOTTO. It operates with three parameters. The Stochastic %k is defined by the Length 1 parameter, while the Stochastic %d is determined by the Length 2 parameter. The Multiplier parameter is utilized for percentage calculations. SOTT comprises two lines: Support and Target. The indicator generates signals based on the intersection of these two lines.
6) WHAT IS "HOTT-LOTT"?
OTT can be applied to the highest and lowest series as well. HOTT-LOTT operates with three parameters: Length, Multiplier, and Sum N Bars. The highest and lowest series are defined by the Length parameter. The Multiplier parameter is utilized for percentage calculations. It encompasses two lines: Upper Line and Lower Line, where HOTT employs the highest series and LOTT uses the lowest series. If the 'High' price surpasses HOTT, the indicator generates Long signals. Similarly, if the 'Low' price falls below LOTT, the indicator generates Short signals. When the Sum N Bars option is activated, signals are generated based on the confirmation concept for N bars.
7) WHAT IS "ROTT"?
Relative OTT serves as a valuable tool for long-period filters. ROTT operates with two parameters. The Support is determined by the length parameter and equals twice the moving average. The Multiplier parameter is utilized for percentage calculations. The indicator generates signals based on the intersection of these two lines.
8) WHAT IS "FT"?
"Fırsatçı" (opportunistic) Trend is a system that revolves around two levels, namely major and minor OTT. It operates with three parameters: Length, Major Multiplier, and Minor Multiplier. FT comprises two lines, Support and Target. The indicator generates signals based on the intersection of these two lines.
9) WHAT IS "RTR"?
Relative True Range is not an OTT system; however, it serves as a complementary feature. It does not have any referenced signals. RTR is devised to obtain a normalized result of the current market volatility. It operates with two parameters: ATR, which is determined by the Length 1 parameter, and RTR, defined by the Length 2 parameter.
A TIP
If any indicator is defined in function form instead of the OTT function, the applications can also be adapted for different indicators. E.g. Supertrend, PMAX, AlphaTrend, etc.
UPDATE
Anıl Özekşi is a competent algotrader who shares his work with open sources. I will update the indicator as new applications are released.
DISCLEIMER
This is just an indicator, nothing more. The script is for informational and educational purposes only. The use of the script does not constitute professional and/or financial advice. The responsibility for risks associated with the use of the script is solely owned by the user. Do not forget to manage your risk. And trade as safely as possible. Good luck!
Extended Parallel ChannelsThis indicator provides an enhanced version of the popular Parallel Channel tool by allowing channel boundaries to be extended above and below the primary channel. It can also serve as a general tool for drawing parallel lines and grid lines to aid technical analysis.
🟠 Application
There are two primary ways extended channels can provide valuable insights:
🔵 Support and Resistance Levels
When prices break out of a channel, they often encounter strong resistance at approximately the 100% extension point. Breakout traders can utilize the extended channel boundary to place take-profit orders. Meanwhile, reversal traders can look for entry opportunities at this level.
🔵 Grid / Martingale Trading
Grid Trading and Martingale Trading strategies rely heavily on grid lines. This indicator streamlines that process by enabling traders to effortlessly plot grid lines across the chart.
🟠 Instructions
Upon adding the indicator, the user will be prompted to set the channel boundaries by placing three anchor points on the chart. The first two anchors determine one boundary line, while the third anchor determine the other boundary line.
Once the three anchors are positioned, the indicator automatically plots the resulting channel as well as the extended lines. The anchor points are highlighted as movable blue circles, allowing the user to dynamically adjust the channel formation by dragging the anchors to new locations as needed.
[blackcat] L3 Fibonacci Bands With ATRToday, what I'm going to introduce is a technical indicator that I think is quite in line with the indicator displayed by Tang - Fibonacci Bands with ATR. This indicator combines Bollinger Bands and Average True Range (ATR) to provide insights into market volatility and potential price reversals. Sounds complicated, right? Don't worry, I will explain it to you in the simplest way.
First, let's take a look at how Fibonacci Bands are constructed. They are similar to Bollinger Bands and consist of three lines: upper band, middle band (usually a 20-period simple moving average), and lower band. The difference is that Fibonacci Bands use ATR to calculate the distance between the upper and lower bands and the middle band.
Next is a key factor - ATR multiplier. We need to smooth the ATR using Welles Wilder's method. Then, by multiplying the ATR by a Fibonacci multiplier (e.g., 1.618), we get the upper band, called the upper Fibonacci channel. Similarly, multiplying the ATR by another Fibonacci multiplier (e.g., 0.618 or 1.0) gives us the lower band, called the lower Fibonacci channel.
Now, let's see how Fibonacci Bands can help us assess market volatility. When the channel widens, it means that market volatility is high, while a narrow channel indicates low market volatility. This way, we can determine the market's activity level based on the width of the channel.
In addition, when the price touches or crosses the Fibonacci channel, it may indicate a potential price reversal, similar to Bollinger Bands. Therefore, using Fibonacci Bands in trading can help us capture potential buy or sell signals.
In summary, Fibonacci Bands with ATR is an interesting and practical technical indicator that provides information about market volatility and potential price reversals by combining Bollinger Bands and ATR. Remember, make good use of these indicators and apply them flexibly in trading!
This code is a TradingView indicator script used to plot L3 Fibonacci Bands With ATR.
First, the indicator function is used to define the title and short title of the indicator, and whether it should be overlaid on the main chart.
Then, the input function is used to define three input parameters: MA type (maType), MA length (maLength), and data source (src). There are four options for MA type: SMA, EMA, WMA, and HMA. The default values are SMA, 55, and hl2 respectively.
Next, the moving average line is calculated based on the user's selected MA type. If maType is 'SMA', the ta.sma function is called to calculate the simple moving average; if maType is 'EMA', the ta.ema function is called to calculate the exponential moving average; if maType is 'WMA', the ta.wma function is called to calculate the weighted moving average; if maType is 'HMA', the ta.hma function is called to calculate the Hull moving average. The result is then assigned to the variable ma.
Then, the _atr variable is used to calculate the ATR (Average True Range) value using ta.atr, and multiplied by different coefficients to obtain four Fibonacci bias values: fibo_bias4, fibo_bias3, fibo_bias2, and fibo_bias1.
Finally, the prices of the upper and lower four Fibonacci bands are calculated by adding or subtracting the corresponding Fibonacci bias values from the current price, and plotted on the chart using the plot function.