PROTECTED SOURCE SCRIPT
Atualizado

Gabriel's Swift Moving Average Ribbon

2 701
Gabriel's Swift Moving Average Ribbon is the result of an extensive research and testing process, where I evaluated 72 different moving average (MA) types and their combinations across 1,000 lab trials. From this dataset, I identified the top 1% percentile based on the best Sharpe and Omega ratios. One surprising discovery was that the most effective MAs were either Adaptive Moving Averages (AMA-type) or those already built into TradingView’s native functions. This was somewhat baffling—perhaps because TradingView optimized them for ultra-fast algorithmic trading at millisecond speeds, or they might possess insider knowledge about their superior performance.

I applied the same rigorous testing process to TradingView’s built-in oscillators, selecting the one with the highest Sharpe ratio. While its Sortino ratio might not be as strong, it maintains a similar Omega quality, making it one of the most reliable oscillators for signal generation.

Key Features & Strategy:

Optimized Average Crossovers – Built from the most effective MA types from the top 1% percentile, ensuring robust trend detection and smoother entries/exits. 3 types of Strategies from 9/21 WMA Breakout, 13/48 EMA Swing to 50/200 SMA Leaps using the Angel and Devil Cross system. Its a system based on anticipating the slopes of various MA types using Ehlers SuperSmoother, Butterworth and Mesa to decode Root Mean Squared Deviation of various Market Hidden Cycles using the proprietary Swift 72 MA.

Swift Oscillator for Momentum Analysis – Monitors momentum shifts and confirms trend strength to filter out noise. It's the average sum of Fisherized Normalized Indicators to normalize them into a 0 to 100 range for studies. It Combines the 14 RSI, 18 Stochastic, 20 CCI, 14 MFI, 25/13 TSI, 14 DMI, 14 %R, 9 ROC, and 9 CMO into one Indicator Teal Basis, where the Red line is a 5 SMA of the Basis and the Blue line is a 9 SMA of the Red line. At first glance, this might not make sense as this indicators are popular and are widely used by every retail trader worldwide but that's probably the reason as to why it works well, since it allows one to trade in alignment with what every other technical analyst is looking at, and they typically don't check 9 indicators for confirmation so there is an edge to this. It's Volume and ATR Weighted as well, so it functions as a Smart Money Oscillator as well.

Cyclic Overbought & Oversold Thresholds – Identifies potential reversal points with high precision, helping traders avoid false breakouts using Ehlers Mesa to pinpoint the Dominant Cycle to align trades with prevailing market rhythms, improving timing and accuracy with Time Series Overbought and Ovesold levels. Where the bands compression can determine a squeeze and them expanding can determine an expansion.

Customizable & Versatile – Designed for traders who want a comprehensive yet adaptable moving average system, combined with advanced momentum analysis and cyclic market insights.


This indicator excels in trend-following strategies, momentum trading, and reversal detection. Whether you're a short-term scalper or a long-term trend trader, this tool provides a highly refined and data-driven approach, leveraging the most effective techniques identified through rigorous empirical testing.

Key Features
Multi-MA Selection & Customization:

Choose from multiple moving average types, including:
Simple Moving Average (SMA)
Exponential Moving Average (EMA)
Smooth Rolling Moving Average (SMMA/RMA)
Weighted Moving Average (WMA)
Volume Weighted Moving Average (VWMA)
Hull Moving Average (HMA)
Least Squares Moving Average (LSMA)
Arnaud Legoux Moving Average (ALMA)
Gabriel's Swift MA | Swift 72 MA – A proprietary hybrid MA that takes the average of all major built-in moving averages in TradingView, designed to be a superior smoothing mechanism.
I also have many other MA types, such as KAMA, Jurik, Zero Lag EMA, etc.

Customizable Moving Average Ribbon:

Five individually adjustable moving averages with configurable types, lengths, and colors.
Ability to toggle each MA on or off.
Ideal for trend analysis across different timeframes.

Swift Oscillator – A Multi-Indicator Momentum System:

Integrates multiple momentum-based indicators into a single calculation:
RSI, Stochastic, CCI, MACD, ROC, CMO, DMI, TSI, MFI, and Williams %R.
Normalized to a 0 to 100 Fisherized range for consistent signal strength analysis.

Features three signal components:
Swift Basis Line (Green): A composite average of all included indicators.
Fast Oscillator (Red): An SMA of the Basis Line for short-term momentum shifts.
Slow Oscillator (Blue): A smoothed version of the Fast Oscillator for long-term trend confirmation.

