Divine Christmas Tree [Daveatt]🎄 Divine Christmas Tree - Because Even Your Charts Deserve Holiday FOMO! 🎅
Ever felt like your trading charts were missing that special holiday spirit? Tired of staring at boring candlesticks while everyone else is decorating their houses? Well, hold onto your eggnog because this indicator is about to turn your TradingView into a festive party! 🎉
Introducing the Divine Christmas Tree - the only technical indicator that makes your losses look festive! This isn't your grandmother's Christmas tree... it's a high-tech, market-aware celebration that would make Wall Street jealous.
🌟 What's Inside This Gift Box:
- A tree that changes color based on price action (because even Christmas trees need to respect the 200 SMA!)
- Ornaments that dance around like your portfolio after a Fed announcement
- A Santa who's definitely not checking if your trades were naughty or nice
- Presents under the tree (sorry, they don't contain trading tips)
- Random ornament placement that's more unpredictable than crypto prices
The best part? The ornaments refresh constantly, giving you something fun to watch while you're waiting for that breakout that'll never come! 😅
WARNING: This indicator may cause:
- Uncontrollable holiday cheer
- Sudden urges to buy Santa Coin
- Confusion among serious traders
- Desperate attempts to explain to your spouse why you're watching a Christmas tree on your trading screen
Perfect for:
- Traders who need emotional support during December
- Anyone who wants to pretend they're working while actually watching Christmas decorations
- People who believe Santa Claus is the ultimate swing trader
Remember: Just because your portfolio is in red doesn't mean your Christmas tree has to be! 🎄
Not financial advice, but definitely festive advice! 🎅
Su Pine
XRP/USD Scalping Strategy with Alerts
The strategy in your script is designed for scalping XRP/USD, utilizing a combination of Exponential Moving Averages (EMAs), Relative Strength Index (RSI), Volume analysis, and N-Bar detection to identify potential buy and sell signals. It aims to make quick, small profits by taking advantage of short-term price movements. Here's a detailed breakdown:
Key Components of the Strategy:
Exponential Moving Averages (EMAs):
Short EMA (8-period) and Long EMA (21-period) are used to identify the trend.
A buy signal is generated when the Short EMA crosses above the Long EMA (bullish crossover).
A sell signal is generated when the Short EMA crosses below the Long EMA (bearish crossunder).
Relative Strength Index (RSI):
The RSI (with a 14-period) is used to assess whether the market is in an overbought or oversold condition.
For a long position, the strategy checks if the RSI is above 50 to ensure that the market is not in an oversold condition.
For a short position, the strategy checks if the RSI is below 50, which signals a weaker or bearish market.
Volume Analysis:
The strategy checks if the current volume is greater than the average volume over a defined period (20 bars in this case).
Higher volume indicates stronger market participation and gives more confidence in the signals.
N-Bar Detection:
The strategy uses a custom function to detect the price action of the last n bars.
Bullish N-bars: If the lowest low of the last n_bars is higher than the lowest low of the previous 2*n_bars (indicating a bullish reversal pattern).
Bearish N-bars: If the highest high of the last n_bars is lower than the highest high of the previous 2*n_bars (indicating a bearish reversal pattern).
Buy (Long) Condition:
EMA Crossover: The Short EMA crosses above the Long EMA, indicating a potential upward trend.
RSI > 50: The market is not in an oversold state (indicating that the market is bullish).
Volume > Average Volume: The current volume is higher than the average volume, signaling increased market activity.
Bullish N-bars: The price action of the last n_bars shows a bullish reversal, providing additional confirmation for a buy.
Sell (Short) Condition:
EMA Crossunder: The Short EMA crosses below the Long EMA, indicating a potential downward trend.
RSI < 50: The market is not in an overbought state (indicating that the market is bearish).
Volume > Average Volume: The current volume is higher than the average volume, signaling increased market activity.
Bearish N-bars: The price action of the last n_bars shows a bearish reversal, providing additional confirmation for a sell.
Take Profit and Stop Loss:
The strategy includes a take profit and stop loss mechanism to limit the risk and secure profits.
Take Profit: Set at 1.5% of the entry price.
Stop Loss: Set at 0.7% of the entry price.
Alerts:
The strategy has alerts for both buy and sell signals.
When the buy or sell conditions are met, it triggers an alert, sending notifications (pop-up, email, etc.) to the user.
Summary of the Strategy:
Trend Following with EMA: The strategy relies on the crossover of short and long EMAs to determine the trend direction.
Momentum Analysis with RSI: The RSI confirms that the market is not overbought or oversold, ensuring that the trade is made in favorable conditions.
Volume Confirmation: Only signals with increased market participation (higher volume than the average) are considered valid.
Reversal Patterns with N-bars: The N-bar detection adds a layer of confirmation for potential reversals, improving the accuracy of entry signals.
Risk Management: The take profit and stop loss levels are designed to capture small, profitable moves while protecting from large losses.
This scalping strategy aims for quick, small profits with controlled risk, making it suitable for highly liquid markets like XRP/USD. The use of EMAs, RSI, volume analysis, and N-bar patterns increases the reliability of the signals and helps minimize false entries.
5 EMA / 20 EMA Crossover Strategy5 EMA / 20 EMA Crossover Strategy
shortEMA: The 5-period EMA.
longEMA: The 20-period EMA.
ta.crossover(ema5, ema20): This function checks if the 5-period EMA crosses above the 20-period EMA, generating a buy signal.
ta.crossunder(ema5, ema20): This function checks if the 5-period EMA crosses below the 20-period EMA, generating a sell signal.
strategy.entry("Buy", strategy.long): This function enters a long position when a buy signal is triggered.
strategy.close("Buy"): This closes the long position when a sell signal is triggered.
The strategy also includes visual markers (plotshape) to highlight buy and sell signals on the chart with labels "BUY" and "SELL."
First day candle high and low of monthThis script is designed to mark the high and low levels of the first candle of each month on the chart. These levels are often considered significant support and resistance zones, as they can represent key liquidity points in the market.
The idea behind this tool is based on the observation that the low of the first monthly candle can act as a critical support level, especially during a bullish market trend. If the price breaks below this low in a bull market, it may indicate a potential manipulation or stop-loss hunting rather than a genuine shift in trend. Similarly, the high of the first monthly candle may serve as a key resistance level, particularly in consolidating or range-bound markets.
By dynamically plotting these levels, the script provides traders with valuable insights into potential liquidity zones and significant market reactions. It allows for customizable line colors and lengths, making it adaptable to various trading styles and preferences.
This tool is particularly useful for traders who wish to align their strategies with institutional market behaviors, as it highlights areas where liquidity is likely to be targeted. Use it as part of your broader analysis to identify potential trade setups, manage risk effectively, and understand market dynamics more comprehensively.
12 Month Difference - YoY ComparisonEste script foi desenvolvido para calcular e exibir a variação percentual do preço de um ativo nos últimos 12 meses, de forma simples e visual. Ele utiliza dados históricos de preços e apresenta o resultado diretamente no gráfico, permitindo ao usuário acompanhar a relação entre o valor atual e o valor de 12 meses atrás.
O cálculo é baseado em um período de 12 meses, que equivale a 252 dias úteis no mercado financeiro. O script primeiro identifica o preço atual do ativo e o compara com o preço registrado há exatamente 252 dias úteis. A diferença entre esses dois valores é transformada em uma variação percentual, o que facilita a análise de desempenho do ativo ao longo do período.
Além disso, o script define uma cor para destacar o resultado:
Verde, se a variação percentual for positiva (indicando crescimento).
Vermelho, se a variação for negativa (indicando queda).
O valor calculado é exibido de forma prática no canto inferior direito do gráfico, como uma tabela flutuante. Essa tabela contém o texto "Relação 12M" e o valor percentual correspondente, permitindo uma leitura rápida.
Embora o resultado seja calculado para todos os momentos no gráfico, ele é mostrado apenas como uma tabela no último ponto confirmado da série histórica, ou seja, no momento mais recente com dados disponíveis. Além disso, o script inclui o valor da relação na legenda do gráfico, mas ele está oculto visualmente para evitar sobrecarregar o layout.
Esse indicador é útil para analisar rapidamente o desempenho de um ativo ao longo de um ano, ajudando investidores e analistas a entenderem tendências e mudanças no mercado.
This script was developed to calculate and display the percentage change in the price of an asset over the last 12 months, in a simple and visual way. It uses historical price data and displays the result directly on the chart, allowing the user to monitor the relationship between the current value and the value from 12 months ago.
The calculation is based on a 12-month period, which is equivalent to 252 business days in the financial market. The script first identifies the current price of the asset and compares it with the price recorded exactly 252 business days ago. The difference between these two values is transformed into a percentage change, which makes it easier to analyze the asset's performance over the period.
In addition, the script defines a color to highlight the result:
Green, if the percentage change is positive (indicating growth).
Red, if the change is negative (indicating a decline).
The calculated value is displayed conveniently in the bottom right corner of the chart, as a floating table. This table contains the text "12M Ratio" and the corresponding percentage value, allowing for quick reading.
Although the result is calculated for all points in time on the chart, it is only displayed as a table at the last confirmed point in the historical series, i.e. the most recent point in time with available data. In addition, the script includes the ratio value in the chart legend, but it is visually hidden to avoid cluttering the layout.
This indicator is useful for quickly analyzing the performance of an asset over a year, helping investors and analysts understand trends and changes in the market.
Vertical Lines OverlayVertical Lines Overlay with Custom Time Inputs
This script allows users to draw vertical lines on their charts at specific times of the day, providing a customizable tool for marking key events, session changes, or any other time-based analysis.
Features:
Customizable Time Inputs: Set up to 6 distinct times (hours and minutes) to draw vertical lines.
Line Style Options: Choose between solid, dotted, or dashed line styles for each line.
Line Width Control: Adjust the thickness of each line individually.
Color Selection: Assign unique colors to each vertical line for better visibility and organization.
Dynamic Time Offsets: Adjust line positions with predefined time offsets, ensuring compatibility across different trading instruments and time zones.
Automatic Line Drawing: Lines are plotted automatically at the specified times if the conditions are met.
How to Use:
Open the settings panel by clicking the gear icon.
Enable or disable each line by toggling the respective checkboxes.
Set the desired time for each line using the hour and minute inputs.
Customize line styles, widths, and colors for each line.
Optionally, apply a time offset based on your trading instrument or preference.
Future Interest Indexed by AssetEste script em Pine Script calcula e exibe o índice dos juros futuros (DI1) em relação ao preço de um ativo, utilizando o preço de fechamento do ativo e a taxa de juros futuros (DI1). O cálculo é realizado dividindo a taxa de juros pelos preços do ativo, resultando no índice indice_juros. Para evitar a divisão por zero, o script verifica se o preço do ativo é válido e não nulo. O índice calculado é então plotado em um painel inferior no gráfico, representado por uma linha azul, permitindo aos usuários observar a relação entre a taxa de juros futuros e o preço do ativo de forma clara e intuitiva.
This Pine Script script calculates and displays the future interest rate (DI1) in relation to the price of an asset, using the asset's closing price and the future interest rate (DI1). The calculation is carried out by dividing the interest rate by the asset prices, resulting in the index_interest index. To avoid division by zero, the script checks that the asset's price is valid and not null. The calculated index is then plotted in a lower panel on the chart, represented by a blue line, allowing users to observe the relationship between the future interest rate and the asset price clearly and intuitively.
Asset Indexed by Future Interest
Este script em Pine Script calcula e exibe o índice de um ativo em relação à taxa de juros futuros (DI1) em um painel inferior. Ele obtém o preço de fechamento do ativo e a taxa de juros futuros DI1!, e em seguida, calcula o índice do ativo dividindo o preço do ativo pela taxa de juros futuros. Para evitar a divisão por zero, o script realiza uma validação para garantir que o valor da taxa de juros não seja nulo ou zero. O índice calculado é então plotado no painel inferior, em uma linha verde, permitindo que os usuários visualizem a relação entre o preço do ativo e os juros futuros de curto prazo. Esse índice pode ser útil para analisar como a taxa de juros influencia o comportamento do ativo.
This script in Pine Script calculates and displays the ratio of an asset to the future interest rate (DI1) in a lower panel. It obtains the asset's closing price and the future interest rate DI1!, and then calculates the asset index by dividing the asset price by the future interest rate. To avoid division by zero, the script performs validation to ensure that the interest rate value is not null or zero. The calculated index is then plotted in the bottom panel, in a green line, allowing users to visualize the relationship between the asset's price and short-term future interest. This index can be useful for analyzing how the interest rate influences the asset's behavior.
Watermark with dynamic variables [BM]█ OVERVIEW
This indicator allows users to add highly customizable watermark messages to their charts. Perfect for branding, annotation, or displaying dynamic chart information, this script offers advanced customization options including dynamic variables, text formatting, and flexible positioning.
█ CONCEPTS
Watermarks are overlay messages on charts. This script introduces placeholders — special keywords wrapped in % signs — that dynamically replace themselves with chart-related data. These watermarks can enhance charts with context, timestamps, or branding.
█ FEATURES
Dynamic Variables : Replace placeholders with real-time data such as bar index, timestamps, and more.
Advanced Customization : Modify text size, color, background, and alignment.
Multiple Messages : Add up to four independent messages per group, with two groups supported (A and B).
Positioning Options : Place watermarks anywhere on the chart using predefined locations.
Timezone Support : Display timestamps in a preferred timezone with customizable formats.
█ INPUTS
The script offers comprehensive input options for customization. Each Watermark (A and B) contains identical inputs for configuration.
Watermark settings are divided into two levels:
Watermark-Level Settings
These settings apply to the entire watermark group (A/B):
Show Watermark: Toggle the visibility of the watermark group on the chart.
Position: Choose where the watermark group is displayed on the chart.
Reverse Line Order: Enable to reverse the order of the lines displayed in Watermark A.
Message-Level Settings
Each watermark contains up to four configurable messages. These messages can be independently customized with the following options:
Message Content: Enter the custom text to be displayed. You can include placeholders for dynamic data.
Text Size: Select from predefined sizes (Tiny, Small, Normal, Large, Huge) or specify a custom size.
Text Alignment and Colors:
- Adjust the alignment of the text (Left, Center, Right).
- Set text and background colors for better visibility.
Format Time: Enable time formatting for this watermark message and configure the format and timezone. The settings for each message include message content, text size, alignment, and more. Please refer to Formatting dates and times for more details on valid formatting tokens.
█ PLACEHOLDERS
Placeholders are special keywords surrounded by % signs, which the script dynamically replaces with specific chart-related data. These placeholders allow users to insert dynamic content, such as bar information or timestamps, into watermark messages.
Below is the complete list of currently available placeholders:
bar_index , barstate.isconfirmed , barstate.isfirst , barstate.ishistory , barstate.islast , barstate.islastconfirmedhistory , barstate.isnew , barstate.isrealtime , chart.is_heikinashi , chart.is_kagi , chart.is_linebreak , chart.is_pnf , chart.is_range , chart.is_renko , chart.is_standard , chart.left_visible_bar_time , chart.right_visible_bar_time , close , dayofmonth , dayofweek , dividends.future_amount , dividends.future_ex_date , dividends.future_pay_date , earnings.future_eps , earnings.future_period_end_time , earnings.future_revenue , earnings.future_time , high , hl2 , hlc3 , hlcc4 , hour , last_bar_index , last_bar_time , low , minute , month , ohlc4 , open , second , session.isfirstbar , session.isfirstbar_regular , session.islastbar , session.islastbar_regular , session.ismarket , session.ispostmarket , session.ispremarket , syminfo.basecurrency , syminfo.country , syminfo.currency , syminfo.description , syminfo.employees , syminfo.expiration_date , syminfo.industry , syminfo.main_tickerid , syminfo.mincontract , syminfo.minmove , syminfo.mintick , syminfo.pointvalue , syminfo.prefix , syminfo.pricescale , syminfo.recommendations_buy , syminfo.recommendations_buy_strong , syminfo.recommendations_date , syminfo.recommendations_hold , syminfo.recommendations_sell , syminfo.recommendations_sell_strong , syminfo.recommendations_total , syminfo.root , syminfo.sector , syminfo.session , syminfo.shareholders , syminfo.shares_outstanding_float , syminfo.shares_outstanding_total , syminfo.target_price_average , syminfo.target_price_date , syminfo.target_price_estimates , syminfo.target_price_high , syminfo.target_price_low , syminfo.target_price_median , syminfo.ticker , syminfo.tickerid , syminfo.timezone , syminfo.type , syminfo.volumetype , ta.accdist , ta.iii , ta.nvi , ta.obv , ta.pvi , ta.pvt , ta.tr , ta.vwap , ta.wad , ta.wvad , time , time_close , time_tradingday , timeframe.isdaily , timeframe.isdwm , timeframe.isintraday , timeframe.isminutes , timeframe.ismonthly , timeframe.isseconds , timeframe.isticks , timeframe.isweekly , timeframe.main_period , timeframe.multiplier , timeframe.period , timenow , volume , weekofyear , year
█ HOW TO USE
1 — Add the Script:
Apply "Watermark with dynamic variables " to your chart from the TradingView platform.
2 — Configure Inputs:
Open the script settings by clicking the gear icon next to the script's name.
Customize visibility, message content, and appearance for Watermark A and Watermark B.
3 — Utilize Placeholders:
Add placeholders like %bar_index% or %timenow% in the "Watermark - Message" fields to display dynamic data.
Empty lines in the message box are reflected on the chart, allowing you to shift text up or down.
Using in the message box translates to a new line on the chart.
4 — Preview Changes:
Adjust settings and view updates in real-time on your chart.
█ EXAMPLES
Branding
DodgyDD's charts
Debugging
█ LIMITATIONS
Only supports variables defined within the script.
Limited to four messages per watermark.
Visual alignment may vary across different chart resolutions or zoom levels.
Placeholder parsing relies on correct input formatting.
█ NOTES
This script is designed for users seeking enhanced chart annotation capabilities. It provides tools for dynamic, customizable watermarks but is not a replacement for chart objects like text labels or drawings. Please ensure placeholders are properly formatted for correct parsing.
Additionally, this script can be a valuable tool for Pine Script developers during debugging . By utilizing dynamic placeholders, developers can display real-time values of variables and chart data directly on their charts, enabling easier troubleshooting and code validation.
Up and Downwhat is "Up and Down"?
It is an indicator designed to show you in detail on the chart and warn you when there is an increase or decrease in the market at a level that you consider important.
what it does?
When the price difference between a top and bottom is greater than the level you selected (the default input is 10 percent), it indicates this along with the percentage value on the chart. Then, it indicates the start and end points with lines so that you can see the change from where to where. It shows the price's current percentage distance from the last bottom or top in the upper right corner.
it also colors the candles so you can better understand how fast the price is moving. The greener the candles, the stronger the rise, and conversely, the greater the decline, the redder the candles. Of course, if you set an alarm, it will tell you in which trading pair, in which time period, at what percentage and in which direction there is a movement.
how it does it?
It uses a moving average with a short length to find bottoms and tops. It then measures the distance from the last peak to the bottom and expresses it as a percentage. It uses momentum using the moving average as a source to paint the candles. To compress this momentum between the values 255 and 0, I used a formula that I also used in my limited fisher transform work (because the inputs in the color.rgb function take values between 0 and 255). It was a bit challenging to use the lines correctly, but with the "ta.valuewhen" function and a little experimenting, they were I made sure they were drawn correctly.
how to use it?
It is quite simple to use. First, select the minimum interval you want to receive alarms. If you make this value too high, you will not receive any alarms; if you make it too low, you will receive too many alarms. Choose the range that will benefit you most for the trading pair you are using. Then all you have to do is set an alarm. When you set an alarm, leave the note section blank and the indicator will send you the necessary information.
R-based Strategy Template [Daveatt]Have you ever wondered how to properly track your trading performance based on risk rather than just profits?
This template solves that problem by implementing R-multiple tracking directly in TradingView's strategy tester.
This script is a tool that you must update with your own trading entry logic.
Quick notes
Before we dive in, I want to be clear: this is a template focused on R-multiple calculation and visualization.
I'm using a basic RSI strategy with dummy values just to demonstrate how the R tracking works. The actual trading signals aren't important here - you should replace them with your own strategy logic.
R multiple logic
Let's talk about what R-multiple means in practice.
Think of R as your initial risk per trade.
For instance, if you have a $10,000 account and you're risking 1% per trade, your 1R would be $100.
A trade that makes twice your risk would be +2R ($200), while hitting your stop loss would be -1R (-$100).
This way of measuring makes it much easier to evaluate your strategy's performance regardless of account size.
Whenever the SL is hit, we lose -1R
Proof showing the strategy tester whenever the SL is hit: i.imgur.com
The magic happens in how we calculate position sizes.
The script automatically determines the right position size to risk exactly your specified percentage on each trade.
This is done through a simple but powerful calculation:
risk_amount = (strategy.equity * (risk_per_trade_percent / 100))
sl_distance = math.abs(entry_price - sl_price)
position_size = risk_amount / (sl_distance * syminfo.pointvalue)
Limitations with lower timeframe gaps
This ensures that if your stop loss gets hit, you'll lose exactly the amount you intended to risk. No more, no less.
Well, could be more or less actually ... let's assume you're trading futures on a 15-minute chart but in the 1-minute chart there is a gap ... then your 15 minute SL won't get filled and you'll likely to not lose exactly -1R
This is annoying but it can't be fixed - and that's how trading works anyway.
Features
The template gives you flexibility in how you set your stop losses. You can use fixed points, ATR-based stops, percentage-based stops, or even tick-based stops.
Regardless of which method you choose, the position sizing will automatically adjust to maintain your desired risk per trade.
To help you track performance, I've added a comprehensive statistics table in the top right corner of your chart.
It shows you everything you need to know about your strategy's performance in terms of R-multiples: how many R you've won or lost, your win rate, average R per trade, and even your longest winning and losing streaks.
Happy trading!
And remember, measuring your performance in R-multiples is one of the most classical ways to evaluate and improve your trading strategies.
Daveatt
Extended Support and Resistance LevelsIndicator: Extended Support and Resistance Levels
This Pine Script indicator dynamically calculates support and resistance levels based on recent price action and projects these levels into the future.
Support is determined by the lowest low over a user-defined period, while Resistance is defined by the highest high over the same period.
The indicator draws lines at the calculated support and resistance levels and extends them into the future, allowing traders to visualize potential future levels where price might react.
The extension of these lines helps in identifying areas where price may respect support or resistance in the upcoming bars.
The user can adjust the period for support/resistance calculation and the number of bars for projection, providing flexibility to adapt to different timeframes and market conditions.
This tool is ideal for traders looking to anticipate future key price levels based on historical price data, helping with decision-making on potential entry or exit points.
FIR Low Pass Filter Suite (FIR)The FIR Low Pass Filter Suite is an advanced signal processing indicator that applies finite impulse response (FIR) filtering techniques to price data. At its core, the indicator uses windowed-sinc filtering, which provides optimal frequency response characteristics for separating trend from noise in financial data.
The indicator offers multiple window functions including Kaiser, Kaiser-Bessel Derived (KBD), Hann, Hamming, Blackman, Triangular, and Lanczos. Each window type provides different trade-offs between main-lobe width and side-lobe attenuation, allowing users to fine-tune the frequency response characteristics of the filter. The Kaiser and KBD windows provide additional control through an alpha parameter that adjusts the shape of the window function.
A key feature is the ability to operate in either linear or logarithmic space. Logarithmic filtering can be particularly appropriate for financial data due to the multiplicative nature of price movements. The indicator includes an envelope system that can adaptively calculate bands around the filtered price using either arithmetic or geometric deviation, with separate controls for upper and lower bands to account for the asymmetric nature of market movements.
The implementation handles edge effects through proper initialization and offers both centered and forward-only filtering modes. Centered mode provides zero phase distortion but introduces lag, while forward-only mode operates causally with no lag but introduces some phase distortion. All calculations are performed using vectorized operations for efficiency, with carefully designed state management to handle the filter's warm-up period.
Visual feedback is provided through customizable color gradients that can reflect the current trend direction, with optional glow effects and background fills to enhance visibility. The indicator maintains high numerical precision throughout its calculations while providing smooth, artifact-free output suitable for both analysis and visualization.
Lanczos CandlesThis indicator reconstructs price action using Lanczos resampling, incorporating lower timeframe data to create a more detailed representation of market movements. Traditional candle aggregation on higher timeframes tends to lose some price action detail - this indicator attempts to preserve more of that information through mathematical resampling.
The indicator samples price data from a lower timeframe and uses the Lanczos algorithm, a mathematical method commonly used in signal processing and image resampling, to reconstruct the price series at the chart's timeframe. The process helps maintain price movements that might otherwise be smoothed out in regular candle aggregation.
The main settings allow you to select the source timeframe for sampling, adjust the Lanczos filter width to balance smoothness versus detail preservation, and optionally enable Heikin Ashi calculation. The filter width parameter (default: 3) affects how aggressive the smoothing is - higher values produce smoother results while lower values retain more of the original variation.
This approach can be useful for technical analysis when you want to work with higher timeframes while maintaining awareness of significant price movements that occurred within those candles. The optional Heikin Ashi mode can help visualize trends in the resampled data.
The indicator works best when there's a clear ratio between your chart timeframe and the source timeframe (for example, using 1-minute data to build 5-minute candles).
Calculate Order Entry Units based on set Dollar ValuesFUNCTIONS
- Calculate UNITS quantity based on user's input dollar values.
- Show Units in table
USAGE
- Enter 6 usual order $ values
- Use units value in order entry
Tradingview doesn't have order entry in dollar value for most connections/exchanges so it's really tedious to calculate Units some other way every time.
This gives you the Units based on your most used order value sizes in a quick way.
Possible future updates
- Allow user settings for number of values to display
- Allow user option to set titles for each row
Note:
Tradingview really need to get off their butts and give us a real DOM panel and working dollar value order entry for all exchanges among other order entry panel updates.
I hope everyone is suggesting this to them.
DynamicPeriodPublicDynamic Period Calculation Library
This library provides tools for adaptive period determination, useful for creating indicators or strategies that automatically adjust to market conditions.
Overview
The Dynamic Period Library calculates adaptive periods based on pivot points, enabling the creation of responsive indicators and strategies that adjust to market volatility.
Key Features
Dynamic Periods: Computes periods using distances between pivot highs and lows.
Customizable Parameters: Users can adjust detection settings and period constraints.
Robust Handling: Includes fallback mechanisms for cases with insufficient pivot data.
Use Cases
Adaptive Indicators: Build tools that respond to market volatility by adjusting their periods dynamically.
Dynamic Strategies: Enhance trading strategies by integrating pivot-based period adjustments.
Function: `dynamic_period`
Description
Calculates a dynamic period based on the average distances between pivot highs and lows.
Parameters
`left` (default: 5): Number of left-hand bars for pivot detection.
`right` (default: 5): Number of right-hand bars for pivot detection.
`numPivots` (default: 5): Minimum pivots required for calculation.
`minPeriod` (default: 2): Minimum allowed period.
`maxPeriod` (default: 50): Maximum allowed period.
`defaultPeriod` (default: 14): Fallback period if no pivots are found.
Returns
A dynamic period calculated based on pivot distances, constrained by `minPeriod` and `maxPeriod`.
Example
//@version=6
import CrimsonVault/DynamicPeriodPublic/1
left = input.int(5, "Left bars", minval = 1)
right = input.int(5, "Right bars", minval = 1)
numPivots = input.int(5, "Number of Pivots", minval = 2)
period = DynamicPeriodPublic.dynamic_period(left, right, numPivots)
plot(period, title = "Dynamic Period", color = color.blue)
Implementation Notes
Pivot Detection: Requires sufficient historical data to identify pivots accurately.
Edge Cases: Ensures a default period is applied when pivots are insufficient.
Constraints: Limits period values to a user-defined range for stability.
Algorithmic Signal AnalyzerMeet Algorithmic Signal Analyzer (ASA) v1: A revolutionary tool that ushers in a new era of clarity and precision for both short-term and long-term market analysis, elevating your strategies to the next level.
ASA is an advanced TradingView indicator designed to filter out noise and enhance signal detection using mathematical models. By processing price movements within defined standard deviation ranges, ASA produces a smoothed analysis based on a Weighted Moving Average (WMA). The Volatility Filter ensures that only relevant price data is retained, removing outliers and improving analytical accuracy.
While ASA provides significant analytical advantages, it’s essential to understand its capabilities in both short-term and long-term use cases. For short-term trading, ASA excels at capturing swift opportunities by highlighting immediate trend changes. Conversely, in long-term trading, it reveals the overall direction of market trends, enabling traders to align their strategies with prevailing conditions.
Despite these benefits, traders must remember that ASA is not designed for precise trade execution systems where accuracy in timing and price levels is critical. Its focus is on analysis rather than order management. The distinction is crucial: ASA helps interpret price action effectively but may not account for real-time market factors such as slippage or execution delays.
Features and Functionality
ASA integrates multiple tools to enhance its analytical capabilities:
Customizable Moving Averages: SMA, EMA, and WMA options allow users to tailor the indicator to their trading style.
Signal Detection: Identifies bullish and bearish trends using the Relative Exponential Moving Average (REMA) and marks potential buy/sell opportunities.
Visual Aids: Color-coded trend lines (green for upward, red for downward) simplify interpretation.
Alert System: Notifications for trend swings and reversals enable timely decision-making.
Notes on Usage
ASA’s effectiveness depends on the context in which it is applied. Traders should carefully consider the trade-offs between analysis and execution.
Results may vary depending on market conditions and chart types. Backtesting with ASA on standard charts provides more reliable insights compared to non-standard chart types.
Short-term use focuses on rapid trend recognition, while long-term application emphasizes understanding broader market movements.
Takeaways
ASA is not a tool for precise trade execution but a powerful aid for interpreting price trends.
For short-term trading, ASA identifies quick opportunities, while for long-term strategies, it highlights trend directions.
Understanding ASA’s limitations and strengths is key to maximizing its utility.
ASA is a robust solution for traders seeking to filter noise, enhance analytical clarity, and align their strategies with market movements, whether for short bursts of activity or sustained trading goals.
Ticker Tape with Multiple Inputs# Ticker Tape
A customizable multi-symbol price tracker that displays real-time price information in a scrolling ticker format, similar to financial news tickers.
This indicator is inspired from Tradingciew's default tickertape indicator with changes in the way inputs are given.
### Overview
This indicator allows you to monitor up to 15 different symbols simultaneously across any supported exchanges on TradingView. It displays essential price information including current price, price change, and percentage change in an easy-to-read format at the bottom of your chart.
### Features
• Monitor up to 15 different symbols simultaneously
• Support for any exchange available on TradingView
• Real-time price updates
• Color-coded price changes (green for increase, red for decrease)
• Smooth scrolling animation (can be disabled)
• Customizable scroll speed and position offset
### Input Parameters
#### Ticker Tape Controls
• Running: Enable/disable the scrolling animation
• Offset: Adjust the starting position of the ticker tape
#### Symbol Settings
• Exchange (1-15): Enter the exchange name (e.g., NSE, BINANCE, NYSE)
• Symbol (1-15): Enter the symbol name (e.g., BANKNIFTY, RELIANCE, BTCUSDT)
### Display Format
For each symbol, the ticker shows:
1. Symbol Name
2. Current Price
3. Price Change (Absolute and Percentage)
### Example Usage
Input Settings:
Exchange 1: NSE
Symbol 1: BANKNIFTY
Exchange 2: NSE
Symbol 2: RELIANCE
The ticker tape will display:
`NIFTY BANK 46750.00 +350.45 (0.75%) | RELIANCE 2456.85 -12.40 (-0.50%) |`
### Use Cases
1. Multi-Market Monitoring: Track different markets simultaneously without switching between charts
2. Portfolio Tracking: Monitor all your positions in real-time
### Tips for Best Use
1. Group related symbols together for easier monitoring
2. Use the offset parameter to position important symbols in your preferred viewing area
3. Disable scrolling if you prefer a static display
4. Leave exchange field empty for default exchange symbols
### Notes
• Price updates occur in real-time during market hours
• Color coding helps quickly identify price direction
• The indicator adapts to any chart timeframe
• Empty input pairs are automatically skipped
### Performance Considerations
The indicator is optimized for efficiency, but monitoring too many high-frequency symbols might impact chart performance. It's recommended to use only the symbols you actively need to monitor.
Version: 2.0 Stock_Cloud
Last Updated: December 2024
Crypto Sectors Performance [Daveatt]IMPORTANT
⚠️ This script must be used on the Daily timeframe only.
OVERVIEW
This indicator brings the powerful sector analysis capabilities from velo.xyz/market's
Sector Performance chart to TradingView.
It enables traders to track and compare performance across the crypto market's major sectors, providing essential insights for sector rotation strategies and market analysis.
CALCULATION METHOD
The indicator calculates performance across six key crypto sectors: DeFi, Gaming, Layer 1s, Layer 2s, AI, and Memecoins.
For each sector, it computes a rolling percentage performance by averaging the performance of multiple representative tokens.
All sector performances are rebased to 0% at the start of each period, making relative comparisons clear and intuitive.
VISUALIZATION MODES
The script features two distinct visualization methods:
Plots Mode:
Displays continuous performance lines for each sector over time, ideal for tracking relative strength trends and sector momentum. Each sector has its own color-coded line with performance values clearly marked.
Bars Mode:
Presents current sector performance as vertical bars, offering an immediate visual comparison of sector gains and losses.
The bars are color-coded and labeled with exact percentage values for precise analysis.
For the "Bars Mode", I used the box.new() function
SECTOR COMPOSITION
Each sector comprises carefully selected representative tokens:
- DeFi: AAVE, 1INCH, JUP, MKR, UNI
- Gaming: GALA, AXS, RONIN, SAND
- Layer 1: BTC, ETH, AVAX, APT, SOL, BNB, SUI
- Layer 2: ARB, OP, ZK, POL, STRK, MNT
- AI: FET, NEAR, RENDER, TAO
- Memecoins: PEPE, BONK, SHIB, DOGE, WIFU, POPCAT
PERFORMANCE TRACKING
The indicator implements a rolling window approach for performance calculations.
Starting from 0% at the beginning of each period, it tracks relative performance with positive values indicating outperformance and negative values showing underperformance.
Multiple timeframe options (1W, 1M, 3M, 6M, and 1Y) allow for both short-term and long-term analysis.
APPLICATIONS
This tool proves invaluable for:
- Sector rotation analysis
- Identifying trending sectors
- Comparing relative strength
- Gauging market sentiment
- Understanding market structure through sector performance
Thanks for reading and for the support
Daveatt
Alerts and symbolswhat is "Alerts and symbols"?
It is an indicator that allows you to watch more trading pairs and add alarms to them.
what it does?
It allows you to set a total of 20 different intersection alarms, 2 in each pair, for 10 different trading pairs at the same time.
It draws the candlestick chart of a pair you choose among 10 trading pairs and the alarm lines you created for this trading pair on the chart.
It also allows you to see the prices of 10 different trading pairs at the same time, thanks to the table it creates.
how to use it?
First, select the alarm pairs you want to use, for example, BTCUSDT pair is the default value for "pair 1". You can choose 10 different trading pairs as you wish. Just below each trading pair, there are two different sections titled "line 1" and "line 2" so that you can set an alarm. Type here the price levels at which you want to be alerted in case of a price crossover.
You can use the "candle source" section to examine the candlestick charts of trading pairs. The indicator draws the candle chart of the trading pair selected in the "candle source" section.
Check the "show alert lines on chart" box to see the levels you have set an alarm for.
When everything is ready, first click on the three dots next to the indicator's name and then on the clock icon. then create an alarm and that's it.
MES Position Sizing EstimatorDescription and Use:
Here is an indicator which aims to help all Micro-ES futures traders who struggle with risk management! I created this indicator designed as a general guideline to help short term traders (designed for 1 minute candles) determine how many contracts to trade on the MES for their desired profit target.
To use the indicator, simply go to MES on the 1 minute timeframe, apply the indicator, and enter your Holding Period (how long you want to have your position open for), Value Per Tick
(usually 1.25 for MES since one point is $5) and your target PnL for the trade in the inputs tab.
It will then show in a table the recommended position sizing, as well as the estimated price change for your holding period. Additionally, there are two plotted lines also showing the position sizing and estimated price change historically.
How the indicator works
On the technical level, I made calculations for this indicator using Python. I downloaded 82 days of 1 minute OHLC data from TradingView, and then ran regression (log-transformed linear regression specifically) to calculate how the average price change in MES futures scales with the amount of time a position is held for, and then ran these regressions for every hour of the day. I then copied the equations from those regressions into Pinescript, and used the assumption that:
position size = target PnL / (estimated price change for time * tick value)
Therefore, Choosing the number of contracts to trade position sizing for Micro E-mini S&P 500 Futures (MES) based on time of day, holding period, and tick value. This tool leverages historical volatility patterns and log-transformed linear regression models to provide precise recommendations tailored to your trading strategy.
If you want to check out how the regression code worked in python, it is all open source and available on my Github repository for it .
Notes:
The script assumes a log-normal distribution of price movements and is intended as an educational tool to aid in risk management.
It is not a standalone trading system and should be used in conjunction with other trading strategies and risk assessments.
Past performance is not indicative of future results, and traders should exercise caution and adjust their strategies based on personal risk tolerance.
This script is open-source and available for use and modification by the TradingView community. It aims to provide a valuable resource for traders seeking to enhance their risk management practices through data-driven insights.