Economic Profit (YavuzAkbay)The Economic Profit Indicator is a Pine Script™ tool for assessing a company’s economic profit based on key financial metrics like Return on Invested Capital (ROIC) and Weighted Average Cost of Capital (WACC). This indicator is designed to give traders a more accurate understanding of risk-adjusted returns.
Features
Customizable inputs for Risk-Free Rate and Corporate Tax Rate assets for people who are trading in other countries.
Calculates Economic Profit based on ROIC and WACC, with values shown as both plots and in an on-screen table.
Provides detailed breakdowns of all key calculations, enabling deeper insights into financial performance.
How to Use
Open the stock to be analyzed. In the settings, enter the risk-free asset (usually a 10-year bond) of the country where the company to be analyzed is located. Then enter the corporate tax of the country (USCTR for the USA, DECTR for Germany). Then enter the average return of the index the stock is in. I prefer 10% (0.10) for the SP500, different rates can be entered for different indices. Finally, the beta of the stock is entered. In future versions I will automatically pull beta and index returns, but in order to publish the indicator a bit earlier, I have left it entirely up to the investor.
How to Interpret
We see 3 pieces of data on the indicator. The dark blue one is ROIC, the dark orange one is WACC and the light blue line represents the difference between WACC and ROIC.
In a scenario where both ROIC and WACC are negative, if ROIC is lower than WACC, the share is at a complete economic loss.
In a scenario where both ROIC and WACC are negative, if ROIC has started to rise above WACC and is moving towards positive, the share is still in an economic loss but tending towards profit.
A scenario where ROIC is positive and WACC is negative is the most natural scenario for a company. In this scenario, we know that the company is doing well by a gradually increasing ROIC and a stable WACC.
In addition, if the ROIC and WACC difference line goes above 0, the company is now economically in net profit. This is the best scenario for a company.
My own investment strategy as a developer of the code is to look for the moment when ROIC is greater than WACC when ROIC and WACC are negative. At that point the stock is the best time to invest.
Trading is risky, and most traders lose money. The indicators Yavuz Akbay offers are for informational and educational purposes only. All content should be considered hypothetical, selected after the facts to demonstrate my product, and not constructed as financial advice. Decisions to buy, sell, hold, or trade in securities, commodities, and other investments involve risk and are best made based on the advice of qualified financial professionals. Past performance does not guarantee future results.
This indicator is experimental and will always remain experimental. The indicator will be updated by Yavuz Akbay according to market conditions.
อินดิเคเตอร์และกลยุทธ์
MFI Strategy with Oversold Zone Exit and AveragingThis strategy is based on the Money Flow Index (MFI) and aims to enter a long position when the MFI exits an oversold zone, with specific rules for limit orders, stop-loss, and take-profit settings. Here's a detailed breakdown:
Key Components
1. **Money Flow Index (MFI)**: The strategy uses the MFI, a volume-weighted indicator, to gauge whether the market is in an oversold condition (default threshold of MFI < 20). Once the MFI rises above the oversold threshold, it signals a potential buying opportunity.
2. **Limit Order for Long Entry**: Instead of entering immediately after the oversold condition is cleared, the strategy places a limit order at a price slightly below the current price (by a user-defined percentage). This helps achieve a better entry price.
3. **Stop-Loss and Take-Profit**:
- **Stop-Loss**: A stop-loss is set to protect against significant losses, calculated as a percentage below the entry price.
- **Take-Profit**: A take-profit target is set as a percentage above the entry price to lock in gains.
4. **Order Cancellation**: If the limit order isn’t filled within a specific number of bars (default is 5 bars), it’s automatically canceled to avoid being filled at a potentially suboptimal price as market conditions change.
Strategy Workflow
1. **Identify Oversold Zone**: The strategy checks if the MFI falls below a defined oversold level (default is 20). Once this condition is met, the flag `inOversoldZone` is set to `true`.
2. **Wait for Exit from Oversold Zone**: When the MFI rises back above the oversold level, it’s considered a signal that the market is potentially recovering, and the strategy prepares to enter a position.
3. **Place Limit Order**: Upon exiting the oversold zone, the strategy places a limit order for a long position at a price below the current price, defined by the `Long Entry Percentage` parameter.
4. **Monitor Limit Order**: A counter (`barsSinceEntryOrder`) starts counting the bars since the limit order was placed. If the order isn’t filled within the specified number of bars, it’s canceled automatically.
5. **Set Stop-Loss and Take-Profit**: Once the order is filled, a stop-loss and take-profit are set based on user-defined percentages relative to the entry price.
6. **Exit Strategy**: The trade will close automatically when either the stop-loss or take-profit level is hit.
Advantages
- **Risk Management**: With configurable stop-loss and take-profit, the strategy ensures losses are limited while capturing profits at pre-defined levels.
- **Controlled Entry**: The use of a limit order below the current price helps secure a better entry point, enhancing risk-reward.
- **Oversold Exit Trigger**: Using the exit from an oversold zone as an entry condition can help catch reversals.
Disadvantages
- **Missed Entries**: If the limit order isn’t filled due to insufficient downward movement after the oversold signal, potential opportunities may be missed.
- **Dependency on MFI Sensitivity**: As the MFI is sensitive to both price and volume, its fluctuations might not always accurately represent oversold conditions.
Overall Purpose
The strategy is suited for traders who want to capture potential reversals after oversold conditions in the market, with a focus on precise entries, risk management, and an automated exit plan.
Pine Execution MapPine Script Execution Map
Overview:
This is an educational script for Pine Script developers. The script includes data structure, functions/methods, and process to capture and print Pine Script execution map of functions called while pine script execution.
Map of execution is produced for last/latest candle execution.
The script also has example code to call execution map methods and generate Pine Execution map.
Use cases:
Pine script developers can get view of how the functions are called
This can also be used while debugging the code and know which functions are called vs what developer expect code to do
One can use this while using any of the open source published script and understand how public script is organized and how functions of the script are called.
Code components:
User defined type
type EMAP
string group
string sub_group
int level
array emap = array.new()
method called internally by other methods to generate level of function being executed
method id(string tag) =>
if(str.startswith(tag, "MAIN"))
exe_level.set(0, 0)
else if(str.startswith(tag, "END"))
exe_level.set(0, exe_level.get(0) - 1)
else
exe_level.set(0, exe_level.get(0) + 1)
exe_level.get(0)
Method called from main/global scope to record execution of main scope code. There should be only one call to this method at the start of global scope.
method main(string tag) =>
this = EMAP.new()
this.group := "MAIN"
this.sub_group := tag
this.level := "MAIN".id()
emap.push(this)
Method called from main/global scope to record end of execution of main scope code. There should be only one call to this method at the end of global scope.
method end_main(string tag) =>
this = EMAP.new()
this.group := "END_MAIN"
this.sub_group := tag
this.level := 0
emap.push(this)
Method called from start of each function to record execution of function code
method call(string tag) =>
this = EMAP.new()
this.group := "SUB"
this.sub_group := tag
this.level := "SUB".id()
emap.push(this)
Method called from end of each function to record end of execution of function code
method end_call(string tag) =>
this = EMAP.new()
this.group := "END_SUB"
this.sub_group := tag
this.level := "END_SUB".id()
emap.push(this)
Pine code which generates execution map and show it as a label tooltip.
if(barstate.islast)
for rec in emap
if(not str.startswith(rec.group, "END"))
lvl_tab = str.repeat("", rec.level+1, "\t")
txt = str.format("=> {0} {1}> {2}", lvl_tab, rec.level, rec.sub_group)
debug.log(txt)
debug.lastr()
Snapshot 1:
This is the output of the script and can be viewed by hovering mouse pointer over the blue color diamond shaped label
Snapshot 2:
How to read the Pine execution map
Customizable BTC Seasonality StrategyThis strategy leverages intraday seasonality effects in Bitcoin, specifically targeting hours of statistically significant returns during periods when traditional financial markets are closed. Padysak and Vojtko (2022) demonstrate that Bitcoin exhibits higher-than-average returns from 21:00 UTC to 23:00 UTC, a period in which all major global exchanges, such as the New York Stock Exchange (NYSE), Tokyo Stock Exchange, and London Stock Exchange, are closed. The absence of competing trading activity from traditional markets during these hours appears to contribute to these statistically significant returns.
The strategy proceeds as follows:
Entry Time: A long position in Bitcoin is opened at a user-specified time, which defaults to 21:00 UTC, aligning with the beginning of the identified high-return window.
Holding Period: The position is held for two hours, capturing the positive returns typically observed during this period.
Exit Time: The position is closed at a user-defined time, defaulting to 23:00 UTC, allowing the strategy to exit as the favorable period concludes.
This simple seasonality strategy aims to achieve a 33% annualized return with a notably reduced volatility of 20.93% and maximum drawdown of -22.45%. The results suggest that investing only during these high-return hours is more stable and less risky than a passive holding strategy (Padysak & Vojtko, 2022).
References
Padysak, M., & Vojtko, R. (2022). Seasonality, Trend-following, and Mean reversion in Bitcoin.
SuperATR 7-Step Profit - Strategy [presentTrading] Long time no see!
█ Introduction and How It Is Different
The SuperATR 7-Step Profit Strategy is a multi-layered trading approach that integrates adaptive Average True Range (ATR) calculations with momentum-based trend detection. What sets this strategy apart is its sophisticated 7-step take-profit mechanism, which combines four ATR-based exit levels and three fixed percentage levels. This hybrid approach allows traders to dynamically adjust to market volatility while systematically capturing profits in both long and short market positions.
Traditional trading strategies often rely on static indicators or single-layered exit strategies, which may not adapt well to changing market conditions. The SuperATR 7-Step Profit Strategy addresses this limitation by:
- Using Adaptive ATR: Enhances the standard ATR by making it responsive to current market momentum.
- Incorporating Momentum-Based Trend Detection: Identifies stronger trends with higher probability of continuation.
- Employing a Multi-Step Take-Profit System: Allows for gradual profit-taking at predetermined levels, optimizing returns while minimizing risk.
BTCUSD 6hr Performance
█ Strategy, How It Works: Detailed Explanation
The strategy revolves around detecting strong market trends and capitalizing on them using an adaptive ATR and momentum indicators. Below is a detailed breakdown of each component of the strategy.
🔶 1. True Range Calculation with Enhanced Volatility Detection
The True Range (TR) measures market volatility by considering the most significant price movements. The enhanced TR is calculated as:
TR = Max
Where:
High and Low are the current bar's high and low prices.
Previous Close is the closing price of the previous bar.
Abs denotes the absolute value.
Max selects the maximum value among the three calculations.
🔶 2. Momentum Factor Calculation
To make the ATR adaptive, the strategy incorporates a Momentum Factor (MF), which adjusts the ATR based on recent price movements.
Momentum = Close - Close
Stdev_Close = Standard Deviation of Close over n periods
Normalized_Momentum = Momentum / Stdev_Close (if Stdev_Close ≠ 0)
Momentum_Factor = Abs(Normalized_Momentum)
Where:
Close is the current closing price.
n is the momentum_period, a user-defined input (default is 7).
Standard Deviation measures the dispersion of closing prices over n periods.
Abs ensures the momentum factor is always positive.
🔶 3. Adaptive ATR Calculation
The Adaptive ATR (AATR) adjusts the traditional ATR based on the Momentum Factor, making it more responsive during volatile periods and smoother during consolidation.
Short_ATR = SMA(True Range, short_period)
Long_ATR = SMA(True Range, long_period)
Adaptive_ATR = /
Where:
SMA is the Simple Moving Average.
short_period and long_period are user-defined inputs (defaults are 3 and 7, respectively).
🔶 4. Trend Strength Calculation
The strategy quantifies the strength of the trend to filter out weak signals.
Price_Change = Close - Close
ATR_Multiple = Price_Change / Adaptive_ATR (if Adaptive_ATR ≠ 0)
Trend_Strength = SMA(ATR_Multiple, n)
🔶 5. Trend Signal Determination
If (Short_MA > Long_MA) AND (Trend_Strength > Trend_Strength_Threshold):
Trend_Signal = 1 (Strong Uptrend)
Elif (Short_MA < Long_MA) AND (Trend_Strength < -Trend_Strength_Threshold):
Trend_Signal = -1 (Strong Downtrend)
Else:
Trend_Signal = 0 (No Clear Trend)
🔶 6. Trend Confirmation with Price Action
Adaptive_ATR_SMA = SMA(Adaptive_ATR, atr_sma_period)
If (Trend_Signal == 1) AND (Close > Short_MA) AND (Adaptive_ATR > Adaptive_ATR_SMA):
Trend_Confirmed = True
Elif (Trend_Signal == -1) AND (Close < Short_MA) AND (Adaptive_ATR > Adaptive_ATR_SMA):
Trend_Confirmed = True
Else:
Trend_Confirmed = False
Local Performance
🔶 7. Multi-Step Take-Profit Mechanism
The strategy employs a 7-step take-profit system
█ Trade Direction
The SuperATR 7-Step Profit Strategy is designed to work in both long and short market conditions. By identifying strong uptrends and downtrends, it allows traders to capitalize on price movements in either direction.
Long Trades: Initiated when the market shows strong upward momentum and the trend is confirmed.
Short Trades: Initiated when the market exhibits strong downward momentum and the trend is confirmed.
█ Usage
To implement the SuperATR 7-Step Profit Strategy:
1. Configure the Strategy Parameters:
- Adjust the short_period, long_period, and momentum_period to match the desired sensitivity.
- Set the trend_strength_threshold to control how strong a trend must be before acting.
2. Set Up the Multi-Step Take-Profit Levels:
- Define ATR multipliers and fixed percentage levels according to risk tolerance and profit goals.
- Specify the percentage of the position to close at each level.
3. Apply the Strategy to a Chart:
- Use the strategy on instruments and timeframes where it has been tested and optimized.
- Monitor the positions and adjust parameters as needed based on performance.
4. Backtest and Optimize:
- Utilize TradingView's backtesting features to evaluate historical performance.
- Adjust the default settings to optimize for different market conditions.
█ Default Settings
Understanding default settings is crucial for optimal performance.
Short Period (3): Affects the responsiveness of the short-term MA.
Effect: Lower values increase sensitivity but may produce more false signals.
Long Period (7): Determines the trend baseline.
Effect: Higher values reduce noise but may delay signals.
Momentum Period (7): Influences adaptive ATR and trend strength.
Effect: Shorter periods react quicker to price changes.
Trend Strength Threshold (0.5): Filters out weaker trends.
Effect: Higher thresholds yield fewer but stronger signals.
ATR Multipliers: Set distances for ATR-based exits.
Effect: Larger multipliers aim for bigger moves but may reduce hit rate.
Fixed TP Levels (%): Control profit-taking on smaller moves.
Effect: Adjusting these levels affects how quickly profits are realized.
Exit Percentages: Determine how much of the position is closed at each TP level.
Effect: Higher percentages reduce exposure faster, affecting risk and reward.
Adjusting these variables allows you to tailor the strategy to different market conditions and personal risk preferences.
By integrating adaptive indicators and a multi-tiered exit strategy, the SuperATR 7-Step Profit Strategy offers a versatile tool for traders seeking to navigate varying market conditions effectively. Understanding and adjusting the key parameters enables traders to harness the full potential of this strategy.
PDF Smoothed Moving Average [BackQuant]PDF Smoothed Moving Average
Introducing BackQuant’s PDF Smoothed Moving Average (PDF-MA) — an innovative trading indicator that applies Probability Density Function (PDF) weighting to moving averages, creating a unique, trend-following tool that offers adaptive smoothing to price movements. This advanced indicator gives traders an edge by blending PDF-weighted values with conventional moving averages, helping to capture trend shifts with enhanced clarity.
Core Concept: Probability Density Function (PDF) Smoothing
The Probability Density Function (PDF) provides a mathematical approach to applying adaptive weighting to data points based on a specified variance and mean. In the PDF-MA indicator, the PDF function is used to weight price data, adding a layer of probabilistic smoothing that enhances the detection of trend strength while reducing noise.
The PDF weights are controlled by two key parameters:
Variance: Determines the spread of the weights, where higher values spread out the weighting effect, providing broader smoothing.
Mean : Centers the weights around a particular price value, influencing the trend’s directionality and sensitivity.
These PDF weights are applied to each price point over the chosen period, creating an adaptive and smooth moving average that more closely reflects the underlying price trend.
Blending PDF with Standard Moving Averages
To further improve the PDF-MA, this indicator combines the PDF-weighted average with a traditional moving average, selected by the user as either an Exponential Moving Average (EMA) or Simple Moving Average (SMA). This blended approach leverages the strengths of each method: the responsiveness of PDF smoothing and the robustness of conventional moving averages.
Smoothing Method: Traders can choose between EMA and SMA for the additional moving average layer. The EMA is more responsive to recent prices, while the SMA provides a consistent average across the selected period.
Smoothing Period: Controls the length of the lookback period, affecting how sensitive the average is to price changes.
The result is a PDF-MA that provides a reliable trend line, reflecting both the PDF weighting and traditional moving average values, ideal for use in trend-following and momentum-based strategies.
Trend Detection and Candle Coloring
The PDF-MA includes a built-in trend detection feature that dynamically colors candles based on the direction of the smoothed moving average:
Uptrend: When the PDF-MA value is increasing, the trend is considered bullish, and candles are colored green, indicating potential buying conditions.
Downtrend: When the PDF-MA value is decreasing, the trend is considered bearish, and candles are colored red, signaling potential selling or shorting conditions.
These color-coded candles provide a quick visual reference for the trend direction, helping traders make real-time decisions based on the current market trend.
Customization and Visualization Options
This indicator offers a range of customization options, allowing traders to tailor it to their specific preferences and trading environment:
Price Source : Choose the price data for calculation, with options like close, open, high, low, or HLC3.
Variance and Mean : Fine-tune the PDF weighting parameters to control the indicator’s sensitivity and responsiveness to price data.
Smoothing Method : Select either EMA or SMA to customize the conventional moving average layer used in conjunction with the PDF.
Smoothing Period : Set the lookback period for the moving average, with a longer period providing more stability and a shorter period offering greater sensitivity.
Candle Coloring : Enable or disable candle coloring based on trend direction, providing additional clarity in identifying bullish and bearish phases.
Trading Applications
The PDF Smoothed Moving Average can be applied across various trading strategies and timeframes:
Trend Following : By smoothing price data with PDF weighting, this indicator helps traders identify long-term trends while filtering out short-term noise.
Reversal Trading : The PDF-MA’s trend coloring feature can help pinpoint potential reversal points by showing shifts in the trend direction, allowing traders to enter or exit positions at optimal moments.
Swing Trading : The PDF-MA provides a clear trend line that swing traders can use to capture intermediate price moves, following the trend direction until it shifts.
Final Thoughts
The PDF Smoothed Moving Average is a highly adaptable indicator that combines probabilistic smoothing with traditional moving averages, providing a nuanced view of market trends. By integrating PDF-based weighting with the flexibility of EMA or SMA smoothing, this indicator offers traders an advanced tool for trend analysis that adapts to changing market conditions with reduced lag and increased accuracy.
Whether you’re trading trends, reversals, or swings, the PDF-MA offers valuable insights into the direction and strength of price movements, making it a versatile addition to any trading strategy.
FS Scorpion TailKey Features & Components:
1. Custom Date & Chart-Based Controls
The software allows users to define whether they want signals to start on a specific date (useSpecificDate) or base calculations on the visible chart’s range (useRelativeScreenSumLeft and useRelativeScreenSumRight).
Users can input the number of stocks to buy/sell per signal and decide whether to sell only for profit.
2. Technical Indicators Used
EMA (Exponential Moving Average): Users can define the length of the EMA and specify if buy/sell signals should occur when the EMA is rising or falling.
MACD (Moving Average Convergence Divergence): MACD crossovers, slopes of the MACD line, signal line, and histogram are used for generating buy/sell signals.
ATR (Average True Range): Signals are generated based on rising or falling ATR.
Aroon Indicator: Buy and sell signals are based on the behavior of the Aroon upper and lower lines.
RSI (Relative Strength Index): Tracks whether the RSI and its moving average are rising or falling to generate signals.
Bollinger Bands: Buy/sell signals depend on the basis, upper, and lower band behavior (rising or falling).
3. Signal Detection
The software creates arrays for each indicator to store conditions for buy/sell signals.
The allTrue() function checks whether all conditions for buy/sell signals are true, ensuring that only valid signals are plotted.
Signals are differentiated between buy-only, sell-only, and both buy and sell (dual signal).
4. Visual Indicators
Vertical Lines: When buy, sell, or dual signals are detected, vertical lines are drawn at the corresponding bar with configurable colors (green for buy, red for sell, silver for dual).
Buy/Sell Labels: Visual labels are plotted directly on the chart to denote buy or sell signals, allowing for clear interpretation of the strategy.
5. Cash Flow & Metrics Display
The software maintains an internal ledger of how many stocks are bought/sold, their prices, and whether a profit is being made.
A table is displayed at the bottom right of the chart, showing:
Initial investment
Current stocks owned
Last buy price
Market stake
Net profit
The table background turns green for profit and red for loss.
6. Dynamic Decision Making
Buy Condition: If a valid buy signal is generated, the software decrements the cash balance and adds stocks to the inventory.
Sell Condition: If the sell signal is valid (and meets the profit requirement), stocks are sold, and cash is incremented.
A fallback check ensures the sell logic prevents selling more stocks than are available and adjusts stock holding appropriately (e.g., sell half).
Customization and Usage
Indicator Adjustments: The user can choose which indicators to activate (e.g., EMA, MACD, RSI) via input controls. Each indicator has specific customizable parameters such as lengths, slopes, and conditions.
Signal Flexibility: The user can adjust conditions for buying and selling based on various technical indicators, which adds flexibility in implementing trading strategies. For example, users may require the RSI to be higher than its moving average or trigger sales only when MACD crosses under the signal line.
Profit Sensitivity: The software allows the option to sell only when a profit is assured by checking if the current price is higher than the last buy price.
Summary of Usage:
Indicator Selection: Enable or disable technical indicators like EMA, MACD, RSI, Aroon, ATR, and Bollinger Bands to fit your trading strategy.
Custom Date/Chart Settings: Choose whether to calculate based on specific time ranges or visible portions of the chart.
Dynamic Signal Plotting: Once buy or sell conditions are met, the software will visually plot signals on your chart, giving clear entry and exit points.
Investment Tracking: Real-time tracking of stock quantities, investments, and profit ensures a clear view of your trading performance.
Backtesting: Use this software for backtesting your strategy by analyzing how buy and sell signals would have performed historically based on the chosen indicators.
Conclusion
The FS Scorpion Tail software is a robust and flexible trading tool, allowing traders to develop custom strategies based on multiple well-known technical indicators. Its visual aid, coupled with real-time investment tracking, makes it valuable for systematic traders looking to automate or refine their trading approach.
Mean Trend OscillatorMean Trend Oscillator
The Mean Trend Oscillator offers an original approach to trend analysis by integrating multiple technical indicators, using statistic to get a probable signal, and dynamically adapting to market volatility.
This tool aggregates signals from four popular indicators—Relative Strength Index (RSI), Simple Moving Average (SMA), Exponential Moving Average (EMA), and Relative Moving Average (RMA)—and adjusts thresholds using the Average True Range (ATR). By using this, we can use Statistics to aggregate or take the average of each indicators signal. Mathematically, Taking an average of these indicators gives us a better probability on entering a trending state.
By consolidating these distinct perspectives, the Mean Trend Oscillator provides a comprehensive view of market direction, helping traders make informed decisions based on a broad, data-driven trend assessment. Traders can use this indicator to enter long spot or leveraged positions. The Mean Trend Oscillator is intended to be use in long term trending markets. Scalping MUST NOT be used with this indicator. (This indicator will give false signals when the Timeframe is too low. The best intended use for high-quality signals are longer timeframes).
The current price of a beginning trend series may tell us something about the next move. Thus, the Mean Trend Oscillator allows us to spot a high probability trending market and potentially exploit this information enter long or shorts strategy. (again, this indicator will give false signals when the Timeframe is too low. The best intended use for high-quality signals are longer timeframes).
Concept and Calculation and Inputs
The Mean Trend Oscillator calculates a “net trend” score as follows:
RSI evaluates market momentum, identifying overbought and oversold conditions, essential for confirming trend direction.
SMA, EMA, and RMA introduce varied smoothing methods to capture short- to medium-term trends, balancing quick price changes with smoothed averages.
ATR-Enhanced Thresholds: ATR is used as a dynamic multiplier, adjusting each indicator’s thresholds to current volatility levels, which helps reduce noise in low-volatility conditions and emphasizes significant signals when volatility spikes.
Length could be used to adjust how quickly each indicator can more or how slower each indicator can be.
Time Coherency for Inputs: Each indicator must be calculated where each signal is relatively around the same area.
For example:
Simply:
SMA, RMA, EMA, and RSI enters long around each intended trend period. Doesn't have to be perfect, but the indicators all enter long around there.
Each indicator contributes a score (+1 for bullish and -1 for bearish), and these scores are averaged to generate the final trend score:
A positive score, shown as a green line, suggests bullish conditions.
A negative score, indicated by a red line, signifies bearish conditions.
Thus, giving us a signal to long or short.
How to Use the Mean Trend Oscillator
This indicator’s output is straightforward and can fit into various trading strategies:
Bullish Signal: A green line shows that the trend is bullish, based on a positive average score across the indicators, signaling a consideration of longing an asset.
Bearish Signal: A red line indicates bearish conditions, with an overall negative trend score, signaling a consideration to shorting an asset.
By aggregating these indicators, the Mean Trend Oscillator helps traders identify strong trends while filtering out minor fluctuations, making it a versatile tool for both short- and long-term analysis. This multi-layered, adaptive approach to trend detection sets it apart from traditional single-indicator trend tools.
MCD - Meme Coin Dominance [Da_Prof]I took the meme coins in the top 100 according to CoinMarketCap and added their market caps together and divided by TOTAL. Ultimately, I see Tradingview doing a much better job once they create a dedicated symbol for this, but in the interim, I thought this might help all you degens.
Enjoy.
Da_Prof
Alpine Predictive BandsAlpine Predictive Bands - ADX & Trend Projection is an advanced indicator crafted to estimate potential price zones and trend strength by integrating dynamic support/resistance bands, ADX-based confidence scoring, and linear regression-based price projections. Designed for adaptive trend analysis, this tool combines multi-timeframe ADX insights, volume metrics, and trend alignment for improved confidence in trend direction and reliability.
Key Calculations and Components:
Linear Regression for Price Projection:
Purpose: Provides a trend-based projection line to illustrate potential price direction.
Calculation: The Linear Regression Centerline (LRC) is calculated over a user-defined lookbackPeriod. The slope, representing the rate of price movement, is extended forward using predictionLength. This projected path only appears when the confidence score is 70% or higher, revealing a white dotted line to highlight high-confidence trends.
Adaptive Prediction Bands:
Purpose: ATR-based bands offer dynamic support/resistance zones by adjusting to volatility.
Calculation: Bands are calculated using the Average True Range (ATR) over the lookbackPeriod, multiplied by a volatilityMultiplier to adjust the width. These shaded bands expand during higher volatility, guiding traders in identifying flexible support/resistance zones.
Confidence Score (ADX, Volume, and Trend Alignment):
Purpose: Reflects the reliability of trend projections by combining ADX, volume status, and EMA alignment across multiple timeframes.
ADX Component: ADX values from the current timeframe and two higher timeframes assess trend strength on a broader scale. Strong ADX readings across timeframes boost the confidence score.
Volume Component: Volume strength is marked as “High” or “Low” based on a moving average, signaling trend participation.
Trend Alignment: EMA alignment across timeframes indicates “Bullish” or “Bearish” trends, confirming overall trend direction.
Calculation: ADX, volume, and trend alignment integrate to produce a confidence score from 0% to 100%. When the score exceeds 70%, the white projection line is activated, underscoring high-confidence trend continuations.
User Guide
Projection Line: The white dotted line, which appears only when the confidence score is 70% or higher, highlights a high-confidence trend.
Prediction Bands: Adaptive bands provide potential support/resistance zones, expanding with market volatility to help traders visualize price ranges.
Confidence Score: A high score indicates a stronger, more reliable trend and can support trend-following strategies.
Settings
Prediction Length: Determines the forward length of the projection.
Lookback Period: Sets the data range for calculating regression and ATR.
Volatility Multiplier: Adjusts the width of bands to match volatility levels.
Disclaimer: This indicator is for educational purposes and does not guarantee future price outcomes. Additional analysis is recommended, as trading carries inherent risks.
MACD Cloud with Moving Average and ATR BandsThe algorithm implements a technical analysis indicator that combines the MACD Cloud, Moving Averages (MA), and volatility bands (ATR) to provide signals on market trends and potential reversal points. It is divided into several sections:
🎨 Color Bars:
Activated based on user input.
Controls bar color display according to price relative to ATR levels and moving average (MA).
Logic:
⚫ Black: Potential bearish reversal (price above the upper ATR band).
🔵 Blue: Potential bullish reversal (price below the lower ATR band).
o
🟢 Green: Bullish trend (price between the MA and upper ATR band).
o
🔴 Red: Bearish trend (price between the lower ATR band and MA).
o
📊 MACD Bars:
Description:
The MACD Bars section is activated by default and can be modified based on user input.
🔴 Red: Indicates a bearish trend, shown when the MACD line is below the Signal line (Signal line is a moving average of MACD).
🔵 Blue: Indicates a bullish trend, shown when the MACD line is above the Signal line.
Matching colors between MACD Bars and MACD Cloud visually confirms trend direction.
MACD Cloud Logic: The MACD Cloud is based on Moving Average Convergence Divergence (MACD), a momentum indicator showing the relationship between two moving averages of price.
MACD and Signal Lines: The cloud visualizes the MACD line relative to the Signal line. If the MACD line is above the Signal line, it indicates a potential bullish trend, while below it suggests a potential bearish trend.
☁️ MA Cloud:
The MA Cloud uses three moving averages to analyze price direction:
Moving Average Relationship: Three MAs of different periods are plotted. The cloud turns green when the shorter MA is above the longer MA, indicating an uptrend, and red when below, suggesting a downtrend.
Trend Visualization: This graphical representation shows the trend direction.
📉 ATR Bands:
The ATR bands calculate overbought and oversold limits using a weighted moving average (WMA) and ATR.
Center (matr): Shows general trend; prices above suggest an uptrend, while below indicate a downtrend.
Up ATR 1: Marks the first overbought level, suggesting a potential bearish reversal if the price moves above this band.
Down ATR 1: Marks the first oversold level, suggesting a possible bullish reversal if the price moves below this band.
Up ATR 2: Extends the overbought range to an extreme, reinforcing the possibility of a bearish reversal at this level.
Down ATR 2: Extends the oversold range to an extreme, indicating a stronger bullish reversal possibility if price reaches here.
Español:
El algoritmo implementa un indicador de análisis técnico que combina la nube MACD, promedios móviles (MA) y bandas de volatilidad (ATR) para proporcionar señales sobre tendencias del mercado y posibles puntos de reversión. Se divide en varias secciones:
🎨 Barras de Color:
- Activado según la entrada del usuario.
- Controla la visualización del color de las barras según el precio en relación con los niveles de ATR y el promedio móvil (MA).
- **Lógica:**
- ⚫ **Negro**: Reversión bajista potencial (precio por encima de la banda superior ATR).
- 🔵 **Azul**: Reversión alcista potencial (precio por debajo de la banda inferior ATR).
- 🟢 **Verde**: Tendencia alcista (precio entre el MA y la banda superior ATR).
- 🔴 **Rojo**: Tendencia bajista (precio entre la banda inferior ATR y el MA).
### 📊 Barras MACD:
- **Descripción**:
- La sección de barras MACD se activa por defecto y puede modificarse según la entrada del usuario.
- 🔴 **Rojo**: Indica una tendencia bajista, cuando la línea MACD está por debajo de la línea de señal (la línea de señal es una media móvil de la MACD).
- 🔵 **Azul**: Indica una tendencia alcista, cuando la línea MACD está por encima de la línea de señal.
- La coincidencia de colores entre las barras MACD y la nube MACD confirma visualmente la dirección de la tendencia.
### 🌥️ Nube MACD:
- **Lógica de la Nube MACD**: Basada en el indicador de convergencia-divergencia de medias móviles (MACD), que muestra la relación entre dos medias móviles del precio.
- **Líneas MACD y de Señal**: La nube visualiza la relación entre la línea MACD y la línea de señal. Si la línea MACD está por encima de la de señal, indica una tendencia alcista potencial; si está por debajo, sugiere una tendencia bajista.
### ☁️ Nube MA:
- **Relación entre Medias Móviles**: Se trazan tres medias móviles de diferentes períodos. La nube se vuelve verde cuando la media más corta está por encima de la más larga, indicando una tendencia alcista, y roja cuando está por debajo, sugiriendo una tendencia bajista.
- **Visualización de Tendencias**: Proporciona una representación gráfica de la dirección de la tendencia.
### 📉 Bandas ATR:
- Las bandas ATR calculan límites de sobrecompra y sobreventa usando una media ponderada y el ATR.
- **Centro (matr)**: Muestra la tendencia general; precios por encima indican tendencia alcista y debajo, bajista.
- **Up ATR 1**: Marca el primer nivel de sobrecompra, sugiriendo una reversión bajista potencial si el precio sube por encima de esta banda.
- **Down ATR 1**: Marca el primer nivel de sobreventa, sugiriendo una reversión alcista potencial si el precio baja por debajo de esta banda.
- **Up ATR 2**: Amplía el rango de sobrecompra a un nivel extremo, reforzando la posibilidad de reversión bajista.
- **Down ATR 2**: Extiende el rango de sobreventa a un nivel extremo, sugiriendo una reversión alcista más fuerte si el precio alcanza esta banda.
Austin's Apex AcceleratorIndicator Name: Austin’s Apex Accelerator
Overview
The Austin’s Apex Accelerator is a highly aggressive trading indicator designed specifically for high-frequency Forex trading. It combines several technical analysis tools to identify rapid entry and exit points, making it well-suited for intraday or even lower timeframe trades. The indicator leverages a combination of exponential moving averages (EMAs), Bollinger Bands, volume filters, and volatility-adjusted ranges to detect breakout opportunities and manage risk with precision.
Core Components
Fast and Slow EMAs: The two EMAs act as trend and momentum indicators. When the shorter EMA crosses the longer EMA, it signals a change in momentum. The crossover of these EMAs often indicates a potential entry point, especially when combined with volume and volatility filters.
ATR-Based Range Filter: Using the Average True Range (ATR) for dynamic range calculation, the indicator adapts to market volatility. Higher ATR values widen the range, helping the indicator adjust for volatile conditions.
Volume Filter: A volume condition ensures that buy and sell signals only trigger when there’s significant market interest, reducing the likelihood of false signals in low-liquidity environments.
Bollinger Bands: The Bollinger Bands provide additional context for potential overbought or oversold conditions, highlighting opportunities for price reversals or trend continuations.
Key Features
Aggressive Buy and Sell Signals:
Buy Signal: A buy signal is generated when the fast EMA crosses above the slow EMA, confirming bullish momentum, and the volume condition is met. If the price is also near the lower Bollinger Band, it adds further confirmation of an oversold condition.
Sell Signal: A sell signal is generated when the fast EMA crosses below the slow EMA, confirming bearish momentum, with sufficient trading volume. If the price is near the upper Bollinger Band, it signals a potential overbought condition, which supports the sell signal.
Dynamic Range with ATR:
The indicator uses a volatility-based range, derived from the ATR, to adjust the signal sensitivity based on recent price fluctuations. This dynamic range ensures that signals are responsive in both high and low volatility conditions.
The range’s upper and lower bands act as thresholds, with trades often occurring when the price breaches these levels, signaling momentum shifts or trend reversals.
Trend Background Color:
A green background highlights bullish trends when the fast EMA is above the slow EMA.
A red background signifies bearish trends when the fast EMA is below the slow EMA, providing a visual indication of the overall market trend direction.
Trend Line:
The indicator plots a dynamic trend line that changes color based on the price's relationship to the EMAs, helping traders quickly assess the current trend’s strength and direction.
Alerts:
The indicator includes configurable alerts for buy and sell signals, allowing traders to be notified of entry opportunities without needing to monitor the chart continuously.
How to Use Austin’s Apex Accelerator
Identify Entry Points:
Buy Entry: When the fast EMA crosses above the slow EMA, a buy signal is triggered. Confirm this signal by checking if the price is near or below the lower Bollinger Band (indicating an oversold condition) and if trading volume meets the set threshold.
Sell Entry: When the fast EMA crosses below the slow EMA, a sell signal is triggered. Confirm the signal by ensuring the price is near or above the upper Bollinger Band (suggesting an overbought condition) and that volume is sufficient.
Exit Strategy:
Take Profit: The take profit level is calculated as 1.5 times the ATR from the entry point. This ensures that each trade aims to achieve a positive risk/reward ratio.
Stop Loss: The stop loss is set at 1 ATR from the entry, providing a tight risk control mechanism that limits potential losses on each trade.
Trend Identification and Background Colors:
Use the background colors to assess the trend direction. A green background indicates a bullish trend, while a red background suggests a bearish trend. These colors can help you filter signals that go against the trend, increasing the chances of a successful trade.
Volume Confirmation:
This indicator has an inbuilt volume filter to prevent trading in low-volume conditions. Look for signals only when volume exceeds the average volume threshold, which is set by the multiplier. This helps avoid trading during quieter times when false signals are more likely.
Alerts:
Set up alerts for buy and sell signals to be notified in real-time whenever a new trading opportunity arises, so you can act on high-quality signals promptly.
Practical Tips for Using Austin’s Apex Accelerator
Timeframe: Best suited for short timeframes such as 5-minute or 15-minute charts for high-frequency trading.
CustomAlertLibLibrary "CustomAlertLib"
Custom alert formatting library
customAlert(format, message, freq)
Formats and triggers custom alerts with placeholders
Parameters:
format (string) : String containing the alert format template
message (string) : String containing the alert message
freq (simple string) : (optional) Alert frequency as string, defaults to "once_per_bar_close"
Returns: void
BTC Dominance Trend CheckerThis monitors the Bitcoin dominance (BTC.D) in the market. It retrieves the current and previous day's BTC dominance values, determines whether dominance is increasing or decreasing, and visually displays the trend.
Valid Pullbacks and Trend by kpt. GonzoThis script helps identify valid pullbacks. Based on the marked pullbacks, it can draw both internal and external structure trendlines.
A pullback is marked with a small triangle above or below the candle that created the local high or low.
A new local high is marked with a red triangle above the candle if at least one subsequent candle has a low lower than the low of the candle that created the new local high.
A new local low is marked with a green triangle below the candle if at least one subsequent candle has a high higher than the high of the candle that created the new local low.
Based on the marked local highs and lows, the internal structure trendline is created by simply connecting all highs and lows with a line.
The external structure is drawn in a similar way, but only highs and lows that have broken the previous structure are connected. This helps focus on important pivots and better understand the market structure.
Performance Summary and Shading (Offset Version)Modified "Recession and Crisis Shading" Indicator by @haribotagada (Original Link: )
The updated indicator accepts a days offset (positive or negative) to calculate performance between the offset date and the input date.
Potential uses include identifying performance one week after company earnings or an FOMC meeting.
This feature simplifies input by enabling standardized offset dates, while still allowing flexibility to adjust ranges by overriding inputs as needed.
Summary of added features and indicator notes:
Inputs both positive and negative offset.
By default, the script calculates performance from the close of the input date to the close of the date at (input date + offset) for positive offsets, and from the close of (input date - offset) to the close of the input date for negative offsets. For example, with an input date of November 1, 2024, an offset of 7 calculates performance from the close on November 1 to the close on November 8, while an offset of -7 calculates from the close on October 25 to the close on November 1.
Allows user to perform the calculation using the open price on the input date instead of close price
The input format has been modified to allow overrides for the default duration, while retaining the original capabilities of the indicator.
The calculation shows both the average change and the average annualized change. For bar-wise calculations, annualization assumes 252 trading days per year. For date-wise calculations, it assumes 365 days for annualization.
Carries over all previous inputs to retain functionality of the previous script. Changes a few small settings:
Calculates start to end date performance by default instead of peak to trough performance.
Updates visuals of label text to make it easier to read and less transparent.
Changed stat box color scheme to make the text easier to read
Updated default input data to new format of input with offsets
Changed default duration statistic to number of days instead of number of bars with an option to select number of bars.
Potential Features to Add:
Import dataset from CSV files or by plugging into TradingView calendar
Example Input Datasets:
Recessions:
2020-02-01,COVID-19,59
2007-12-01,Subprime mortgages,547
2001-03-01,Dot-com,243
1990-07-01,Oil shock,243
1981-07-01,US unemployment,788
1980-01-01,Volker,182
1973-11-01,OPEC,485
Japan Revolving Door Elections
2006-09-26, Shinzo Abe
2007-09-26, Yasuo Fukuda
2008-09-24, Taro Aso
2009-09-16, Yukio Hatoyama
2010-07-08, Naoto Kan
2011-09-02, Yoshihiko Noda
Hope you find the modified indicator useful and let me know if you would like any features to be added!
Weekly RSI Buy/Sell SignalsWeekly RSI Buy/Sell Signal Indicator
This indicator is designed to help traders identify high-probability buy and sell opportunities on the weekly chart by using the Relative Strength Index (RSI). By utilizing weekly RSI values, this indicator ensures signals align with broader market trends, providing a clearer view of potential price reversals and continuation.
How It Works:
Weekly RSI Calculation: This script calculates the RSI using a 14-period setting, focusing on the weekly timeframe regardless of the user’s current chart view. The weekly RSI is derived using request.security, allowing for consistent signals even on intraday charts.
Signal Conditions:
Buy Signal: A buy signal appears when the RSI crosses above the oversold threshold of 30, suggesting that price may be gaining momentum after a potential bottom.
Sell Signal: A sell signal triggers when the RSI crosses below the overbought threshold of 70, indicating a possible momentum shift downwards.
Visual Cues:
Buy/Sell Markers: Clear green "BUY" and red "SELL" markers are displayed on the chart when buy or sell conditions are met, making it easy to identify entry and exit points.
RSI Line and Thresholds: The weekly RSI value is plotted in real time with color-coded horizontal lines at 30 (oversold) and 70 (overbought), providing a visual reference for key levels.
This indicator is ideal for traders looking for reliable, trend-based signals on higher timeframes and can be a helpful tool for filtering out shorter-term market noise.
Volume StatsDescription:
Volume Stats displays volume data and statistics for every day of the year, and is designed to work on "1D" timeframe. The data is displayed in a table with columns being months of the year, and rows being days of each month. By default, latest data is displayed, but you have an option to switch to data of the previous year as well.
The statistics displayed for each day is:
- volume
- % of total yearly volume
- % of total monthly volume
The statistics displayed for each column (month) is:
- monthly volume
- % of total yearly volume
- sentiment (was there more bullish or bearish volume?)
- min volume (on which day of the month was the min volume)
- max volume (on which day of the month was the max volume)
The cells change their colors depending on whether the volume is bullish or bearish, and what % of total volume the current cell has (either yearly or monthly). The header cells also change their color (based either on sentiment or what % of yearly volume the current month has).
This is the first (and free) version of the indicator, and I'm planning to create a "PRO" version of this indicator in future.
Parameters:
- Timezone
- Cell data -> which data to display in the cells (no data, volume or percentage)
- Highlight min and max volume -> if checked, cells with min and max volume (either monthly or yearly) will be highlighted with a dot or letter (depending on the "Cell data" input)
- Cell stats mode -> which data to use for color and % calculation (All data = yearly, Column = monthly)
- Display data from previous year -> if checked, the data from previous year will be used
- Header color is calculated from -> either sentiment or % of the yearly volume
- Reverse theme -> the table colors are automatically changed based on the "Dark mode" of Tradingview, this checkbox reverses the logic (so that darker colors will be used when "Dark mode" is off, and lighter colors when it's on)
- Hide logo -> hides the cat logo (PLEASE DO NOT HIDE THE CAT)
Conclusion:
Let me know what you think of the indicator. As I said, I'm planning to make a PRO version with more features, for which I already have some ideas, but if you have any suggestions, please let me know.
Immediate Rebalance ICT [TradingFinder] No Imbalances - MTF Gaps🔵 Introduction
The concept of "Immediate Rebalance" in technical analysis is a powerful and advanced strategy within the ICT (Inner Circle Trader) framework, widely used to identify key market levels.
Unlike the "Fair Value Gap," which leaves a price gap requiring a retracement for a fill, an Immediate Rebalance fills the gap immediately, representing an instant balance that strengthens the prevailing market trend. This structure allows traders to quickly spot critical price zones, capitalizing on strong trend continuations without the need for price retracement.
The "Immediate Rebalance ICT" indicator leverages this concept, providing traders with automated identification of critical supply and demand zones, order blocks, liquidity voids, and key buy-side and sell-side liquidity levels.
Through features like crucial liquidity points and immediate rebalancing areas, this tool enables traders to perform precise real-time market analysis and seize profitable opportunities.
🔵 How to Use
The Immediate Rebalance indicator assists traders in identifying reliable trading signals by detecting and analyzing Immediate Rebalance zones. By focusing on supply and demand areas, the indicator pinpoints optimal entry and exit positions.
Here’s how to use the indicator in both bearish (Supply Immediate Rebalance) and bullish (Demand Immediate Rebalance) structures :
🟣 Bullish Structure (Demand Immediate Rebalance)
In a bullish scenario, the indicator detects a Demand Immediate Rebalance formed by two consecutive bullish candles with overlapping wicks. This structure signifies an immediate demand zone, where price instantly balances within the zone, reducing the likelihood of a revisit and indicating potential upside momentum.
Zone Identification : Look for two consecutive bullish candles with overlapping wicks, forming a demand zone. This structure, due to its rapid balance, usually does not require a revisit and supports further upward movement.
Entry and Exit Levels : If price revisits this zone, percentage markers, particularly 50% and 75%, act as supportive levels, creating ideal entry points for long positions.
Example : In the second image, an example of a Demand Immediate Rebalance is shown, where overlapping bullish candle shadows indicate immediate balance, supporting the continuation of the bullish trend.
🟣 Bearish Structure (Supply Immediate Rebalance)
In a bearish setup, the indicator identifies a Supply Immediate Rebalance when two consecutive bearish candles with overlapping wicks appear. This formation signals an immediate supply zone, suggesting a high probability of trend continuation to the downside, with minimal expectation for price to retrace back to this area.
Zone Identificatio n: Look for two consecutive bearish candles with overlapping shadows. This structure forms a supply area where price is expected to continue its downtrend without revisiting the zone.
Entry and Exit Level s: Should price revisit this zone, percentage-based levels (e.g., 50% and 75%) serve as potential resistance points, optimizing entry for short positions, especially if the downtrend is expected to persist.
Example : The attached chart illustrates a Supply Immediate Rebalance, where overlapping candle shadows define this area, reassuring traders of a continued downward trend with a low likelihood of price returning to this zone.
🔵 Settings
ImmR Filter : This filter allows users to adjust the detection of Immediate Rebalance zones in four modes, from "Very Aggressive" to "Very Defensive," based on zone width. The chosen mode controls the sensitivity of Immediate Rebalance detection, allowing users to fine-tune the indicator to their trading style.
Multi Time Frame : Enabling this option allows users to set the indicator to a specific timeframe (1 minute, 5 minutes, 15 minutes, 30 minutes, 1 hour, 4 hours, daily, weekly, or monthly), broadening the perspective for identifying Immediate Rebalance zones across multiple timeframes.
🔵 Conclusion
The Immediate Rebalance indicator, based on rapid balancing zones within supply and demand areas, serves as a powerful tool for market analysis and improving trade decision-making.
By accurately identifying zones where price achieves instant balance without gaps, the indicator highlights areas likely to support strong trend continuations, exempt from common retracements.
The indicator’s use of percentage levels enables traders to pinpoint optimal entry and exit points more effectively, with levels like 50% and 75% acting as support within demand zones and resistance within supply zones. This empowers traders to ride strong trends without the worry of abrupt reversals.
Overall, the Immediate Rebalance is a reliable tool for both professional and beginner traders seeking precise methods to recognize supply and demand zones, capitalizing on consistent trends.
By choosing appropriate settings and focusing on the zones highlighted by this indicator, traders can enter trades with greater confidence and improve their risk management.
Patrick [TFO]This Patrick indicator was made for the 1 year anniversary of my Spongebob indicator, which was an experiment in using the polyline features of Pine Script to draw complex subjects. This indicator was made with the same methodology, with some helper functions to make things a bit easier on myself. It's sole purpose is to display a picture of Patrick Star on your chart, particularly the "I have $3" meme.
The initial Spongebob indicator included more than 1300 lines of code, as there were several more shapes to account for compared to Patrick, however it was done rather inefficiently. I essentially used an anchor point for each "layer" or shape (eye, nose, mouth, etc.), and drew from that point. This resulted in a ton of trial and error as I had to be very careful about the anchor points for each and every layer, and then draw around that point. In this indicator, however, I gave myself a frame to work with by specifying fixed bounds that you'll see in the code: LEFT, RIGHT, TOP, and BOTTOM.
var y_size = 4
atr = ta.atr(50)
LEFT = bar_index + 10
RIGHT = LEFT + 200
TOP = open + atr * y_size
BOTTOM = open - atr * y_size
You may notice that the top and bottom scale with the atr, or Average True Range to account for varying price fluctuations on different assets.
With these limits established, I could write some simple functions to translate my coordinates, using a range of 0-100 to describe how far the X coordinates should be from left to right, where left is 0 and right is 100; and likewise how far the Y coordinates should be from bottom to top, where bottom is 0 and top is 100.
X(float P) =>
result = LEFT + math.floor((RIGHT - LEFT)*P/100)
Y(float P) =>
result = BOTTOM + (TOP - BOTTOM)*P/100
With these functions, I could then start drawing points much simpler, with respect to the overall frame of the picture. If I wanted a point in the dead center of the frame, I would choose X(50), Y(50) for example.
At this point, the process just became tediously drawing each layer of my reference picture, including but not limited to Patrick's body, arm, mouth, eyes, eyebrows, etc. I've attached the reference picture here (left), without the text enabled.
As tedious as this was to create, it was done much more efficiently than Spongebob, and the ideas used here will make it much easier to draw more complex subjects in the future.
DSL Strategy [DailyPanda]
Overview
The DSL Strategy by DailyPanda is a trading strategy that synergistically combines the idea from indicators to create a more robust and reliable trading tool. By integrating these indicators, the strategy enhances signal accuracy and provides traders with a comprehensive view of market trends and momentum shifts. This combination allows for better entry and exit points, improved risk management, and adaptability to various market conditions.
Combining ideas from indicators adds value by:
Enhancing Signal Confirmation : The strategy requires alignment between trend and momentum before generating trade signals, reducing false entries.
Improving Accuracy : By integrating price action with momentum analysis, the strategy captures more reliable trading opportunities.
Providing Comprehensive Market Insight : The combination offers a better perspective on the market, considering both the direction (trend) and the strength (momentum) of price movements.
How the Components Work Together
1. Trend Identification with DSL Indicator
Dynamic Signal Lines : Calculates upper and lower DSL lines based on a moving average (SMA) and dynamic thresholds derived from recent highs and lows with a specified offset. These lines adapt to market conditions, providing real-time trend insights.
ATR-Based Bands : Adds bands around the DSL lines using the Average True Range (ATR) multiplied by a width factor. These bands account for market volatility and help identify potential stop-loss levels.
Trend Confirmation : The relationship between the price, DSL lines, and bands determines the current trend. For example, if the price consistently stays above the upper DSL line, it indicates a bullish trend.
2. Momentum Analysis
RSI Calculation : Computes the RSI over a specified period to measure the speed and change of price movements.
Zero-Lag EMA (ZLEMA) : Applies a ZLEMA to the RSI to minimize lag and produce a more responsive oscillator.
DSL Application on Oscillator : Implements the DSL concept on the oscillator by calculating dynamic upper and lower levels. This helps identify overbought or oversold conditions more accurately.
Signal Generation : Detects crossovers between the oscillator and its DSL lines. A crossover above the lower DSL line signals potential bullish momentum, while a crossover below the upper DSL line signals potential bearish momentum.
3. Integrated Signal Filtering
Confluence Requirement : A trade signal is generated only when both the DSL indicator and oscillator agree. For instance, a long entry requires both an uptrend confirmation from the DSL indicator and a bullish momentum signal from the oscillator.
Risk Management Integration : The strategy uses the DSL indicator's bands for setting stop-loss levels and calculates take-profit levels based on a user-defined risk-reward ratio. This ensures that every trade has a predefined risk management plan.
--------------------------------------------------------------------------------------------
Originality and Value Added to the Community
Unique Synergy : While both indicators are available individually, this strategy is original in how it combines them to enhance their strengths and mitigate their weaknesses, offering a novel approach not present in existing scripts.
Enhanced Reliability : By requiring confirmation from both trend and momentum indicators, the strategy reduces false signals and increases the likelihood of successful trades.
Versatility : The customizable parameters allow traders to adapt the strategy to different instruments, timeframes, and trading styles, making it a valuable tool for a wide range of trading scenarios.
Educational Contribution : The script demonstrates an effective method of combining indicators for improved trading performance, providing insights that other traders can learn from and apply to their own strategies.
--------------------------------------------------------------------------------------------
How to Use the Strategy
Adding the Strategy to Your Chart
Apply the DSL Strategy to your desired trading instrument and timeframe on TradingView.
--------------------------------------------------------------------------------------------
Configuring Parameters
DSL Indicator Settings :
Length (len) : Adjusts the sensitivity of the DSL lines (default is 34).
Offset : Determines the look-back period for threshold calculations (default is 30).
Bands Width (width) : Changes the distance of the ATR-based bands from the DSL lines (default is 1).
DSL-BELUGA Oscillator Settings :
Beluga Length (len_beluga) : Sets the period for the RSI calculation in the oscillator (default is 10).
DSL Lines Mode (dsl_mode) : Chooses between "Fast" (more responsive) and "Slow" (smoother) modes for the oscillator's DSL lines.
Risk Management :
Risk Reward (risk_reward) : Defines your desired risk-reward ratio for calculating take-profit levels (default is 1.5).
--------------------------------------------------------------------------------------------
Interpreting Signals
Long Entry Conditions :
Trend Confirmation : Price is above the upper DSL line and the upper DSL band (dsl_up1 > dsl_dn).
Price Behavior : The last three candles have both their opens and closes above the upper DSL line.
Momentum Signal : The DSL-BELUGA oscillator crosses above its lower DSL line (up_signal), indicating bullish momentum.
Short Entry Conditions :
Trend Confirmation : Price is below the lower DSL line and the lower DSL band (dsl_dn < dsl_up1).
Price Behavior : The last three candles have both their opens and closes below the lower DSL band.
Momentum Signal : The DSL-BELUGA oscillator crosses below its upper DSL line (dn_signal), indicating bearish momentum.
Exit Conditions :
Stop-Loss : Automatically set at the DSL indicator's band level (upper band for longs, lower band for shorts).
Take-Profit : Calculated based on the risk-reward ratio and the initial risk determined by the stop-loss distance.
Visual Aids
Signal Arrows : Upward green arrows for long entries and downward blue arrows for short entries appear on the chart when conditions are met.
Stop-Loss and Take-Profit Lines : Red and green lines display the calculated stop-loss and take-profit levels for active trades.
Background Highlighting : The chart background subtly changes color to indicate when a signal has been generated.
Backtesting and Optimization
Use TradingView's strategy tester to backtest the strategy over historical data.
Adjust parameters to optimize performance for different instruments or market conditions.
Regularly review backtesting results to ensure the strategy remains effective.
RVI Crossover Strategy[Kopottaja]Overview of the RVI Crossover Strategy
Strategy Name: RVI Crossover Strategy
Purpose: The RVI Crossover Strategy is based on the crossover signals between the Relative Vigor Index (RVI) and its moving average signal line. This strategy aims to identify potential buy and sell signals by evaluating the market’s directional trend.
Key Indicator Features
Relative Vigor Index (RVI): This indicator measures the momentum of price changes over a specified period and helps identify the market’s current trend. The RVI is based on the idea that prices generally close higher than they open in an uptrend (and lower in a downtrend). The RVI helps provide an indication of the strength and direction of a trend.
Signal Line: A moving average (e.g., SMA) is applied to the RVI values, creating a "signal line." When the RVI crosses above or below this line, it signals a potential trading opportunity.
Calculations and Settings
Calculating the RVI: The RVI is calculated by comparing the difference between the close and open prices to the difference between high and low prices. This provides information about the direction and momentum of price movement:
RVI= Sum(SWMA(high−low))Sum(SWMA(close−open))
where SWMA is a smoothed weighted moving average over a specified period.
Signal Line Calculation: The RVI value is smoothed by applying a simple moving average (SMA) to create the signal line. This signal line helps filter crossover signals for improved accuracy.
Buy and Sell Conditions: Buy and sell conditions are identified based on crossovers between the RVI and its signal line.
Buy Signal: A buy condition is triggered when the RVI crosses above the signal line, provided that the "Bearish" condition (trend confirmation) is met.
Sell Signal: A sell condition occurs when the RVI crosses below the signal line, alongside the "Bullish" trend confirmation.
Volume-Weighted Moving Averages (VWMA): VWMA indicators are used to assess price-volume relationships over different timeframes:
Fast VWMA: A short-period volume-weighted moving average.
Slow VWMA: A longer-period volume-weighted moving average. These values are used to strengthen the buy and sell conditions by confirming trend directions (Bullish or Bearish).
Disclaimer: This is an educational and informational tool. Past performance is not indicative of future results. Always backtest before using in live markets
Standard and Camarilla pivotsHi guys, I would like too introduce to all of you my script. As the name already tell you what this script is all about. It's about pivot points.
You may ask, Tradingview already have a script for pivot points, why would I need another script?
here is the answer: This script allow you to add more than one type of pivot, sounds good right?
But there's more: You can see not just one timeframe pivots, you can see many timeframe pivots, nice huh?
let dive into it to know a bit more.
In this script you can see daily pivots include Standard pivots as R1, R2, R3 and Camarilla pivots as cR1, cR2, cR3, and I you different color for different pivots, so you don't confuse between those two.
You can see weekly pivots the same as daily pivots only has letter "w" in front of it, for examples: "wR1, wR2, wcR1, wcR2" ,nice right?
What's about month level: yes, you can see monthly pivots too, and it start with "m".
Along with pivots points above, you also can see daily open, previous day close, previous high,.., for instances: daily open as "O", previous day open as "PDO",
You are able to see previous week level, previous month levels.
have fun.
I dont wanna lock this script because open-source script help me learn how to code pine script, so that's why I keep it open. Thank to all the coders out there that shared everything they have for us to learn.