Ehler’s Adaptive Dominant Cycle Detection:

Identifies the dominant cycle length in market data, allowing adaptive smoothing and better timing of reversals.
Helps uncover hidden market cycles for improved trend-following strategies.

Cyclic Overbought & Oversold Thresholds:

MESA Upper Band (Overbought): Dynamically calculated using cyclic memory and market momentum.
MESA Lower Band (Oversold): Adjusted based on historical price action and dominant cycle behavior.

Helps in identifying exhaustion points in price movement.

Visual Enhancements:

Background gradient fills highlight overbought and oversold conditions.
Customizable support/resistance bands (75, 50, and 25 levels) for additional trade confirmation. These correspond with the upper and lower percentile ranks that were tested with, but 66 and 33 work as well.

Fully color-coded for easy interpretation.

How to Use This Indicator:
Utilize the Swift MA Ribbon to gauge trend direction and identify key moving average crossovers.
Monitor the Swift Oscillator for momentum shifts and trend strength confirmation.
Look for Cyclic Overbought & Oversold Thresholds to identify potential reversal points.
Use the dominant cycle detection to align trades with prevailing market rhythms; increase or decrease the Ultimate Smoother for your ideal timeframe.

This indicator is perfect for traders who want a comprehensive yet customizable moving average system, combined with advanced momentum analysis and cyclic market insights. It excels in trend-following strategies, momentum trading, and reversal detection using Slope-based Time Series Angel and Devil alerts.


If you want to know more about the scoring system, here is Investopedia for MPT: investopedia.com/terms/m/modernportfoliotheory.asp. In Sharpe, 1 is slightly profitable, 2 is decent, 3 is good, and anything above 4 is considered to be excellent; once you go past 7, it's supposed to be of Holy Grail quality, but anything past 5 is considered to be kept private by most banks and institutions, as the effort to make such MA takes as much fuel as landing a rocket on the moon. Plus, we don't know how to personalize the settings for each MA for each asset, and so they underperform live as we don't have the correct set of premium settings and tick data to test it out live in the market. This is probably the reason, KAMA, Jurik, VIDYA, and such are so popular because they are almost above 4 in the Sharpe, and their Sortino is stupidly high, so any retail trader can take any random length on it and still make a profit.

Negative values are possible as well; therefore, any system above 0 Sharpe, no matter how slightly, is good for trading, and anything below is less profitable than purchasing intermediate corporate bonds. Also, I found out many MA types from TradingView that had that quality; some from LuxAlgo, such as the TRAMA, didn't have that negative Sharpe quality, but there were other ones from AlexGrover, such as his EQMA, that had that negative Sharpe quality once you had higher length settings in it. It still works, but it's for very specific purposes, and the 14 length is arguably the best and shouldn't be changed, according to his paper, so that's why I didn't include some of the most popular ones from my backtest, as they weren't profitable.

Sortino Score is similar; look it up. It's better for hedging than the Sharpe, as it considers downside risk only, unlike the Sharpe, which considers both up and down. A higher Sortino means a faster recovery from a loss, whereas a higher Sharpe to Sortino Ratio is typically ideal for achieving maximum growth, according to the book "Trading Like a Hedge Fund Manager" I once read. (I don't remember the title at the time, but it was about that.)

Any Sortino above 1.5 is considered to be very green, and anything below 1 is neutral, so you don't need a stop loss; you can just follow it as a binary trade signal if the Sortino is 3 or higher. Similar to Sharpe, achieving a Sortino higher than 5 is notable, and 4 is what most millisecond bots achieve at minimum.

The Omega ratio measures both the gains and losses to determine overall profitability It's similar to looking at your own reward-to-risk ratio; if it's a 2 Omega Ratio, that's a successful 2 R:R, 3 is 3 R:R, and so on. That's what MPT in layman's terms is like; in MPT, it's the most lagging ratio, among the three, as it considers tail risk as well. Do your own research; I trust the Omega Ratio the most to tell how good my system is, but the profit gain is typically measured by the Sharpe, and the recovery from losses or ability to prevent losses in the first place is typically measured by the Sortino, as anything above 7 can typically hedge against market crashes before they actually happen.

