שירותי Pine
Oblique StrategiesHi, this is a fun script that will print an Oblique Strategy to help you think laterally for the day of trading ahead of you.
Oblique Strategies are a concept conceived by Brian Eno the Music Producer, Artist, and modern-day philosopher. Oblique Strategies are a pack of 52 cards that have a creative suggestion on each one. When Brian was at a point at which he could not see a clear way forward in his creations, he would pick out a random card out of the Oblique Strategies pack, to help him think differently as to how to move forward. They are specifically devised for music creators, but i find the help in a multitude of situations.
Enjoy!
MCh Hours Background ColorPermet de visualiser les heures de la journée avec des bandes grises.
À utiliser de préférence sur fond noir ou adapter le code.
BOS with Auto Buy/Sell (ABC Wave & Fib)Break of Structure (BOS) Confirmation
ABC Wave SK System Entry
Fibonacci Retracement Levels (38.2%, 50%, 61.8%)
Auto Buy & Sell Signals
EMA & RSI Filtering for Stronger Trades
Alerts for Entry & Exit
Best Timeframes: 1M, 3M, 5M for Scalping
Amir IndicatorThe indicator shows the watermark ticker, the market cap and the 14 day ATR on left upper side of the screen
andXscalp script this script can be used for quick scalps of minimum 15m time frame and can also work fine in higher time frame too
Advanced Averaged Momentum Indicator (AAMI)Key Features of AAMI:
Combination of Momentum Indicators: It averages normalized values from RSI, MACD histogram, raw Momentum, and Stochastic oscillator to give a comprehensive view of momentum.
Normalization: Each component is normalized to a scale from -1 to 1 to ensure they contribute equally to the AMI calculation.
Visual Cues: The indicator includes visual levels for neutral, overbought, and oversold conditions to aid in quick decision-making.
Alerts: Basic alert conditions are included for when AMI moves into overbought or oversold territory, which traders can customize further.
Customizable: All parameters can be adjusted within TradingView to tailor the indicator to different market conditions or trading strategies.
Smoothing: Included an SMA for AMI to reduce noise and give smoother signals.
Divergence Detection: Implemented a basic divergence detection mechanism to spot potential reversals.
Usage Tips:
Overbought/Oversold: When AMI goes above 0.7, it might suggest an overbought condition, potentially signaling a sell or take profit. Below -0.7 might indicate oversold conditions, suggesting a buy opportunity.
Divergence: Watch for divergences between the AMI and price action for signals of potential trend reversals.
Crossing Zero: The AMI crossing from negative to positive might be used as a buy signal, and vice versa for a sell signal.
This script provides a new way to view momentum by consolidating multiple traditional indicators into one, potentially offering clearer signals in complex market environments.
Boilerplate Configurable Strategy [Yosiet]This is a Boilerplate Code!
Hello! First of all, let me introduce myself a little bit. I don't come from the world of finance, but from the world of information and communication technologies (ICT) where we specialize in data processing with the aim of automating it and eliminating all human factors and actors in the processes. You could say that I am an algotrader.
That said, in my journey through trading in recent years I have understood that this world is often shown to be incomplete. All those who want to learn about trading only end up learning a small part of what it really entails, they only seek to learn how to read candlesticks. Therefore, I want to share with the entire community a fraction of what I have really understood it to be.
As a computer scientist, the most important thing is the data, it is the raw material of our work and without data you simply cannot do anything. Entropy is simple: Data in -> Data is transformed -> Data out.
The quality of the outgoing data will directly depend on the incoming data, there is no greater mystery or magic in the process. In trading it is no different, because at the end of the day it is nothing more than data. As we often say, if garbage comes in, garbage comes out.
Most people focus on the results only, on the outgoing data, because in the end we all want the same thing, to make easy money. Very few pay attention to the input data, much less to the process.
Now, I am not here to delude you, because there is no bigger lie than easy money, but I am here to give you a boilerplate code that will help you create strategies where you only have to concentrate on the quality of the incoming data.
To the Point
The code is a strategy boilerplate that applies the technique that you decide to customize for the criteria for opening a position. It already has the other factors involved in trading programmed and automated.
1. The Entry
This section of the boilerplate is the one that each individual must customize according to their needs and knowledge. The code is offered with two simple, well-known strategies to exemplify how the code can be reused for your own benefits.
For the purposes of this post on tradingview, I am going to use the simplest of the known strategies in trading for entries: SMA Crossing
// SMA Cross Settings
maFast = ta.sma(close, length)
maSlow = ta.sma(open, length)
The Strategy Properties for all cases published here:
For Stock TSLA H1 From 01/01/2025 To 02/15/2025
For Crypto XMR-USDT 30m From 01/01/2025 To 02/15/2025
For Forex EUR-USD 5m From 01/01/2025 To 02/15/2025
But the goal of this post is not to sell you a dream, else to show you that the same Entry decision works very well for some and does not for others and with this boilerplate code you only have to think of entries, not exits.
2. Schedules, Days, Sessions
As you know, there are an infinite number of markets that are susceptible to the sessions of each country and the news that they announce during those sessions, so the code already offers parameters so that you can condition the days and hours of operation, filter the best time parameters for a specific market and time frame.
3. Data Filtering
The data offered in trading are numerical series presented in vectors on a time axis where an endless number of mathematical equations can be applied to process them, with matrix calculation and non-linear regressions being the best, in my humble opinion.
4. Read Fundamental Macroeconomic Events, News
The boilerplate has integration with the tradingview SDK to detect when news will occur and offers parameters so that you can enable an exclusion time margin to not operate anything during that time window.
5. Direction and Sense
In my experience I have found the peculiarity that the same algorithm works very well for a market in a time frame, but for the same market in another time frame it is only a waste of time and money. So now you can easily decide if you only want to open LONG, SHORT or both side positions and know how effective your strategy really is.
6. Reading the money, THE PURPOSE OF EVERYTHING
The most important section in trading and the reason why many clients usually hire me as a financial programmer, is reading and controlling the money, because in the end everyone wants to win and no one wants to lose. Now they can easily parameterize how the money should flow and this is the genius of this boilerplate, because it is what will really decide if an algorithm (Indicator: A bunch of math equations) for entries will really leave you good money over time.
7. Managing the Risk, The Ego Destroyer
Many trades, little money. Most traders focus on making money and none of them know about statistics and the few who do know something about it, only focus on the winrate. Well, with this code you can unlock what really matters, the true success criteria to be able to live off of trading: Profit Factor, Sortino Ratio, Sharpe Ratio and most importantly, will you really make money?
8. Managing Emotions
Finally, the main reason why many lose money is because they are very bad at managing their emotions, because with this they will no longer need to do so because the boilerplate has already programmed criteria to chase the price in a position, cut losses and maximize profits.
In short, this is a boilerplate code that already has the data processing and data output ready, you only have to worry about the data input.
“And so the trader learned: the greatest edge was not in predicting the storm, but in building a boat that could not sink.”
DISCLAIMER
This post is intended for programmers and quantitative traders who already have a certain level of knowledge and experience. It is not intended to be financial advice or to sell you any money-making script, if you use it, you do so at your own risk.
Cluster Reversal Zones📌 Cluster Reversal Zones – Smart Market Turning Point Detector
📌 Category : Public (Restricted/Closed-Source) Indicator
📌 Designed for : Traders looking for high-accuracy reversal zones based on price clustering & liquidity shifts.
🔍 Overview
The Cluster Reversal Zones Indicator is an advanced market reversal detection tool that helps traders identify key turning points using a combination of price clustering, order flow analysis, and liquidity tracking. Instead of relying on static support and resistance levels, this tool dynamically adjusts to live market conditions, ensuring traders get the most accurate reversal signals possible.
📊 Core Features:
✅ Real-Time Reversal Zone Mapping – Detects high-probability market turning points using price clustering & order flow imbalance.
✅ Liquidity-Based Support/Resistance Detection – Identifies strong rejection zones based on real-time liquidity shifts.
✅ Order Flow Sensitivity for Smart Filtering – Filters out weak reversals by detecting real market participation behind price movements.
✅ Momentum Divergence for Confirmation – Aligns reversal zones with momentum divergences to increase accuracy.
✅ Adaptive Risk Management System – Adjusts risk parameters dynamically based on volatility and trend state.
🔒 Justification for Mashup
The Cluster Reversal Zones Indicator contains custom-built methodologies that extend beyond traditional support/resistance indicators:
✔ Smart Price Clustering Algorithm: Instead of plotting fixed support/resistance lines, this system analyzes historical price clustering to detect active reversal areas.
✔ Order Flow Delta & Liquidity Shift Sensitivity: The tool tracks real-time order flow data, identifying price zones with the highest accumulation or distribution levels.
✔ Momentum-Based Reversal Validation: Unlike traditional indicators, this tool requires a momentum shift confirmation before validating a potential reversal.
✔ Adaptive Reversal Filtering Mechanism: Uses a combination of historical confluence detection + live market validation to improve accuracy.
🛠️ How to Use:
• Works well for reversal traders, scalpers, and swing traders seeking precise turning points.
• Best combined with VWAP, Market Profile, and Delta Volume indicators for confirmation.
• Suitable for Forex, Indices, Commodities, Crypto, and Stock markets.
🚨 Important Note:
For educational & analytical purposes only.
Candle Momentum ExhaustionCandle Momentum Exhaustion
The Candle Momentum Exhaustion indicator is designed to help traders spot potential turning points in a trend by identifying when the prevailing momentum may be “running on empty.” The indicator works by comparing the size of each candle’s body (the absolute difference between the open and close) to the average body size over a recent period. When a candle’s body exceeds a user‐defined multiple of this average, it is flagged as an “exhaustion” candle.
• A bullish exhaustion (shown with a red down–facing triangle above the bar) occurs when a very large bullish candle (close > open) is detected, suggesting that buyers may have pushed the price too far and the rally could be near its end.
• A bearish exhaustion (shown with a green up–facing triangle below the bar) occurs when a very large bearish candle (close < open) is detected, implying that selling pressure might be overdone.
These signals can alert you to a potential reversal or consolidation point. The script also includes alert conditions so that you can set up notifications whenever an exhaustion signal is generated.
How It Works
1. Average Candle Body:
The script computes a simple moving average (SMA) of the absolute candle bodies over a user-defined period (default is 14 bars).
2. Exhaustion Candidate:
A candle is flagged as an exhaustion candidate if its body size exceeds the average by more than the set multiplier (default is 2.0).
3. Signal Identification:
• If the exhaustion candle is bullish (close > open), it is marked with a red down–facing triangle above the bar.
• If it is bearish (close < open), it is marked with a green up–facing triangle below the bar.
4. Alerts:
The built-in alertcondition() calls allow you to set alerts (via TradingView’s alert system) so that you can be notified when an exhaustion event occurs.
Risk Disclaimer:
This indicator is provided for educational and informational purposes only and does not constitute financial, investment, or trading advice. Trading and investing involve significant risk, and you should not rely solely on this indicator when making any trading decisions. Past performance is not indicative of future results. Always perform your own due diligence and consult with a qualified financial advisor before making any financial decisions. The creator of this indicator shall not be held responsible for any losses incurred through its use.
Starfield Scroller█ OVERVIEW
This script creates a visually appealing starfield effect on your chart. It generates and animates multiple star fields, each customizable with its own parameters. Explore the input options to adjust the number of stars, their speed, and color.
█ CONCEPTS
The script is a simple demonstration, and utilizes a custom `starfield` function and my `geo` library for point management. It simulates a parallax effect by creating stars at random positions and moving them across the chart at varying speeds.
Star Creation
• Stars are generated with random X and Y coordinates within defined boundaries.
• Each star is assigned a random speed factor, influencing its movement speed.
• Star color is also influenced by its speed; faster stars appear more transparent.
Star Movement & Management
• The script maintains a dynamic array of Star structures. Each Star structure holds the star's creation bar index, location (as a Point ), speed factor, and the label used to display it.
• On each new bar, new stars are created and added to the array.
• Stars are moved horizontally based on their speed factor.
• Stars that move off-screen are deleted to manage resource usage.
• The maximum number of stars for each starfield instance is controlled by an input parameter.
Parallax Effect
• The varying speeds of the stars create a parallax effect, giving the illusion of depth to the starfield.
█ FEATURES
This script includes two independent starfield instances, each configurable via inputs.
Starfield 1:
• Max Stars 1: Maximum number of stars in the first starfield.
• New Stars Per Bar 1: Number of new stars created per bar for the first starfield.
• Max Star Speed 1: Maximum speed of the stars in the first starfield.
• Star Color 1: Color of the stars in the first starfield.
Starfield 2:
• Max Stars 2: Maximum number of stars in the second starfield.
• New Stars Per Bar 2: Number of new stars created per bar for the second starfield.
• Max Star Speed 2: Maximum speed of the stars in the second starfield.
• Star Color 2: Color of the stars in the second starfield.
█ HOW TO USE
1 — Add the script to your chart.
2 — Adjust the input parameters for each starfield to customize its appearance and behavior.
3 — Observe the animated starfield effect.
█ LIMITATIONS
• Excessive numbers of stars may impact performance. Adjust the maximum number of stars and new stars per bar accordingly.
• The script uses labels for rendering stars, which can have limitations on certain chart timeframes and settings.
█ NOTES
This script is intended for visual enhancement and does not provide trading signals. It demonstrates the use of custom types, arrays, and functions for creating complex visual effects in Pine Script™. The `geo` library is used for consistent point calculations.
█ THANKS
Thanks to the TradingView community for inspiration and support.
KEMAD | QuantumResearchQuantumResearch KEMAD Indicator
The QuantumResearch KEMAD Indicator is a sophisticated trend-following and volatility-based tool designed for traders who demand precision in detecting market trends and price reversals. By leveraging advanced techniques implemented in PineScript, this indicator integrates a Kalman filter, an Exponential Moving Average (EMA), and dynamic ATR-based deviation bands to produce clear, actionable trading signals.
1. Overview
The KEMAD Indicator aims to:
Reduce Market Noise: Employ a Kalman filter to smooth price data.
Identify Trends: Use an EMA of the filtered price to define the prevailing market direction.
Set Dynamic Thresholds: Adjust breakout levels with ATR-based deviation bands.
Generate Signals: Provide clear long and short trading signals along with intuitive visual cues.
2. How It Works
A. Kalman Filter Smoothing
Purpose: The Kalman filter refines the selected price source (e.g., close price) by reducing short-term fluctuations, thus offering a clearer view of the underlying price movement.
Customization: Users can adjust key parameters such as:
Process Noise: Controls the filter’s sensitivity to recent changes.
Measurement Noise: Determines how responsive the filter is to incoming price data.
Filter Order: Sets the number of data points considered in the smoothing process.
B. EMA-Based Trend Detection
Primary Trend EMA: A 25-period EMA is applied to the Kalman-filtered price, serving as the core trend indicator.
Signal Mechanism:
Long Signal: Triggered when the price exceeds the EMA plus an ATR-based upper deviation.
Short Signal: Triggered when the price falls below the EMA minus an ATR-based lower deviation.
C. ATR Deviation Bands
ATR Utilization: The Average True Range (ATR) is computed (default length of 21) to assess market volatility.
Dynamic Thresholds:
Upper Deviation: Calculated by adding 1.5× ATR to the EMA (for long signals).
Lower Deviation: Calculated by subtracting 1.1× ATR from the EMA (for short signals).
These bands adapt to current volatility, ensuring that signal thresholds are both dynamic and market-sensitive.
3. Visual Representation
The indicator’s design emphasizes clarity and ease of use:
Color-Coded Bar Signals:
Green Bars: Indicate bullish conditions when a long signal is active.
Red Bars: Indicate bearish conditions when a short signal is active.
Trend Confirmation Line: A 54-period EMA is plotted to further validate trend direction. Its color dynamically changes to reflect the active trend.
Background Fill: The space between a calculated price midpoint (typically the average of high and low) and the EMA is filled, visually emphasizing the prevailing market trend.
4. Customization & Parameters
The KEMAD Indicator is highly configurable, allowing traders to tailor the tool to their specific trading strategies and market conditions:
ATR Settings:
ATR Length: Default is 21; adjusts sensitivity to market volatility.
EMA Settings:
Trend EMA Length: Default is 25; smooths price action for trend detection.
Confirmation EMA Length: Default is 54; aids in confirming the trend.
Kalman Filter Parameters:
Process Noise: Default is 0.01.
Measurement Noise: Default is 3.0.
Filter Order: Default is 5.
Deviation Multipliers:
Long Signal Multiplier: Default is 1.5× ATR.
Short Signal Multiplier: Default is 1.1× ATR.
Appearance: Eight customizable color themes are available to suit individual visual preferences.
5. Trading Applications
The versatility of the KEMAD Indicator makes it suitable for various trading strategies:
Trend Following: It helps identify and ride sustained bullish or bearish trends by filtering out market noise.
Breakout Trading: Detects when prices move beyond the ATR-based deviation bands, signaling potential breakout opportunities.
Reversal Detection: Alerts traders to potential trend reversals when price crosses the dynamically smoothed EMA.
Risk Management: Offers clearly defined entry and exit points, based on volatility-adjusted thresholds, enhancing trade precision and risk control.
6. Final Thoughts
The QuantumResearch KEMAD Indicator represents a unique blend of advanced filtering (via the Kalman filter), robust trend analysis (using EMAs), and dynamic volatility assessment (through ATR deviation bands).
Its PineScript implementation allows for a high degree of customization, making it an invaluable tool for traders looking to reduce noise, accurately detect trends, and manage risk effectively.
Whether used for trend following, breakout strategies, or reversal detection, the KEMAD Indicator is designed to adapt to varying market conditions and trading styles.
Important Disclaimer: Past data does not predict future behavior. This indicator is provided for informational purposes only; no indicator or strategy can guarantee future results. Always perform thorough analysis and use proper risk management before trading.
Walk Forward PatternsINTRO
In Euclidean geometry, every mathematical output has a planar projection. 'Walk Forward Patterns' can be considered a practical example of this concept. On the other hand, this indicator might also be viewed as an experiment in 'how playing with Lego as a child contributes to time series analysis' :)
OVERVIEW
This script dynamically generates the necessary optimization and testing ranges for Walk Forward Analysis based on user-defined bar count and length inputs. It performs automatic calculations for each step, offers 8 different window options depending on the inputs, and visualizes the results dynamically. I should also note that most of the window models consist of original patterns I have created.
ADDITIONAL INFO : WHAT IS WALK FORWARD ANALYSIS?
Although it is not the main focus of this indicator, providing a brief definition of Walk Forward Analysis can be helpful in correctly interpreting the results it generates. Walk Forward Analysis (WFA) is a systematic method for optimizing parameters and validating trading strategies. It involves dividing historical data into variable segments, where a strategy is first optimized on an in-sample period and then tested on an out-of-sample period. This process repeats by shifting the windows forward, ensuring that each test evaluates the strategy on unseen data, helping to assess its robustness and adaptability in real market conditions.
ORIGINALITY
There are very few studies on Walk Forward Analysis in TradingView. Even worse, there are no any open-source studies available. Someone has to start somewhere, I suppose. And in my personal opinion, determining the optimization and backtest intervals is the most challenging part of WFA. These intervals serve as a prerequisite for automated parameter optimization. I felt the need to publish this pattern module, which I use in my own WFA models, partly due to this gap on community scripts.
INDICATOR MECHANICS
To use the indicator effectively, you only need to perform four simple tasks:
Specify the total number of bars in your chart in the 'Bar Index' parameter.
Define the optimization (In-Sample Test) length.
Define the testing (Out-Of-Sample Test) length.
Finally, select the window type.
The indicator automatically models everything else (including the number of steps) based on your inputs. And the result; you now have a clear idea of which bars to use for your Walk Forward tests!
A COMMONLY USED WINDOW SELECTION METHOD: ROLLING
A more concrete definition of Walk Forward Analysis, specifically for the widely used Rolling method, can be described as follows:
Parameters that have performed well over a certain period are identified (Optimization: In-Sample).
These parameters are then tested on a shorter, subsequent period (Backtest: Out-of-Sample).
The process is repeated forward in time (At each step, the optimization and backtest periods are shifted by the backtest length).
If the cumulative percentage profit obtained from the backtest results is greater than half of the historical optimization profit, the strategy is considered "successful."
If the strategy is successful, the most recent (untested) optimization values are used for live trading.
OTHER WINDOW OPTIONS
ANCHORED: That's a pattern based on progressively expanding optimization ranges at each step. Backtest ranges move forward in a staircase-like manner.
STATIC: Optimization ranges remain fixed, while backtest ranges are shifted forward.
BLOCKED: Optimization ranges are shifted forward in groups of three blocks. Backtest ranges are also shifted in a staircase manner, even at the cost of creating gaps from the optimization end bars.
TRIANGULAR: Optimization ranges are shifted forward in triangular regions, while backtest ranges move in a staircase pattern.
RATIO: The optimization length increases by 25% of the initial step’s fixed length at each step. In other words, the length grows by 25% of the first step's length incrementally. Backtest ranges always start from the bar where the optimization ends.
FIBONACCI: A variation of the Ratio method, where the optimization shift factor is set to 0.618
RANDOM WALK
Unlike the window models explained above, we can also generate optimization and backtest ranges completely randomly—offering almost unlimited variations! When you select the "Random" option in the "Window" parameter on the indicator interface, random intervals are generated based on various trigonometric calculations. By changing the numerical value in the '🐒' parameter, you can create entirely unique patterns.
WHY THE 🐒 EMOJI?
Two reasons.
First, I think that as humanity, we are a species of tailless primates who become happy when we understand things :). At least evolutionarily. The entire history of civilization is built on the effort to express the universe in a scale we can comprehend. 'Knowledge' is an invention born from this effort, which is why we feel happiness when we 'understand'. Second, I can't think of a better metaphor for randomness than a monkey sitting at a keyboard. See: Monkey Test.
Anyway, I’m rambling :)
NOTES
The indicator generates results for up to 100 steps. As the number of steps increases, the table may extend beyond the screen—don’t forget to zoom out!
FINAL WORDS
I haven’t published a Walk Forward script yet . However, there seem to be examples that can perform parameter optimization in the true sense of the word, producing more realistic results without falling into overfitting in my library. Hopefully, I’ll have the chance to publish one in the coming weeks. Sincerely thanks to Kıvanç Özbilgiç, Robert Pardo, Kevin Davey, Ernest P. Chan for their inspiring publishments.
DISCLAIMER
That's just a script, nothing more. I hope it helps everyone. Do not forget to manage your risk. And trade as safely as possible. Best of luck!
© dg_factor
Moving Averages With Continuous Periods [macp]This script reimagines traditional moving averages by introducing floating-point period calculations, allowing for fractional lengths rather than being constrained to whole numbers. At its core, it provides SMA, WMA, and HMA variants that can work with any decimal length, which proves especially valuable when creating dynamic indicators or fine-tuning existing strategies.
The most significant improvement lies in the Hull Moving Average implementation. By properly handling floating-point mathematics throughout the calculation chain, this version reduces the overshoot tendencies that often plague integer-based HMAs. The result is a more responsive yet controlled indicator that better captures price action without excessive whipsaw.
The visual aspect incorporates a trend gradient system that can adapt to different trading styles. Rather than using fixed coloring, it offers several modes ranging from simple solid colors to more nuanced three-tone gradients that help identify trend transitions. These gradients are normalized against ATR to provide context-aware visual feedback about trend strength.
From a practical standpoint, the floating-point approach eliminates the subtle discontinuities that occur when integer-based moving averages switch periods. This makes the indicator particularly useful in systems where the MA period itself is calculated from market conditions, as it can smoothly transition between different lengths without artificial jumps.
At the heart of this implementation lies the concept of continuous weights rather than discrete summation. Traditional moving averages treat each period as a distinct unit with integer indexing. However, when we move to floating-point periods, we need to consider how fractional periods should behave. This leads us to some interesting mathematical considerations.
Consider the Weighted Moving Average kernel. The weight function is fundamentally a slope: -x + length where x represents the position in the averaging window. The normalization constant is calculated by integrating (in our discrete case, summing) this slope across the window. What makes this implementation special is how it handles the fractional component - when the length isn't a whole number, the final period gets weighted proportionally to its fractional part.
For the Hull Moving Average, the mathematics become particularly intriguing. The standard HMA formula HMA = WMA(2*WMA(price, n/2) - WMA(price, n), sqrt(n)) is preserved, but now each WMA calculation operates in continuous space. This creates a smoother cascade of weights that better preserves the original intent of the Hull design - to reduce lag while maintaining smoothness.
The Simple Moving Average's treatment of fractional periods is perhaps the most elegant. For a length like 9.7, it weights the first 9 periods fully and the 10th period at 0.7 of its value. This creates a natural transition between integer periods that traditional implementations miss entirely.
The Gradient Mathematics
The trend gradient system employs normalized angular calculations to determine color transitions. By taking the arctangent of price changes normalized by ATR, we create a bounded space between 0 and 1 that represents trend intensity. The formula (arctan(Δprice/ATR) + 90°)/180° maps trend angles to this normalized space, allowing for smooth color transitions that respect market volatility context.
This mathematical framework creates a more theoretically sound foundation for moving averages, one that better reflects the continuous nature of price movement in financial markets. The implementation recognizes that time in markets isn't truly discrete - our sampling might be, but the underlying process we're trying to measure is continuous. By allowing for fractional periods, we're creating a better approximation of this continuous reality.
This floating-point moving average implementation offers tangible benefits for traders and analysts who need precise control over their indicators. The ability to fine-tune periods and create smooth transitions makes it particularly valuable for automated systems where moving average lengths are dynamically calculated from market conditions. The Hull Moving Average calculation now accurately reflects its mathematical formula while maintaining responsiveness, making it a practical choice for both systematic and discretionary trading approaches. Whether you're building dynamic indicators, optimizing existing strategies, or simply want more precise control over your moving averages, this implementation provides the mathematical foundation to do so effectively.
[AcerX] Leverage, TP & Optimal TP CalculatorHow It Works
Inputs:
Portfolio Allocation (%): The percentage of your portfolio you're willing to risk on the trade.
Stop Loss (%): The stop loss distance below the entry price.
Taker Fee (%) and Maker Fee (%): The fees applied on entry and exit.
Calculations:
The script calculates the required "raw" leverage to risk 1% of your portfolio.
It floors the computed leverage to an integer ("effectiveLeverage").
If the computed leverage is less than 1, it shows an error message (and suggests the maximum allocation for at least 1× leverage).
Otherwise, it calculates the TP levels for target profits of 1.2%, 1.5%, and 2%, and an "Optimal TP" that nets a 1% profit after fees.
Display:
A table is drawn on the top right corner of your chart displaying the effective leverage, the TP levels, and an error message if applicable.
Simply add this script as a new indicator in TradingView, and adjust the inputs as needed.
Happy trading!
RT + TL v12This is a script to populate gamma/vanna/charm levels from option greeks heatmaps in Vexly. Heavy levels indicate levels with highest confluence. TLU and TLL are upper and lower levels. The levels are posted everyday on their discord server.
Range Trader another tool in Vexly, the levels from which can be plotted as well. Just copy the headline from range trader into "RT Range" and the modes into "RT mode"
Example:
RT Mode will take this string as input and plot the levels:
upper_mode
6049.037
mp_mode
6035.407
lower_mode
6021.776
RT Range will take this string as input and plot the levels:
6044.893 - 6017.652
Hope this helps
QoQ Economic & Financial Indicator ChangesA straightforward indicator for analyzing quarter-over-quarter (QoQ) percentage changes in economic and financial data series. Perfect for visualizing dynamic changes in:
Economic Indicators (GDP, House Price Indices, Employment Figures)
Company Financial Metrics (Revenue, EPS, Operating Margins)
Balance Sheet Items (Assets, Liabilities, Equity)
Cash Flow Statement Components
Other Quarterly Economic & Financial Data
Features:
Automatically calculates QoQ percentage changes
Color-coded visualization (green for positive, red for negative changes)
Displays exact percentage values
Includes adjustable scale factor for different data series
Zero line reference for easy trend identification
EUR/USD vs USD/CHF SpreadA typical Pine Script for spread trading would include:
Fetching Data: Getting the real-time price of EUR/USD and USD/CHF.
Calculating the Synthetic EUR/CHF Price: Since EUR/USD * USD/CHF ≈ EUR/CHF, we use this relation to analyze deviations.
Computing the Spread: Taking the difference between EUR/USD and the synthetic EUR/CHF price.
Z-Score Normalization: Measuring how far the spread deviates from the mean (Mean Reversion).
Overlay and Visuals: Plotting the spread and key levels to visualize trading signals.
TOTAL3/BTC This Pine Script™ code, named "TOTAL3/BTC with Arrow," is designed for cryptocurrency analysis on TradingView.
This script essentially provides a visual tool for traders to gauge when altcoins might be gaining or losing ground relative to Bitcoin through moving average analysis and color-coded trend indication.
Intention was to help the community with a script based on classic TA only.
Use it with SASDv2r indicator.
Feel free to make it better. If you did so, please let me know.
Main elements:
Data Fetching: It retrieves market cap data for all cryptocurrencies excluding Bitcoin and Ethereum (TOTAL3) and for Bitcoin (BTC).
Ratio Calculation: The script calculates the ratio of TOTAL3 to BTC market caps, which indicates how altcoins (excluding ETH) are performing relative to Bitcoin.
Plotting the Ratio: This ratio is plotted on the chart with a blue line, allowing traders to see the relative performance visually.
Moving Averages: Two Simple Moving Averages (SMA) are calculated for this ratio, one for 20 periods (ma20) and another for 50 periods (ma50), though these are not plotted in the current version of the code.
Reference Lines: Horizontal lines are added at ratios of 0.3 and 0.8 to serve as visual equilibrium points or thresholds for analysis.
Complex Moving Average: The script uses constants (len, len2, cc, smoothe) from another script, suggesting it's adapting or simplifying another's logic for multi-timeframe analysis.
Average Calculation: Two SMAs (avg and avg2) are computed using the constants defined, focusing on different lengths for trend analysis.
Direction Determination: It checks if the moving average is trending up or down by comparing the current value with its value smoothe bars earlier.
Color Coding: The color of the plotted moving average changes based on its direction (lime for up, red for down, aqua if no clear direction), aiding in quick visual interpretation of trends.
Plotting: Finally, the script plots this multi-timeframe moving average with a dynamic color to reflect the current market trend of the TOTAL3/BTC ratio, with a thicker line for visibility.