VD Zig Zag with SMAIntroduction
The VD Zig Zag with SMA indicator is a powerful tool designed to streamline technical analysis by combining Zig Zag swing lines with a Simple Moving Average (SMA). It offers traders a clear and intuitive way to analyze price trends, market structure, and potential reversals, all within a customizable framework.
Definition
The Zig Zag indicator is a trend-following tool that highlights significant price movements by filtering out smaller fluctuations. It visually connects swing highs and lows to reveal the underlying market structure. When paired with an SMA, it provides an additional layer of trend confirmation, helping traders align their strategies with market momentum.
Calculations
Zig Zag Logic:
Swing highs and lows are determined using a user-defined length parameter.
The highest and lowest points within the specified range are identified using the ta.highest() and ta.lowest() functions.
Zig Zag lines dynamically connect these swing points to visually map price movements.
SMA Logic:
The SMA is calculated using the closing prices over a user-defined period.
It smooths out price action to provide a clearer view of the prevailing trend.
The indicator allows traders to adjust the Zig Zag length and SMA period to suit their preferred trading timeframe and strategy.
Takeaways
Enhanced Trend Analysis: The Zig Zag lines clearly define the market's structural highs and lows, helping traders identify trends and reversals.
Customizable Parameters: Both the swing length and SMA period can be tailored for short-term or long-term trading strategies.
Visual Clarity: By filtering out noise, the indicator simplifies chart analysis and enables better decision-making.
Multi-Timeframe Support: Adapts seamlessly to the chart's timeframe, ensuring usability across all trading horizons.
Limitations
Lagging Nature: As with any indicator, the Zig Zag and SMA components are reactive and may lag during sudden price movements.
Sensitivity to Parameters: Improper parameter settings can lead to overfitting, where the indicator reacts too sensitively or misses significant trends.
Does Not Predict: This indicator identifies trends and structure but does not provide forward-looking predictions.
Summary
The VD Zig Zag with SMA indicator is a versatile and easy-to-use tool that combines the strengths of Zig Zag swing analysis and moving average trends. It helps traders filter market noise, visualize structural patterns, and confirm trends with greater confidence. While it comes with limitations inherent to all technical tools, its customizable features and multi-timeframe adaptability make it an excellent addition to any trader’s toolkit.
Additional Features
Have an idea or a feature you'd like to see added?
Feel free to reach out or share your suggestions here—I’m always open to updates!
Moving_average
ToolsLibrary "Tools"
Common tools
movingAverage(maType, maSource, maLength)
dynamically returns MA
Parameters:
maType (string) : ma type
maSource (float) : ma source
maLength (simple int) : ma length
Returns: ta.{sma,rma,ema,wma,vwma,hma}
Moving AveragesWhile this "Moving Averages" indicator may not revolutionize technical analysis, it certainly offers a valuable and efficient solution for traders seeking to streamline their chart analysis process. This all-in-one tool addresses a common frustration among traders: the need to constantly search for and compare different types and lengths of moving averages.
Key Features
The indicator allows for the configuration of up to 5 moving averages simultaneously, providing a comprehensive view of price trends. Users can choose from 7 types of moving averages for each line, including SMA, EMA, WMA, VWMA, HMA, SMMA, and TMA. This variety ensures that traders can apply their preferred moving average types without the need for multiple indicators.
Each moving average can be fully customized in terms of length, color, line style, and thickness, allowing for clear visual differentiation. However, what sets this indicator apart is its "Smart Opacity" feature. When activated, this option dynamically adjusts the transparency of the moving average lines based on their direction, with ascending lines appearing more opaque and descending lines more transparent. This subtle yet effective visual cue aids in quickly identifying trend changes and potential trading signals.
Advantages
The primary benefit of this indicator lies in its convenience. By consolidating multiple moving averages into a single, customizable tool, it saves traders valuable time and reduces chart clutter. The Smart Opacity feature, while not groundbreaking, does offer an intuitive way to visualize trend strength and direction at a glance.
Moreover, the indicator's flexibility makes it suitable for various trading styles and experience levels. Whether you're a novice trader learning to interpret basic trend signals or an experienced analyst fine-tuning a complex strategy, this tool can adapt to your needs.
In conclusion, while this "Moving Averages" indicator may not be a game-changer in the world of technical analysis, it represents a thoughtful refinement of a fundamental trading tool. By focusing on user convenience and visual clarity, it offers a practical solution for traders looking to optimize their chart analysis process and make more informed trading decisions.
$TUBR: 7-25-99 Moving Average7, 25, and 99 Period Moving Averages
This indicator plots three moving averages: the 7-period, 25-period, and 99-period Simple Moving Averages (SMA). These moving averages are widely used to smooth out price action and help traders identify trends over different time frames. Let's break down the significance of these specific moving averages from both supply and demand perspectives and a price action perspective.
1. Supply and Demand Perspective:
- 7-period Moving Average (Short-Term) :
The 7-period moving average represents the short-term sentiment in the market. It captures the rapid fluctuations in price and is heavily influenced by recent supply and demand changes. Traders often look to the 7-period SMA for immediate price momentum, with price moving above or below this line signaling short-term strength or weakness.
- Bullish Supply/Demand : When price is above the 7-period SMA, it suggests that buyers are currently in control and demand is higher than supply. Conversely, price falling below this line indicates that supply is overpowering demand, leading to a short-term downtrend.
Is current price > average price in past 7 candles (depending on timeframe)? This will tell you how aggressive buyers are in short term.
- Key Supply/Demand Zones : The 7-period SMA often acts as dynamic support or resistance in a trending market, where traders might use it to enter or exit positions based on how price interacts with this level.
- 25-period Moving Average (Medium-Term) :
The 25-period SMA smooths out more of the noise compared to the 7-period, providing a more stable indication of intermediate trends. This moving average is often used to gauge the market's supply and demand balance over a broader timeframe than the short-term 7-period SMA.
- Supply/Demand Balance : The 25-period SMA reflects the medium-term equilibrium between supply and demand. A crossover between the price and the 25-period SMA may indicate a shift in this balance. When price sustains above the 25-period SMA, it shows that demand is strong enough to maintain an upward trend. Conversely, if the price stays below it, supply is likely exceeding demand.
Is current price > average price in past 25 candles (depending on timeframe)? This will tell you how aggressive buyers are in mid term.
- Momentum Shift : Crossovers between the 7-period and 25-period SMAs can indicate momentum shifts between short-term and medium-term demand. For example, if the 7-period crosses above the 25-period, it often signifies growing short-term demand relative to the medium-term trend, signaling potential buy opportunities. What this crossover means is that if 7MA > 25MA that means in past 7 candles average price is more than past 25 candles.
- 99-period Moving Average (Long-Term):
The 99-period SMA represents the long-term trend and reflects the market's supply and demand over an extended period. This moving average filters out short-term fluctuations and highlights the market's overall trajectory.
- Long-Term Supply/Demand Dynamics : The 99-period SMA is slower to react to changes in supply and demand, providing a more stable view of the market's overall trend. Price staying above this line shows sustained demand dominance, while price consistently staying below reflects ongoing supply pressure.
Is current price > average price in past 99 candles (depending on timeframe)? This will tell you how aggressive buyers are in long term.
- Market Trend Confirmation : When both the 7-period and 25-period SMAs are above the 99-period SMA, it signals a strong bullish trend with demand outweighing supply across all timeframes. If all three SMAs are below the 99-period SMA, it points to a bear market where supply is overpowering demand in both the short and long term.
2. Price Action Perspective :
- 7-period Moving Average (Short-Term Trends):
The 7-period moving average closely tracks price action, making it highly responsive to quick shifts in price. Traders often use it to confirm short-term reversals or continuations in price action. In an uptrend, price typically stays above the 7-period SMA, whereas in a downtrend, price stays below it.
- Short-Term Price Reversals : Crossovers between the price and the 7-period SMA often indicate short-term reversals. When price breaks above the 7-period SMA after staying below it, it suggests a potential bullish reversal. Conversely, a price breakdown below the 7-period SMA could signal a bearish reversal.
- 25-period Moving Average (Medium-Term Trends) :
The 25-period SMA helps identify the medium-term price action trend. It balances short-term volatility and longer-term stability, providing insight into the more persistent trend. Price pullbacks to the 25-period SMA during an uptrend can act as a buying opportunity for trend traders, while pullbacks during a downtrend may offer shorting opportunities.
- Pullback and Continuation: In trending markets, price often retraces to the 25-period SMA before continuing in the direction of the trend. For instance, if the price is in a bullish trend, traders may look for support at the 25-period SMA for potential continuation trades.
- 99-period Moving Average (Long-Term Trend and Market Sentiment ):
The 99-period SMA is the most critical for identifying the overall market trend. Price consistently trading above the 99-period SMA indicates long-term bullish momentum, while price staying below the 99-period SMA suggests bearish sentiment.
- Trend Confirmation : Price action above the 99-period SMA confirms long-term upward momentum, while price action below it confirms a downtrend. The space between the shorter moving averages (7 and 25) and the 99-period SMA gives a sense of the strength or weakness of the trend. Larger gaps between the 7 and 99 SMAs suggest strong bullish momentum, while close proximity indicates consolidation or potential reversals.
- Price Action in Trending Markets : Traders often use the 99-period SMA as a dynamic support/resistance level. In strong trends, price tends to stay on one side of the 99-period SMA for extended periods, with breaks above or below signaling major changes in market sentiment.
Why These Numbers Matter:
7-Period MA : The 7-period moving average is a popular choice among short-term traders who want to capture quick momentum changes. It helps visualize immediate market sentiment and is often used in conjunction with price action to time entries or exits.
- 25-Period MA: The 25-period MA is a key indicator for swing traders. It balances sensitivity and stability, providing a clearer picture of the intermediate trend. It helps traders stay in trades longer by filtering out short-term noise, while still being reactive enough to detect reversals.
- 99-Period MA : The 99-period moving average provides a broad view of the market's direction, filtering out much of the short- and medium-term noise. It is crucial for identifying long-term trends and assessing whether the market is bullish or bearish overall. It acts as a key reference point for longer-term trend followers, helping them stay with the broader market sentiment.
Conclusion:
From a supply and demand perspective, the 7, 25, and 99-period moving averages help traders visualize shifts in the balance between buyers and sellers over different time horizons. The price action interaction with these moving averages provides valuable insight into short-term momentum, intermediate trends, and long-term market sentiment. Using these three MAs together gives a more comprehensive understanding of market conditions, helping traders align their strategies with prevailing trends across various timeframes.
------------- RULE BASED SYSTEM ---------------
Overview of the Rule-Based System:
This system will use the following moving averages:
7-period MA: Represents short-term price action.
25-period MA: Represents medium-term price action.
99-period MA: Represents long-term price action.
1. Trend Identification Rules:
Bullish Trend:
The 7-period MA is above the 25-period MA, and the 25-period MA is above the 99-period MA.
This structure shows that short, medium, and long-term trends are aligned in an upward direction, indicating strong bullish momentum.
Bearish Trend:
The 7-period MA is below the 25-period MA, and the 25-period MA is below the 99-period MA.
This suggests that the market is in a downtrend, with bearish momentum dominating across timeframes.
Neutral/Consolidation:
The 7-period MA and 25-period MA are flat or crossing frequently with the 99-period MA, and they are close to each other.
This indicates a sideways or consolidating market where there’s no strong trend direction.
2. Entry Rules:
Bullish Entry (Buy Signals):
Primary Buy Signal:
The price crosses above the 7-period MA, AND the 7-period MA is above the 25-period MA, AND the 25-period MA is above the 99-period MA.
This indicates the start of a new upward trend, with alignment across the short, medium, and long-term trends.
Pullback Buy Signal (for trend continuation):
The price pulls back to the 25-period MA, and the 7-period MA remains above the 25-period MA.
This indica
tes that the pullback is a temporary correction in an uptrend, and buyers may re-enter the market as price approaches the 25-period MA.
You can further confirm the signal by waiting for price action (e.g., bullish candlestick patterns) at the 25-period MA level.
Breakout Buy Signal:
The price crosses above the 99-period MA, and the 7-period and 25-period MAs are also both above the 99-period MA.
This confirms a strong bullish breakout after consolidation or a long-term downtrend.
Bearish Entry (Sell Signals):
Primary Sell Signal:
The price crosses below the 7-period MA, AND the 7-period MA is below the 25-period MA, AND the 25-period MA is below the 99-period MA.
This indicates the start of a new downtrend with alignment across the short, medium, and long-term trends.
Pullback Sell Signal (for trend continuation):
The price pulls back to the 25-period MA, and the 7-period MA remains below the 25-period MA.
This indicates that the pullback is a temporary retracement in a downtrend, providing an opportunity to sell as price meets resistance at the 25-period MA.
Breakdown Sell Signal:
The price breaks below the 99-period MA, and the 7-period and 25-period MAs are also below the 99-period MA.
This confirms a strong bearish breakdown after consolidation or a long-term uptrend reversal.
3. Exit Rules:
Bullish Exit (for long positions):
Short-Term Exit:
The price closes below the 7-period MA, and the 7-period MA starts crossing below the 25-period MA.
This indicates weakening momentum in the uptrend, suggesting an exit from the long position.
Stop-Loss Trigger:
The price falls below the 99-period MA, signaling the breakdown of the long-term trend.
This can act as a final exit signal to minimize losses if the long-term uptrend is invalidated.
Bearish Exit (for short positions):
Short-Term Exit:
The price closes above the 7-period MA, and the 7-period MA starts crossing above the 25-period MA.
This indicates a potential weakening of the downtrend and signals an exit from the short position.
Stop-Loss Trigger:
The price breaks above the 99-period MA, invalidating the bearish trend.
This signals that the market may be reversing to the upside, and exiting short positions would be prudent.
Multi-timeframe 24 moving averages + BB+SAR+Supertrend+VWAP █ OVERVIEW
The script allows to display up to 24 moving averages ("MA"'s) across 5 timeframes plus two bands (Bollinger Bands or Supertrend or Parabolic SAR or VWAP bands) each from its own timeframe.
The main difference of this script from many similar ones is the flexibility of its settings:
- Bulk enable/disable and/or change properties of several MAs at once.
- Save 3 of your frequently used templates as presets using CSV text configurations.
█ HOW TO USE
Some use examples:
In order to "show 31, 50, 200 EMAs and 20, 100, 200 SMAs for each of 1H, 4H, D, W, M timeframes using blue for short MA, yellow for mid MA and red for long MA" use the settings as shown on a screenshot below.
In order to "Show a band of chart timeframe MA's of lengths 5, 8, 13, 21, 34, 55, 100 and 200 plus some 1H, 4H, D and W MAs. Be able to quickly switch off the band of chart tf's MAs. For chart timeframe MA's only show labels for 21, 100 and 200 EMAs". You can set TF1 and TF2 to chart's TF and set you fib MAs there and configure fixed higher timeframe MAs using TF3, TF4 and TF5 (e.g. using 1H, D and W timeframes and using 1H 800 in place of 4H 200 MA). However, quicker way may be using CSV - the syntax is very simple and intuitive, see Preset 2 as it comes in the script. You can easily switch chart tf's band of MAs by toggling on/off your chart timeframe TF's (in our example, TF1 and TF2).
The settings are either obvious or explained in tooltips.
Note 1: When using group settings and CSV presets do not forget that individual setting affected will no have any effect. So, if some setting does not work, check whether it is overridden with some group setting or a CSV preset.
Note 2: Sometimes you can notice parts of MA's hanging in the air, not lasting up to the last bar. This is not a bug as explained on this screenshot:
█ FOR DEVELOPERS
The script is a use case of my CSVParser library, which in turn uses Autotable library, both of which I hope will be quite helpful. Autotable is so powerful and comprehensive that you will hardly ever wish to use normal table functions again for complex tables.
The indicator was inspired by Pablo Limonetti's url=https://www.tradingview.com/script/nFs56VUZ/]Multi Timeframe Moving Averages and Raging @RagingRocketBull's # Multi SMA EMA WMA HMA BB (5x8 MAs Bollinger Bands) MAX MTF - RRB
HTFMAs█ OVERVIEW
Contains a type HTFMA used to return data on six moving averages from a higher timeframe.
Several types of MA's are supported.
█ HOW TO USE
Please see instructions in the code (in library description). (Important: first fold all sections of the script: press Cmd + K then Cmd + - (for Windows Ctrl + K then Ctrl + -)
█ FULL LIST OF FUNCTIONS AND PARAMETERS
method getMaType(this)
Enumerator function, given a key returns `enum MaTypes` value
Namespace types: series string, simple string, input string, const string
Parameters:
this (string)
method init(this, enableAll, ma1Enabled, ma1MaType, ma1Src, ma1Prd, ma2Enabled, ma2MaType, ma2Src, ma2Prd, ma3Enabled, ma3MaType, ma3Src, ma3Prd, ma4Enabled, ma4MaType, ma4Src, ma4Prd, ma5Enabled, ma5MaType, ma5Src, ma5Prd, ma6Enabled, ma6MaType, ma6Src, ma6Prd)
Namespace types: RsParamsMAs
Parameters:
this (RsParamsMAs)
enableAll (simple MaEnable)
ma1Enabled (bool)
ma1MaType (series MaTypes)
ma1Src (string)
ma1Prd (int)
ma2Enabled (bool)
ma2MaType (series MaTypes)
ma2Src (string)
ma2Prd (int)
ma3Enabled (bool)
ma3MaType (series MaTypes)
ma3Src (string)
ma3Prd (int)
ma4Enabled (bool)
ma4MaType (series MaTypes)
ma4Src (string)
ma4Prd (int)
ma5Enabled (bool)
ma5MaType (series MaTypes)
ma5Src (string)
ma5Prd (int)
ma6Enabled (bool)
ma6MaType (series MaTypes)
ma6Src (string)
ma6Prd (int)
method init(this, enableAll, tf, rngAtrQ, showRecentBars, lblsOffset, lblsShow, lnOffset, lblSize, lblStyle, smoothen, ma1lnClr, ma1lnWidth, ma1lnStyle, ma2lnClr, ma2lnWidth, ma2lnStyle, ma3lnClr, ma3lnWidth, ma3lnStyle, ma4lnClr, ma4lnWidth, ma4lnStyle, ma5lnClr, ma5lnWidth, ma5lnStyle, ma6lnClr, ma6lnWidth, ma6lnStyle, ma1ShowHistory, ma2ShowHistory, ma3ShowHistory, ma4ShowHistory, ma5ShowHistory, ma6ShowHistory, ma1ShowLabel, ma2ShowLabel, ma3ShowLabel, ma4ShowLabel, ma5ShowLabel, ma6ShowLabel)
Namespace types: HTFMAs
Parameters:
this (HTFMAs)
enableAll (series MaEnable)
tf (string)
rngAtrQ (int)
showRecentBars (int)
lblsOffset (int)
lblsShow (bool)
lnOffset (int)
lblSize (string)
lblStyle (string)
smoothen (bool)
ma1lnClr (color)
ma1lnWidth (int)
ma1lnStyle (string)
ma2lnClr (color)
ma2lnWidth (int)
ma2lnStyle (string)
ma3lnClr (color)
ma3lnWidth (int)
ma3lnStyle (string)
ma4lnClr (color)
ma4lnWidth (int)
ma4lnStyle (string)
ma5lnClr (color)
ma5lnWidth (int)
ma5lnStyle (string)
ma6lnClr (color)
ma6lnWidth (int)
ma6lnStyle (string)
ma1ShowHistory (bool)
ma2ShowHistory (bool)
ma3ShowHistory (bool)
ma4ShowHistory (bool)
ma5ShowHistory (bool)
ma6ShowHistory (bool)
ma1ShowLabel (bool)
ma2ShowLabel (bool)
ma3ShowLabel (bool)
ma4ShowLabel (bool)
ma5ShowLabel (bool)
ma6ShowLabel (bool)
method get(this, id)
Namespace types: RsParamsMAs
Parameters:
this (RsParamsMAs)
id (int)
method set(this, id, prop, val)
Namespace types: RsParamsMAs
Parameters:
this (RsParamsMAs)
id (int)
prop (string)
val (string)
method set(this, id, prop, val)
Namespace types: HTFMAs
Parameters:
this (HTFMAs)
id (int)
prop (string)
val (string)
method htfUpdateTuple(rsParams, repaint)
Namespace types: RsParamsMAs
Parameters:
rsParams (RsParamsMAs)
repaint (bool)
method clear(this)
Namespace types: MaDrawing
Parameters:
this (MaDrawing)
method importRsRetTuple(this, htfBi, ma1, ma2, ma3, ma4, ma5, ma6)
Namespace types: HTFMAs
Parameters:
this (HTFMAs)
htfBi (int)
ma1 (float)
ma2 (float)
ma3 (float)
ma4 (float)
ma5 (float)
ma6 (float)
method getDrw(this, id)
Namespace types: HTFMAs
Parameters:
this (HTFMAs)
id (int)
method setDrwProp(this, id, prop, val)
Namespace types: HTFMAs
Parameters:
this (HTFMAs)
id (int)
prop (string)
val (string)
method initDrawings(this, rsPrms, dispBandWidth)
Namespace types: HTFMAs
Parameters:
this (HTFMAs)
rsPrms (RsParamsMAs)
dispBandWidth (float)
method updateDrawings(this, rsPrms, dispBandWidth)
Namespace types: HTFMAs
Parameters:
this (HTFMAs)
rsPrms (RsParamsMAs)
dispBandWidth (float)
method update(this)
Namespace types: HTFMAs
Parameters:
this (HTFMAs)
method importConfig(this, oCfg, maCount)
Imports HTF MAs settings from objProps (of any level) into `RsParamsMAs` child `RsMaCalcParams` objects (into the first first `maCount` of them)
Namespace types: RsParamsMAs
Parameters:
this (RsParamsMAs) : (RsParamsMAs) Target object to import prop values to.
oCfg (objProps type from moebius1977/CSVParser/1) : (CSVP.objProps) (one of objProps types) an objProps, ... opjProps8 containing properties' values in a child objProps objects
maCount (int) : (int) Number of tgtObj's RsMaCalcParams childs of tgtObj to set (1 to 6, starting from 1)
Returns: this
method importConfig(this, oCfg, maCount)
Imports HTF MAs settings from objProps (of any level) into `RsParamsMAs` child `RsMaCalcParams` objects (into the first first `maCount` of them)
Namespace types: RsParamsMAs
Parameters:
this (RsParamsMAs) : (RsParamsMAs) Target object to import prop values to.
oCfg (objProps0 type from moebius1977/CSVParser/1) : (CSVP.objProps) (one of objProps types) an objProps, ... opjProps8 containing properties' values in a child objProps objects
maCount (int) : (int) Number of tgtObj's RsMaCalcParams childs of tgtObj to set (1 to 6, starting from 1)
Returns: this
method importConfig(this, oCfg, maCount)
Imports HTF MAs settings from objProps (of any level) into `RsParamsMAs` child `RsMaCalcParams` objects (into the first first `maCount` of them)
Namespace types: RsParamsMAs
Parameters:
this (RsParamsMAs) : (RsParamsMAs) Target object to import prop values to.
oCfg (objProps1 type from moebius1977/CSVParser/1) : (CSVP.objProps) (one of objProps types) an objProps, ... opjProps8 containing properties' values in a child objProps objects
maCount (int) : (int) Number of tgtObj's RsMaCalcParams childs of tgtObj to set (1 to 6, starting from 1)
Returns: this
method importConfig(this, oCfg, maCount)
Imports HTF MAs settings from objProps (of any level) into `RsParamsMAs` child `RsMaCalcParams` objects (into the first first `maCount` of them)
Namespace types: RsParamsMAs
Parameters:
this (RsParamsMAs) : (RsParamsMAs) Target object to import prop values to.
oCfg (objProps2 type from moebius1977/CSVParser/1) : (CSVP.objProps) (one of objProps types) an objProps, ... opjProps8 containing properties' values in a child objProps objects
maCount (int) : (int) Number of tgtObj's RsMaCalcParams childs of tgtObj to set (1 to 6, starting from 1)
Returns: this
method importConfig(this, oCfg, maCount)
Imports HTF MAs settings from objProps (of any level) into `RsParamsMAs` child `RsMaCalcParams` objects (into the first first `maCount` of them)
Namespace types: RsParamsMAs
Parameters:
this (RsParamsMAs) : (RsParamsMAs) Target object to import prop values to.
oCfg (objProps3 type from moebius1977/CSVParser/1) : (CSVP.objProps) (one of objProps types) an objProps, ... opjProps8 containing properties' values in a child objProps objects
maCount (int) : (int) Number of tgtObj's RsMaCalcParams childs of tgtObj to set (1 to 6, starting from 1)
Returns: this
method importConfig(this, oCfg, maCount)
Imports HTF MAs settings from objProps (of any level) into `RsParamsMAs` child `RsMaCalcParams` objects (into the first first `maCount` of them)
Namespace types: RsParamsMAs
Parameters:
this (RsParamsMAs) : (RsParamsMAs) Target object to import prop values to.
oCfg (objProps4 type from moebius1977/CSVParser/1) : (CSVP.objProps) (one of objProps types) an objProps, ... opjProps8 containing properties' values in a child objProps objects
maCount (int) : (int) Number of tgtObj's RsMaCalcParams childs of tgtObj to set (1 to 6, starting from 1)
Returns: this
method importConfig(this, oCfg, maCount)
Imports HTF MAs settings from objProps (of any level) into `RsParamsMAs` child `RsMaCalcParams` objects (into the first first `maCount` of them)
Namespace types: RsParamsMAs
Parameters:
this (RsParamsMAs) : (RsParamsMAs) Target object to import prop values to.
oCfg (objProps5 type from moebius1977/CSVParser/1) : (CSVP.objProps) (one of objProps types) an objProps, ... opjProps8 containing properties' values in a child objProps objects
maCount (int) : (int) Number of tgtObj's RsMaCalcParams childs of tgtObj to set (1 to 6, starting from 1)
Returns: this
method importConfig(this, oCfg, maCount)
Imports HTF MAs settings from objProps (of any level) into `RsParamsMAs` child `RsMaCalcParams` objects (into the first first `maCount` of them)
Namespace types: RsParamsMAs
Parameters:
this (RsParamsMAs) : (RsParamsMAs) Target object to import prop values to.
oCfg (objProps6 type from moebius1977/CSVParser/1) : (CSVP.objProps) (one of objProps types) an objProps, ... opjProps8 containing properties' values in a child objProps objects
maCount (int) : (int) Number of tgtObj's RsMaCalcParams childs of tgtObj to set (1 to 6, starting from 1)
Returns: this
method importConfig(this, oCfg, maCount)
Namespace types: RsParamsMAs
Parameters:
this (RsParamsMAs)
oCfg (objProps7 type from moebius1977/CSVParser/1)
maCount (int)
method importConfig(this, oCfg, maCount)
Imports HTF MAs settings from objProps (of any level) into `HTFMAs` child `MaDrawing` objects (into the first first `maCount` of them)
Namespace types: RsParamsMAs
Parameters:
this (RsParamsMAs) : (HTFMAs) Target object to import prop values to.
oCfg (objProps8 type from moebius1977/CSVParser/1) : (CSVP.objProps) (one of objProps types) an objProps, ... opjProps8 containing properties' values in a child objProps objects
maCount (int) : (int) Number of tgtObj's RsMaCalcParams childs of tgtObj to set (1 to 6, starting from 1)
Returns: this
method importConfig(this, oCfg, maCount)
Imports HTF MAs settings from objProps (of any level) into `HTFMAs` child `MaDrawing` objects (into the first first `maCount` of them)
Namespace types: HTFMAs
Parameters:
this (HTFMAs) : (HTFMAs) Target object to import prop values to.
oCfg (objProps type from moebius1977/CSVParser/1) : (CSVP.objProps) (one of objProps types) an objProps, ... opjProps8 containing properties' values in a child objProps objects
maCount (int) : (int) Number of tgtObj's RsMaCalcParams childs of tgtObj to set (1 to 6, starting from 1)
Returns: this
method importConfig(this, oCfg, maCount)
Imports HTF MAs settings from objProps (of any level) into `HTFMAs` child `MaDrawing` objects (into the first first `maCount` of them)
Namespace types: HTFMAs
Parameters:
this (HTFMAs) : (HTFMAs) Target object to import prop values to.
oCfg (objProps0 type from moebius1977/CSVParser/1) : (CSVP.objProps) (one of objProps types) an objProps, ... opjProps8 containing properties' values in a child objProps objects
maCount (int) : (int) Number of tgtObj's RsMaCalcParams childs of tgtObj to set (1 to 6, starting from 1)
Returns: this
method importConfig(this, oCfg, maCount)
Imports HTF MAs settings from objProps (of any level) into `HTFMAs` child `MaDrawing` objects (into the first first `maCount` of them)
Namespace types: HTFMAs
Parameters:
this (HTFMAs) : (HTFMAs) Target object to import prop values to.
oCfg (objProps1 type from moebius1977/CSVParser/1) : (CSVP.objProps) (one of objProps types) an objProps, ... opjProps8 containing properties' values in a child objProps objects
maCount (int) : (int) Number of tgtObj's RsMaCalcParams childs of tgtObj to set (1 to 6, starting from 1)
Returns: this
method importConfig(this, oCfg, maCount)
Imports HTF MAs settings from objProps (of any level) into `HTFMAs` child `MaDrawing` objects (into the first first `maCount` of them)
Namespace types: HTFMAs
Parameters:
this (HTFMAs) : (HTFMAs) Target object to import prop values to.
oCfg (objProps2 type from moebius1977/CSVParser/1) : (CSVP.objProps) (one of objProps types) an objProps, ... opjProps8 containing properties' values in a child objProps objects
maCount (int) : (int) Number of tgtObj's RsMaCalcParams childs of tgtObj to set (1 to 6, starting from 1)
Returns: this
method importConfig(this, oCfg, maCount)
Imports HTF MAs settings from objProps (of any level) into `HTFMAs` child `MaDrawing` objects (into the first first `maCount` of them)
Namespace types: HTFMAs
Parameters:
this (HTFMAs) : (HTFMAs) Target object to import prop values to.
oCfg (objProps3 type from moebius1977/CSVParser/1) : (CSVP.objProps) (one of objProps types) an objProps, ... opjProps8 containing properties' values in a child objProps objects
maCount (int) : (int) Number of tgtObj's RsMaCalcParams childs of tgtObj to set (1 to 6, starting from 1)
Returns: this
method importConfig(this, oCfg, maCount)
Imports HTF MAs settings from objProps (of any level) into `HTFMAs` child `MaDrawing` objects (into the first first `maCount` of them)
Namespace types: HTFMAs
Parameters:
this (HTFMAs) : (HTFMAs) Target object to import prop values to.
oCfg (objProps4 type from moebius1977/CSVParser/1) : (CSVP.objProps) (one of objProps types) an objProps, ... opjProps8 containing properties' values in a child objProps objects
maCount (int) : (int) Number of tgtObj's RsMaCalcParams childs of tgtObj to set (1 to 6, starting from 1)
Returns: this
method importConfig(this, oCfg, maCount)
Imports HTF MAs settings from objProps (of any level) into `HTFMAs` child `MaDrawing` objects (into the first first `maCount` of them)
Namespace types: HTFMAs
Parameters:
this (HTFMAs) : (HTFMAs) Target object to import prop values to.
oCfg (objProps5 type from moebius1977/CSVParser/1) : (CSVP.objProps) (one of objProps types) an objProps, ... opjProps8 containing properties' values in a child objProps objects
maCount (int) : (int) Number of tgtObj's RsMaCalcParams childs of tgtObj to set (1 to 6, starting from 1)
Returns: this
method importConfig(this, oCfg, maCount)
Imports HTF MAs settings from objProps (of any level) into `HTFMAs` child `MaDrawing` objects (into the first first `maCount` of them)
Namespace types: HTFMAs
Parameters:
this (HTFMAs) : (HTFMAs) Target object to import prop values to.
oCfg (objProps6 type from moebius1977/CSVParser/1) : (CSVP.objProps) (one of objProps types) an objProps, ... opjProps8 containing properties' values in a child objProps objects
maCount (int) : (int) Number of tgtObj's RsMaCalcParams childs of tgtObj to set (1 to 6, starting from 1)
Returns: this
method importConfig(this, oCfg, maCount)
Namespace types: HTFMAs
Parameters:
this (HTFMAs)
oCfg (objProps7 type from moebius1977/CSVParser/1)
maCount (int)
method importConfig(this, oCfg, maCount)
Namespace types: HTFMAs
Parameters:
this (HTFMAs)
oCfg (objProps8 type from moebius1977/CSVParser/1)
maCount (int)
method newRsParamsMAs(this)
Namespace types: LO
Parameters:
this (LO)
method newHTFMAs(this)
Namespace types: LO
Parameters:
this (LO)
RsMaCalcParams
Parameters of one MA (only calculation params needed within req.sec(), visual parameters are within htfMAs type)
Fields:
enabled (series bool)
maType (series MaTypes) : MA type options: SMA / EMA / WMA / ...
src (series string)
prd (series int) : MA period
RsParamsMAs
Collection of parameters of 6 MAs. Used to pass params to req.sec()
Fields:
ma1CalcParams (RsMaCalcParams)
ma2CalcParams (RsMaCalcParams)
ma3CalcParams (RsMaCalcParams)
ma4CalcParams (RsMaCalcParams)
ma5CalcParams (RsMaCalcParams)
ma6CalcParams (RsMaCalcParams)
RsReturnMAs
Used to return data from req.sec().
Fields:
htfBi (series int)
ma1 (series float)
ma2 (series float)
ma3 (series float)
ma4 (series float)
ma5 (series float)
ma6 (series float)
MaDrawing
MA's plot parameters plus drawing objects for MA's current level (line and label).
Fields:
lnClr (series color) : (color) MA plot line color (like in plot())
lnWidth (series int) : (int) MA plot line width (like in plot())
lnStyle (series string) : (string) MA plot line style (like in plot())
showHistory (series bool) : (bool) Whether to plot the MA on historical bars or only show current level to the right of the latest bar.
showLabel (series bool) : (bool) Whether to show the name of the MA to the right of the MA's level
ln (series line) : (line) line to show MA"s current level
lbl (series label) : (label) label showing MA's name
HTFMAs
Contains data and drawing parameters for MA's of one timeframe (MA calculation parameters for MA's of one timeframe are in a separate object RsParamsMAs)
Fields:
rsRet (RsReturnMAs) : (RsReturnMAs) Contains data returned from req.sec(). Is set to na in between HTF bar changes if smoothing is enabled.
rsRetLast (RsReturnMAs) : (RsReturnMAs) Contains a copy of data returned from req.sec() in case rsRet is set to na for smoothing.
rsRetNaObj (RsReturnMAs) : (RsReturnMAs) An empty object as `na` placeholder
ma1Drawing (MaDrawing) : (MaDrawing) MA drawing properties
ma2Drawing (MaDrawing) : (MaDrawing) MA drawing properties
ma3Drawing (MaDrawing) : (MaDrawing) MA drawing properties
ma4Drawing (MaDrawing) : (MaDrawing) MA drawing properties
ma5Drawing (MaDrawing) : (MaDrawing) MA drawing properties
ma6Drawing (MaDrawing) : (MaDrawing) MA drawing properties
enabled (series bool) : (bool ) Enables/disables all of the MAs of one timeframe.
tf (series string) : (string) Timeframe
showHistory (series bool) : (bool ) Plot MA line on historical bars
rngAtrQ (series int) : (int ) A multiplier for atr(14). Determines a range within which the MA's will be plotted. MA's too far away will not be plotted.
showRecentBars (series int) : (int ) Only plot MA on these recent bars
smoothen (series bool) : (bool ) Smoothen MA plot. If false the same HTF value is returned on all chart bars within a HTF bar (intrabars), so the plot looks like steps.
lblsOffset (series int) : (int ) Show MA name this number of bars to the right off last bar.
lblsShow (series bool) : (bool ) Show MA name
lnOffset (series int) : (int ) Start line showing current level of the MA this number of bars to the right off the last bar.
lblSize (series string) : (string) Label size
lblStyle (series string) : (string) Label style
lblTxtAlign (series string) : (string) Label text align
bPopupLabel (series bool) : (bool ) Show current MA value as a tooltip to MA's name.
LO
LO Library object, whose only purpose is to serve as a shorthand for library name in script code.
Fields:
dummy (series string)
EMA Volume [MacroGlide]EMA Volume is a versatile tool designed to track and analyze market volumes by calculating the Exponential Moving Averages (EMAs) of total, bullish, and bearish volumes. This indicator helps traders visualize volume dynamics, identify buying and selling pressure, and make informed trading decisions based on volume activity.
Key Features:
• Volume EMAs: The indicator calculates the EMAs of total, bullish, and bearish volumes, allowing users to observe how volume trends evolve over time. This helps identify shifts in market sentiment and potential reversals.
• Separation of Bullish and Bearish Volumes: By separating bullish and bearish volumes, the indicator provides a clear view of buying versus selling activity. This distinction is valuable for understanding the market's underlying momentum and direction.
• Customizable Visuals: Users can customize the line style and color for each volume type, allowing them to tailor the display of the indicator to their personal preferences and enhance the visual interpretation of the data.
How to Use:
• Add the indicator to your chart and adjust the EMA settings and display parameters according to your needs.
• Use the difference between bullish and bearish volumes to assess current market sentiment and analyze potential trend changes.
• Monitor the EMA of total volume to identify overall volume trends that can serve as additional signals for entering or exiting positions.
Methodology:
The indicator calculates the EMAs for total, bullish, and bearish volumes based on the trading volumes associated with price increases or decreases. This tool helps evaluate the strength of buying and selling at different times, making it especially useful for volume and market dynamics analysis.
Originality and Usefulness:
EMA Volume stands out for its ability to separate buying and selling volumes and present them in a clear visual format, significantly simplifying the analysis of market activity and decision-making in trading.
Charts:
The indicator displays clean and clear charts, where each type of volume is represented by its own line and color, making visual interpretation easier. The charts focus solely on key information for analysis: EMAs of total, bullish, and bearish volumes. These features make the charts highly useful for quick analysis and trading decision-making.
Enjoy the game!
Options Series - MTF 1 and 3 Minute
Objective:
The indicator is named "Options Series - MTF 1 and 3 Minute", suggesting it's designed to analyze options series with multiple time frames (MTF), particularly focusing on 1-minute and 3-minute intervals.
OHLC Values Of Candle:
The code fetches the Open, High, Low, and Close (OHLC) values of the current candle for the specified ticker and timeframes (current, 1 minute, and 3 minutes). Additionally, it calculates the 200-period Simple Moving Average (SMA) of the closing prices for each timeframe.
Bull vs. Bear Condition:
It defines conditions for Bullish and Bearish scenarios based on comparing the current close price with the previous 200-period SMA close price for both 1-minute and 3-minute timeframes. If the current close price is higher than the previous 200-period SMA close price, it's considered Bullish, and if it's lower, it's considered Bearish.
Final Color Condition and Plot:
It determines the color of the candlestick based on the Bullish or Bearish condition. If the conditions for a Bullish scenario are met, the candlestick color is set to green (GreenColorCandle). If the conditions for a Bearish scenario are met, the candlestick color is set to red (RedColorCandle). If neither condition is met (i.e., the candle is neither Bullish nor Bearish), the color remains gray.
The code then plots the 200-period SMA values for both 1-minute and 3-minute timeframes and colors them based on the candlestick color. It also colors the bars based on the candlestick color.
Insights:
This indicator focuses on comparing current close prices with the 200-period SMA close prices to determine market sentiment (Bullish or Bearish).
It utilizes multiple time frames (1 minute and 3 minutes) to provide a broader perspective on market movements.
The color-coded candlesticks and bars make it visually easy to identify Bullish and Bearish trends.
This indicator can be used as part trading based on the identified market sentiment.
MA OrderBlocks [AlgoAlpha]🟨 HMA OrderBlocks by AlgoAlpha is a powerful tool designed to help traders visualize key pivot zones and order blocks based on the Hull Moving Average (HMA). By dynamically identifying bullish and bearish pivot points, this script provides insights into potential price reversals and trend continuations. With customizable settings, it allows traders to tweak the behavior of the indicator to match their strategies. Plus, it comes packed with built-in alerts for trend changes, making it easier to spot potential trade opportunities.
Key Features :
📊 Trend Detection : Utilizes Hull Moving Average to detect the current trend.
🟢🔴 Bullish & Bearish Zones : Automatically plots bullish and bearish order blocks, using customizable colors for clear visual cues.
🎯 Pivot Points : Detects and marks pivot highs and lows, helping traders spot key price reversals.
🚨 Alerts : Built-in alert system for when the price approaches key bullish or bearish zones, or when the trend changes.
🔨 Customizable MA: Choose from various moving averages (SMA, HMA, EMA, etc.) to suit your strategy.
How to Use :
⭐ Add the Indicator : Add the indicators to favourites by pressing the star icon. Once added, configure settings like the Hull MA period and pivot detection period.
📈 Analyze the Chart : Watch for the plotted order blocks and pivot points to identify possible price action strategies.
🔔 Enable Alerts : Set up alerts to be notified of potential trend reversals or when the price nears a bullish/bearish block.
How It Works :
The script starts by calculating the Hull Moving Average (HMA) based on the user-defined length, which is used to determine the market trend direction. It compares the current HMA value with the previous one to confirm whether the price is trending upwards or downwards. Once a trend change is detected, it plots bullish or bearish order blocks based on recent pivot highs and lows. These zones are extended in real-time as long as they remain invalidated. Zones are invalidated are invalidated when price completely closes through them. If the price gets close to a zone in the opposing direction, a warning system alerts the user that the block may not hold. Additionally, customizable alerts trigger whenever the price trend shifts or the price gets near important bullish/bearish blocks. The script’s logic ensures that order blocks are cleared if price violates them, keeping the chart clean and updated.
Average True Range with Price MAATR with Price Moving Average Indicator
This custom indicator combines the Average True Range (ATR) with a Price Moving Average (MA) to help traders analyze market volatility in percent to the price.
Key Components:
Average True Range (ATR)
Price Moving Average (MA)
ATR/Price in Percent
ATR/Price in Percent
Purpose: This ratio helps traders understand the relative size of the ATR compared to the current price, providing a clearer sense of how significant the volatility is in proportion to the price level.
Calculation: ATR is divided by the current closing price and multiplied by 100 to express it as a percentage. This makes it easier to compare volatility across assets with different price ranges.
Plot: This is plotted as a percentage, making it easier to gauge whether the volatility is proportionally high or low compared to the asset's price.
Usage:
This indicator is designed to help identify the most volatile tokens, making it ideal for configuring a Grid Bot to maximize profit. By focusing on high-volatility assets, traders can capitalize on larger price swings within the grid, increasing the potential for more profitable trades.
Features:
Customizable Smoothing Method: Choose from RMA (Relative Moving Average), SMA (Simple Moving Average), EMA (Exponential Moving Average), or WMA (Weighted Moving Average) for both ATR and the Price Moving Average.
Dual Perspective: The indicator provides both volatility analysis (ATR) and trend analysis (Price MA) in a single view.
Proportional Volatility: The ATR/Price (%) ratio adds a layer of context by showing how volatile the asset is relative to its current price.
DP-OCR MTF & MA 2024This script developed is designed for multi-timeframe analysis of previous open, close, and range, with additional signal plots based on various percentage extension levels. It also incorporates EMA calculations for crossover strategies. Here's a quick breakdown of what the script does:
Key Features:
1. Timeframes:
o Two separate timeframes (TF1 and TF2), which can be set by the user (e.g., 15 mins, 30 mins, daily, etc.). The script computes price actions and extensions for both timeframes. For better analysis, use Daily in TF1 and Weekly in TF2
2. Extension Levels:
o Calculates and plots 10%, 21%, 31%, 51%, and 61% extensions (both positive and negative) for each timeframe.
o The most commonly used extension levels are 61%, 31%, -61%, and -21%.
o These extension levels can be turned on or off by the user.
3. Open/Close/Range:
o Tracks the high, low, open, and close for both timeframes.
o Highlights open/close gaps.
o Plots the previous high/low range for both timeframes with a fill and different colors based on price movement.
How to Use:
• You can toggle specific extension levels on or off in the script’s settings.
• For example, when price hits a +61% extension, it could signal a breakout, and when it hits a -61% extension, it may indicate a potential retracement.
• Use these levels in conjunction with your price action analysis to set entry/exit points or stop-loss levels.
4. Today’s Open:
o Plots today’s opening price for both timeframes.
How to Use:
• Use today’s open as a key reference point to determine the day’s price action.
• Compare today’s open with the previous high/low or extension levels to evaluate possible trends or reversals.
5. EMA Calculations:
o The script calculates 5, 15, and 20 period EMAs and plots them on the chart.
o Additional EMA crossover signals can be included for strategy optimization.
How to Use:
• Observe the EMAs for potential crossover signals. For example, a 5-period EMA crossing above a 15-period or 20-period EMA may signal a buy opportunity, while a crossover in the opposite direction may signal a sell.
• Combine the EMA crossovers with extension levels or previous price data to refine your entries and exits.
Customizations Available:
• Users can select whether to display extension levels for either timeframe.
• The script allows automatic adaptation to intraday, daily, weekly, or monthly timeframes based on the current chart settings.
Moreover, the extension levels are calculated based on the previous period’s range, with the most commonly usable extension levels being 61, 31, -61, and -21. These levels are often used for identifying potential price retracements, breakouts, or reversal points in technical analysis.
First Candle High Low LevelsDescription
The "First Candle High Low Levels" Pine Script indicator is designed to highlight the high and low levels of the first candle of the day on your TradingView chart. It works across different timeframes and specifically handles the Indian stock market trading hours (9:15 AM to 3:30 PM IST). The script draws a box from the start to the end of the trading session, visually marking the price range defined by the first candle of the day. Traders can customize the box's border color, fill color, and line width.
Features
Customizable Timeframe: Users can select the desired timeframe for the first candle (e.g., 5-minute, 15-minute, etc.).
Custom Box Appearance: Options to adjust the border color, fill color, and line width of the drawn box.
Auto Reset for Each New Day: The high and low of the first candle are reset daily to mark the start of the next trading day.
Accurate Market Session Handling: The box is drawn from the start of the first candle to the end of the trading session (3:30 PM IST).
Usage
Adding to Chart: Apply the script by copying it into the Pine Script editor in TradingView. Once added, the script will automatically draw a box representing the high and low of the first candle of the day.
Select Timeframe: You can adjust the First Candle Timeframe input to define which timeframe candle will be used for marking the high and low. For example, if you choose a 5-minute timeframe, the high and low of the first 5-minute candle will be used.
Customization:
Adjust the Border Color and Box Fill Color through the input settings to match your chart's style.
Modify the Box Line Width to make the box lines more or less prominent.
Multi Adaptive Moving Average (MAMA)The Multi Adaptive Moving Average (MAMA) indicator is an advanced tool for technical analysis, designed to provide traders with a detailed understanding of market trends and potential future price movements. This indicator utilizes multiple Simple Moving Averages (SMAs) and forecasting techniques to enhance decision-making processes.
Simple Moving Averages (SMAs):
Short MA (20-period): This moving average is highly responsive to price changes, making it ideal for capturing short-term trends. It helps traders identify quick market shifts and potential entry or exit points.
Mid MA (50-period): This average strikes a balance between short- and long-term trends, offering insights into the market's intermediate direction. It aids in confirming the sustainability of short-term trends.
Long MA (100-period): By smoothing out price data over a longer period, this moving average is useful for identifying long-term trends and filtering out short-term volatility.
Very Long MA (200-period): Often considered a critical indicator for determining the overall market trend, this average helps confirm the direction and strength of long-term movements.
Forecasting:
Flat Forecast: This approach assumes that prices will remain constant in the near future, which is particularly useful in markets trading sideways without a clear trend direction.
Linear Regression Forecast: This method uses historical data to project future price movements, offering a dynamic forecast based on existing trends. It helps traders anticipate potential price changes and plan their strategies accordingly.
Advantages:
Comprehensive Trend Analysis: By incorporating four different SMAs, the indicator provides a layered view of market trends across various timeframes. This enables traders to identify potential trend reversals and continuations with greater accuracy.
Predictive Insights: The forecasting feature offers traders a forward-looking perspective, enabling them to anticipate market movements and adjust their trading strategies proactively. This can be especially advantageous in volatile markets.
Customization: The MAMA indicator is highly customizable, allowing traders to adjust parameters such as the source of price data and the inclusion of the current unclosed candle. This flexibility ensures that the indicator can be tailored to fit different trading styles and market conditions.
Visual Clarity: The use of distinct colors for each SMA and their forecasts enhances visual interpretation, making it easier for traders to quickly assess market conditions and make informed decisions. The inclusion of a legend further aids in distinguishing between the different moving averages and their respective forecasts.
How to Use:
Trend Confirmation: Use the alignment of the SMAs to confirm market trends. For example, when the Short MA crosses above the Mid and Long MAs, it may indicate a bullish trend, while the opposite could suggest a bearish trend.
Entry and Exit Points: Look for crossovers between the SMAs as potential signals for entering or exiting trades. The forecasts can help in timing these decisions by providing an expectation of future price movements.
Risk Management: Utilize the Very Long MA to set stop-loss and take-profit levels, as it reflects the long-term trend and can help in avoiding trades against the prevailing market direction.
The MAMA indicator is intended to support technical analysis and should not be used as the sole basis for making trading decisions. Financial markets are inherently uncertain, and past performance does not guarantee future results. Traders should use this tool in conjunction with other analytical methods and consider their risk tolerance and investment objectives. It is advisable to conduct thorough research and consult with a financial advisor before making significant trading decisions. Always be aware of the risks involved in trading and invest only what you can afford to lose.
lib_no_delayLibrary "lib_no_delay"
This library contains modifications to standard functions that return na before reaching the bar of their 'length' parameter.
That is because they do not compromise speed at current time for correct results in the past. This is good for live trading in short timeframes but killing applications on Monthly / Weekly timeframes if instruments, like in crypto, do not have extensive history (why would you even trade the monthly on a meme coin ... not my decision).
Also, some functions rely on source (value at previous bar), which is not available on bar 1 and therefore cascading to a na value up to the last bar ... which in turn leads to a non displaying indicator and waste of time debugging this)
Anyway ... there you go, let me know if I should add more functions.
sma(source, length)
Parameters:
source (float) : Series of values to process.
length (simple int) : Number of bars (length).
Returns: Simple moving average of source for length bars back.
ema(source, length)
Parameters:
source (float) : Series of values to process.
length (simple int) : Number of bars (length).
Returns: (float) The exponentially weighted moving average of the source.
rma(source, length)
Parameters:
source (float) : Series of values to process.
length (simple int) : Number of bars (length).
Returns: Exponential moving average of source with alpha = 1 / length.
atr(length)
Function atr (average true range) returns the RMA of true range. True range is max(high - low, abs(high - close ), abs(low - close )). This adapted version extends ta.atr to start without delay at first bar and deliver usable data instead of na by averaging ta.tr(true) via manual SMA.
Parameters:
length (simple int) : Number of bars back (length).
Returns: Average true range.
rsi(source, length)
Relative strength index. It is calculated using the ta.rma() of upward and downward changes of source over the last length bars. This adapted version extends ta.rsi to start without delay at first bar and deliver usable data instead of na.
Parameters:
source (float) : Series of values to process.
length (simple int) : Number of bars back (length).
Returns: Relative Strength Index.
Adjustable Percentage Range Moving AverageAdjustable Percentage Range Moving Average (APRMA)
The Adjustable Percentage Range Moving Average (APRMA) is a technical analysis tool designed for traders and market analysts who seek a dynamic approach to understanding market volatility and trend identification. Unlike traditional moving averages, the APRMA incorporates user-adjustable percentage bands around a central moving average line, offering a customizable view of price action relative to its recent history.
Key Features:
Central Moving Average: At its core, APRMA calculates a moving average (type of your choice) of the price over a specified number of periods, serving as the baseline for the indicator.
Percentage Bands: Surrounding the moving average are four bands, two above and two below, set at user-defined percentages away from the central line. These bands expand and contract based on the percentage input, not on standard deviation like Bollinger Bands, which allows for a consistent visual interpretation of how far the price has moved from its average.
Customizability: Users can adjust:
The length of the moving average period to suit short-term, medium-term, or long-term analysis.
The percentage offset for the bands, enabling traders to set the sensitivity of the indicator according to the asset's volatility or their trading strategy.
Visual Interpretation:
When the price moves towards or beyond the upper band, it might indicate that the asset is potentially overbought or that a strong upward trend is in place.
Conversely, price action near or below the lower band could suggest an oversold condition or a strong downward trend.
The space between the bands can be used to gauge volatility; narrower bands suggest lower current volatility relative to the average, while wider bands indicate higher volatility.
Usage in Trading:
Trend Confirmation: A price staying above the moving average and pushing the upper band might confirm an uptrend, while staying below and testing the lower band could confirm a downtrend.
Reversion Strategies: Traders might look for price to revert to the mean (moving average) when it touches or crosses the bands, setting up potential entry or exit points.
Breakout Signals: A price moving decisively through a band after a period of consolidation within the bands might signal a breakout.
The APRMA provides a clear, adaptable framework for traders to visualize where the price stands in relation to its recent average, offering insights into potential overbought/oversold conditions, trend strength, and volatility, all tailored by the trader's strategic preferences.
Gaussian Kernel Smoothing EMAGaussian Kernel Smoothing EMA
The Gaussian Kernel Smoothing EMA integrates the exponential moving average with kernel smoothing techniques to refine the trend tool. Kernel smoothing is a non-parametric technique used to estimate a smooth curve from a set of data points. It is particularly useful in reducing noise and capturing the underlying structure of data. The smoothed value at each point is calculated as a weighted average of neighboring points, with the weights determined by a kernel function.
The Gaussian kernel is a popular choice in kernel smoothing due to its properties of being smooth, symmetric, and having infinite support. This function gives higher weights to data points closer to the target point and lower weights to those further away, resulting in a smooth and continuous estimate. Since price isn't normally distributed a logarithmic transformation is performed to remove most of its skewness to be able to fit the Gaussian kernel.
This indicator also has a bandwidth, which in kernel smoothing controls the width of the window over which the smoothing is performed. It determines how much influence nearby data points have on the smoothed value. In this indicator, the bandwidth is dynamically adjusted based on the standard deviation of the log-transformed prices so that the smoothing adapts to the underlying variability and potential volatility.
Bandwidth Factor: The bandwidth factor in this indicator is used to adjust the degree of the smoothing applied to the MA. In kernel smoothing, Bandwidth controls the width of the window over which the smoothing is applied. It determines how many data points around a central point are considered when calculating a smooth value. A smaller bandwidth results in less smoothing, while a larger bandwidth smooths out more noise, leading to a broader, more general trend.
Sticky Moving AverageThe Sticky Moving Average is a custom indicator designed to provide a unique smoothing effect by combining different moving averages derived from a single base period. This indicator creates a single line on the chart, representing the average of the following three moving averages:
1. X-period Simple Moving Average (SMA): A traditional moving average that smooths the price data over the full period.
2. X/2-period Simple Moving Average (SMA): A faster-moving average that smooths the price data over half of the base period.
3. X/4-period Exponential Moving Average (EMA): An exponential moving average that gives more weight to recent prices, calculated over one-fourth of the base period.
The result is a moving average that "sticks" to price action by considering both short-term and long-term trends, offering a balanced view of market momentum.
This indicator is ideal for traders looking to gain a nuanced understanding of price movements by incorporating multiple smoothing periods into a single, easy-to-use line. Adjust the `X` value to suit your trading strategy and enjoy the clarity this composite moving average can bring to your charts.
Market Breadth - AsymmetrikMarket Breadth - Asymmetrik User Manual
Overview
The Market Breadth - Asymmetrik is a script designed to provide insights into the overall market condition by plotting three key indicators based on stocks within the S&P 500 index. It helps traders assess market momentum and strength through visual cues and is especially useful for understanding the proportion of stocks trading above their respective moving averages.
Features
1. Market Breadth Indicators:
- Breadth 20D (green line): Represents the percentage of stocks in the S&P 500 that are above their 20-day moving average.
- Breadth 50D (yellow line): Represents the percentage of stocks in the S&P 500 that are above their 50-day moving average.
- Breadth 100D (red line): Represents the percentage of stocks in the S&P 500 that are above their 100-day moving average.
2. Horizontal Lines for Context:
- Green line at 10%
- Lighter green line at 20%
- Grey line at 50%
- Light red line at 80%
- Dark red line at 90%
3. Background Color Alerts:
- Green background when all three indicators are under 20%, indicating a potential oversold market condition.
- Red background when all three indicators are over 80%, indicating a potential overbought market condition.
Interpreting the Indicator
- Market Breadth Lines: Observe the plotted lines to assess the percentage of stocks above their moving averages.
- Horizontal Lines: Use the horizontal lines to quickly identify important threshold levels.
- Background Colors: Pay attention to background colors for quick insights:
- Green: All indicators suggest a potentially oversold market condition (below 20).
- Red: All indicators suggest a potentially overbought market condition (above 80).
Troubleshooting
- If the indicator does not appear as expected, please contact me.
- This indicator works only on daily and weekly timeframes.
Conclusion
This Market Breadth Indicator offers a visual representation of market momentum and strength through three key indicators, helping you identify potential buying and selling zones.
SOL & BTC EMA with BTC/SOL Price Difference % and BTC Dom EMAThis script is designed to provide traders with a comprehensive analysis of Solana (SOL) and Bitcoin (BTC) by incorporating Exponential Moving Averages (EMAs) and price difference percentages. It also includes the BTC Dominance EMA to offer insights into the overall market dominance of Bitcoin.
Features:
SOL EMA: Plots the Exponential Moving Average (EMA) for Solana (SOL) based on a customizable period length.
BTC EMA: Plots the Exponential Moving Average (EMA) for Bitcoin (BTC) based on a customizable period length.
BTC Dominance EMA: Plots the Exponential Moving Average (EMA) for BTC Dominance, which helps in understanding Bitcoin's market share relative to other cryptocurrencies.
BTC/SOL Price Difference %: Calculates and plots the percentage difference between BTC and SOL prices, adjusted for their respective EMAs. This helps in identifying relative strength or weakness between the two assets.
Background Highlight: Colors the background to visually indicate whether the BTC/SOL price difference percentage is positive (green) or negative (red), aiding in quick decision-making.
Inputs:
SOL Ticker: Symbol for Solana (default: BINANCE
).
BTC Ticker: Symbol for Bitcoin (default: BINANCE
).
BTC Dominance Ticker: Symbol for Bitcoin Dominance (default: CRYPTOCAP
.D).
EMA Length: The length of the EMA (default: 20 periods).
Usage:
This script is intended for traders looking to analyze the relationship between SOL and BTC, using EMAs to smooth out price data and highlight trends. The BTC/SOL price difference percentage can help traders identify potential trading opportunities based on the relative movements of SOL and BTC.
Note: Leverage trading involves significant risk and may not be suitable for all investors. Ensure you have a good understanding of the market conditions and employ proper risk management techniques.
Moving Average Z-Score Suite [BackQuant]Moving Average Z-Score Suite
1. What is this indicator
The Moving Average Z-Score Suite is a versatile indicator designed to help traders identify and capitalize on market trends by utilizing a variety of moving averages. This indicator transforms selected moving averages into a Z-Score oscillator, providing clear signals for potential buy and sell opportunities. The indicator includes options to choose from eleven different moving average types, each offering unique benefits and characteristics. It also provides additional features such as standard deviation levels, extreme levels, and divergence detection, enhancing its utility in various market conditions.
2. What is a Z-Score
A Z-Score is a statistical measurement that describes a value's relationship to the mean of a group of values. It is measured in terms of standard deviations from the mean. For instance, a Z-Score of 1.0 means the value is one standard deviation above the mean, while a Z-Score of -1.0 indicates it is one standard deviation below the mean. In the context of financial markets, Z-Scores can be used to identify overbought or oversold conditions by determining how far a particular value (such as a moving average) deviates from its historical mean.
3. What moving averages can be used
The Moving Average Z-Score Suite allows users to select from the following eleven moving averages:
Simple Moving Average (SMA)
Hull Moving Average (HMA)
Exponential Moving Average (EMA)
Weighted Moving Average (WMA)
Double Exponential Moving Average (DEMA)
Running Moving Average (RMA)
Linear Regression Curve (LINREG) (This script can be found standalone )
Triple Exponential Moving Average (TEMA)
Arnaud Legoux Moving Average (ALMA)
Kalman Hull Moving Average (KHMA)
T3 Moving Average
Each of these moving averages has distinct properties and reacts differently to price changes, allowing traders to select the one that best fits their trading style and market conditions.
4. Why Turning a Moving Average into a Z-Score is Innovative and Its Benefits
Transforming a moving average into a Z-Score is an innovative approach because it normalizes the moving average values, making them more comparable across different periods and instruments. This normalization process helps in identifying extreme price movements and mean-reversion opportunities more effectively. By converting the moving average into a Z-Score, traders can better gauge the relative strength or weakness of a trend and detect potential reversals. This method enhances the traditional moving average analysis by adding a statistical perspective, providing clearer and more objective trading signals.
5. How It Can Be Used in the Context of a Trading System
In a trading system, it can be used to generate buy and sell signals based on the Z-Score values. When the Z-Score crosses above zero, it indicates a potential buying opportunity, suggesting that the price is above its mean and possibly trending upward. Conversely, a Z-Score crossing below zero signals a potential selling opportunity, indicating that the price is below its mean and might be trending downward. Additionally, the indicator's ability to show standard deviation levels and extreme levels helps traders set profit targets and stop-loss levels, improving risk management and trade planning.
6. How It Can Be Used for Trend Following
For trend-following strategies, it can be particularly useful. The Z-Score oscillator helps traders identify the strength and direction of a trend. By monitoring the Z-Score and its rate of change, traders can confirm the persistence of a trend and make informed decisions to enter or exit trades. The indicator's divergence detection feature further enhances trend-following by identifying potential reversals before they occur, allowing traders to capitalize on trend shifts. By providing a clear and quantifiable measure of trend strength, this indicator supports disciplined and systematic trend-following strategies.
No backtests for this indicator due to the many options and ways it can be used,
Enjoy
Stochastic Biquad Band Pass FilterThis indicator combines the power of a biquad band pass filter with the popular stochastic oscillator to provide a unique tool for analyzing price movements.
The Filter Length parameter determines the center frequency of the biquad band pass filter, affecting which frequency band is isolated. Adjusting this parameter allows you to focus on different parts of the price movement spectrum.
The Bandwidth (BW) controls the width of the frequency band in octaves. It represents the bandwidth between -3 dB frequencies for the band pass filter. A narrower bandwidth results in a more focused filtering effect, isolating a tighter range of frequencies.
The %K Length parameter sets the period for the stochastic calculation, determining the range over which the stochastic values are calculated.
The %K Smoothing parameter applies a simple moving average to the %K values to smooth out the oscillator line.
The %D Length parameter sets the period for the %D line, which is a simple moving average of the %K line, providing a signal line for the oscillator.
Key Features of the Stochastic Biquad Band Pass Filter
Biquad filters are known for their smooth response and minimal phase distortion, making them ideal for technical analysis. In this implementation, the biquad filter is configured as a band pass filter, which allows frequencies within a specified band to pass while attenuating frequencies outside this band. This is particularly useful in trading to isolate specific price movements, making it easier to detect patterns and trends within a targeted frequency range.
The stochastic oscillator is a popular momentum indicator that shows the location of the close relative to the high-low range over a set number of periods. Combining it with a biquad band pass filter enhances its effectiveness by focusing on specific frequency bands of price movements.
By incorporating this stochastic biquad band pass filter into your trading toolkit, you can enhance your chart analysis with clearer insights into specific frequency bands of price movements, leading to more informed trading decisions.
Biquad High Pass FilterThis indicator utilizes a biquad high pass filter to filter out low-frequency components from price data, helping traders focus on high-frequency movements and detect rapid changes in trends.
The Length parameter determines the cutoff frequency of the filter, affecting how quickly the filter responds to changes in price. A shorter length allows the filter to react more quickly to high-frequency movements.
The Q Factor controls the sharpness of the filter. A higher Q value results in a more precise filtering effect by narrowing the frequency band. However, be cautious when setting the Q factor too high, as it can induce resonance, amplifying certain frequencies and potentially making the filter less effective by introducing unwanted noise.
Key Features of Biquad Filters
Biquad filters are a type of digital filter that provides a combination of low-pass, high-pass, band-pass, and notch filtering capabilities. In this implementation, the biquad filter is configured as a high pass filter, which allows high-frequency signals to pass while attenuating lower-frequency components. This is particularly useful in trading to highlight rapid price movements, making it easier to spot short-term trends and patterns.
Biquad filters are known for their smooth response and minimal phase distortion, making them ideal for technical analysis. The customizable length and Q factor allow for flexible adaptation to different trading strategies and market conditions. Designed for real-time charting, the biquad filter operates efficiently without significant lag, ensuring timely analysis.
By incorporating this biquad high pass filter into your trading toolkit, you can enhance your chart analysis with clearer insights into rapid price movements, leading to more informed trading decisions.
Biquad Low Pass FilterThis indicator utilizes a biquad low pass filter to smooth out price data, helping traders identify trends and reduce noise in their analysis.
The Length parameter acts as the length of the moving average, determining the smoothness and responsiveness of the filter. Adjusting this parameter changes how quickly the filter reacts to price changes.
The Q Factor controls the sharpness of the filter. A higher Q value results in a narrower frequency band, enhancing the precision of the filter. However, be cautious when setting the Q factor too high, as it can induce resonance, amplifying certain frequencies and potentially making the filter less effective by introducing noise.
Key Features of Biquad Filters
Biquad filters are a type of digital filter that provides a combination of low-pass, high-pass, band-pass, and notch filtering capabilities. In this implementation, the biquad filter is configured as a low pass filter, which allows low-frequency signals to pass while attenuating higher-frequency noise. This is particularly useful in trading to smooth out price data, making it easier to spot underlying trends and patterns.
Biquad filters are known for their smooth response and minimal phase distortion, making them ideal for technical analysis. The customizable length and Q factor allow for flexible adaptation to different trading strategies and market conditions. Designed for real-time charting, the biquad filter operates efficiently without significant lag, ensuring timely analysis.
By incorporating this biquad low pass filter into your trading toolkit, you can enhance your chart analysis with clearer insights into price movements, leading to more informed trading decisions.