I tested it out using my own system and any length from 1 to 252 to determine this z-score, so if it's higher than that, such as a 300 SMA, it might be good. For example, the SPY market crash bottom has been caught 3 times using the 300 SMA, but I didn't include it in my lab results. There are also other MA types, such as the Kalman Filter, that have low Sharpe and Sortino Ratios but an Omega as high as the linear regression MA and higher than many other top MAs with higher Sharpe and Sortino, so it was a bit unfair to put it all the way at the bottom, so I gave it a mention here because it's good, and I use it as a filter for many of my systems and automated bots.
Notas de Lançamento
I added the Crossover and Crossunder i use alongside this indicator, it's of good quality. Remeber this indicator is the average of all indicators everyone in TV is using, so it actually gives you an edge by normalizing it from 0 to 100 and just focusing on the in-build options by TV since every coder outthere must have used it once or twice in the script at least. This average sum gives very little false signals, if you watch carefully.
Notas de Lançamento
I added the Swing and Leap concepts into the Breakout, the Breakout has been my most used one so it's the most backtested. The Swing and Leaps are good too since they are based on the 13/48 and 50/200 cross so they should have substantial confluance behind them as well.
Notas de Lançamento
I fixed the Mesa Auto-Corrective Algorythium that was causing me issues.
Notas de Lançamento
I updated the MESA cycle a bit; I added the Ultimate Smoother to the inputs so users can optimize it as you prefer. 20 will catch most crypto assets such as btc whereas 80 is good for large cap stocks and 125 is for longer trend following in forex, etc.
Notas de Lançamento
I finished adding some tooltips and making sure all the code was working fine.
Notas de Lançamento
I explained the Swift MA Gold Cross system in detail using Tooltips. Please read if you don't trust the rest, I explained it using Sharpe, Sortino and Omega Ratios.
Notas de Lançamento
I updated the MA options by introducing several types. I have yet to add all the types I had tested.
Notas de Lançamento
I updated all the Ma types I wanted; I didn't include the MA types that were below 0 as they just weren't profitable according to MPT theory, but I tested a total of 72. If you want the total list of them, message me, and I will share the Excel sheet, as you might be using one of them, as they are esoteric, and the 112 means that I tested out some combination from the 72, and they were ruled out as well. It's not that they were bad, but they were closer to profitable only under extremely specific circumstances, such as the Tripple Swift 72 AMA that I use to calculate my Bayesian Probability Script. It's close to 1500 lines of code, so if there are any errors, please let me know. The AMA reacts strangely, but that's intentional, so, don't worry about it. I still prefer the original, which I left at the default, and I also shared my first attempt to create an AMA; it's the 5 Prototype Lazy MA; you can try it out. Not much of a deviation from the Swift MA in smoothing since I made them using MPT, so they should, in theory, be similar enough that you won't notice much of a difference. For the lazy 5 line, divide by 2 and subtract 1 from the length, and you will obtain a similar line to the 72 Swift MA.
Notas de Lançamento
I gave it alerts as well, and I added back the Kalman Filter. I think you should look at the Omega Ratio over Sharpe in this one; it's of good quality. The similarity lies in taking an SMA of a Linear Regression; that's not what this filter does, but it behaves in a similar manner afterward.
Notas de Lançamento
I went ahead and made sure the Kalman Filter was incorporated into Gabriel's AMA; it was not there before, so it was bugging out the script a bit.
Notas de Lançamento
I added Multi-timeframe settings for those who have been waiting for it I added the Hull MA as well; it's underrated. I ordered it based on Sharpe; otherwise, it would have been in the top half percentile of the ranked best to worst order list.
Notas de Lançamento
I turned this into a script full of other confluence, so it's a bit long to load.
Notas de Lançamento
I fixed a bug, and I cleaned up the code so it loads 2 seconds faster in lower timeframes.
Notas de Lançamento
I fixed a bunch of things that weren't implemented correctly in the last patch. I will revise it later should I encounter a bug. In this patch, I fixed the alerts for the Bayesian Probability Cross, fixed the DMI, and fixed the Denoised Indicators.
Notas de Lançamento
I added some tooltips and improved the Hull suite by adding a double or single scenario. Neutral is now possible as well, but you may prefer a shorter length such as 120 or less for less lag.
Notas de Lançamento
I did a color improvement for the DMI.
Notas de Lançamento
I improved the Jurik MA, it's now a better MA.

Aviso legal

As informações e publicações não devem ser e não constituem conselhos ou recomendações financeiras, de investimento, de negociação ou de qualquer outro tipo, fornecidas ou endossadas pela TradingView. Leia mais em Termos de uso.