Price to Bar Ratio - Scale / Scales / ScalingPrice to Bar Ratio - Scaling
The Price to Bar Ratio - Scaling indicator for TradingView is designed for traders who utilize Gann-based techniques, Michael Jenkins methodologies, or geometric market analysis. It calculates the relationship between price movement and time (bars), providing a bar-to-price ratio that traders can use to align their charts with structured scaling methods.
Key Features:
• Geometry-Based Scaling – Designed for traders using market geometry, time/price balancing, or cycle analysis.
• Automatic Ratio Calculation – Computes a bar-to-price ratio based on price movement and time.
• Square & Rectangle Modes – Provides different scaling approaches to suit various analytical methods.
• Balanced Chart Structure – Helps maintain a proportional relationship between price and time.
• Customizable Inputs – Adjustable parameters for flexibility across different markets, assets, and timeframes.
How to Use:
1. Apply the Price to Bar Ratio - Scaling indicator to your TradingView chart.
2. Enable Magnet Mode in TradingView to help anchor points snap accurately to price levels.
3. Manually select your range using the four anchor points to define the area for calculation.
4. The indicator will generate a table displaying the calculated bar-to-price ratio.
5. Copy the recommended value from the table.
6. Open the chart settings in TradingView.
7. Locate the "Lock Price to Bar Ratio" input field.
8. Paste the copied ratio value into the input field and apply the changes.
9. Due to TradingView's limitations on the magnet option for anchor points, it is recommended to add a new instance of the indicator rather than dragging the anchor points to a new range. This prevents unwanted snapping behavior and ensures accurate recalculations.
Will be adding more formulas in the future.
Indicator in use:
Cari dalam skrip untuk "Cycle"
G. Santostasi's Bimodal Regimes Power Law G. Santostasi's Bimodal Regimes Power Law Model
Invite-Only TradingView Indicator
The Bimodal Power Law Model is a powerful TradingView indicator that provides a detailed visualization of Bitcoin's price behavior relative to its long-term power law trend. By leveraging volatility-normalized deviations, this model uncovers critical upper and lower bounds that govern Bitcoin’s price dynamics.
Key Features:
Power Law Support Line:
The model highlights the power law support line, a natural lower bound that has consistently defined Bitcoin's price floor over time. This line provides a crucial reference point for identifying accumulation zones.
Volatility-Normalized Upper Bound:
The indicator introduces a volatility-normalized upper channel, dynamically defined by the deviations from the power law. This bound represents the natural ceiling for Bitcoin’s price action and adjusts in real time to reflect changes in market volatility.
Color-Shaded Volatility Bounds:
The upper and lower bounds are visualized as color-shaded regions that represent the range of current volatility relative to the power law trend. These shaded regions dynamically expand or contract based on the level of market volatility, providing an intuitive view of Bitcoin’s expected price behavior under normalized conditions.
Two Regime Analysis:
Using a Gaussian Hidden Markov Model (HMM), the indicator separates Bitcoin's price action into two distinct regimes:
Above the power law:
Bullish phases characterized by overextensions.
Below the power law:
Bearish or accumulation phases where price consolidates below the trend.
Dynamic Bounds with Standard Deviations:
The model plots 2 standard deviation bands for both regimes, offering precise insights into the natural limits of Bitcoin’s price fluctuations. Peaks exceeding these bounds are contextualized as anomalies caused by historically higher volatility, emphasizing the consistency of normalized deviations.
Enhanced Visualization and Analysis:
The indicator integrates running averages calculated using deviations from the power law trend and smoothed volatility data to ensure a visually intuitive representation of Bitcoin’s price behavior. These insights help traders and researchers identify when price action is approaching statistically significant levels.
Use Cases:
Support and Resistance Identification:
Use the power law support line and upper volatility bounds to identify critical levels for buying or taking profit.
Cycle Analysis:
Distinguish between sustainable trends and speculative bubbles based on deviations from the power law.
Risk Management:
The shaded volatility regions provide a dynamic measure of risk, helping traders gauge when Bitcoin is overbought or oversold relative to its historical norms.
Market Timing: Understand Bitcoin’s cyclical behavior to time entries and exits based on its position within the shaded bounds.
Note:
This indicator is designed for long-term Bitcoin investors, researchers, and advanced traders who seek to leverage statistical regularities in Bitcoin’s price behavior. Available by invitation only.
Global OECD CLI Diffusion Index YoY vs MoMThe Global OECD Composite Leading Indicators (CLI) Diffusion Index is used to gauge the health and directional momentum of the global economy and anticipate changes in economic conditions. It usually leads turning points in the economy by 6 - 9 months.
How to read: Above 50% signals economic expansion across the included countries. Below 50% signals economic contraction.
The diffusion index component specifically shows the proportion of countries with positive economic growth signals compared to those with negative or neutral signals.
The OECD CLI aggregates data from several leading economic indicators including order books, building permits, and consumer and business sentiment. It tracks the economic momentum and turning points in the business cycle across 38 OECD member countries and several other Non-OECD member countries.
CRT AMD indicatorThis indicator is based on the Power of three (Accumulation Manipulation Distribution) Cycle, by marking the candle that Sweep the low or high of the previous candle and then closed back inside the range of the previous candle, indicating a possibility of a Manipulation or Reversal.
Combining the indicator with HTF Array and LTF Setup Entry will significantly improve the accuracy.
VX DailyCycle PD Table (Levang)**Futures trading dependent**
QT Theory dependent (Daye) --> VX Theory DailyCycle with 3 ranges using detailing extreme premium range to mean range to extreme discount range *ONLY* 15min timeframe that start at 7:30am every trading day. This data table compares 3 triads (default qt triads as inputs) detailing what range each asset is currently in.
**continuous contracts are default as inputs but monthly contracts works best.**
Overview
This indicator creates a dynamic table showing the current market position of multiple assets across three major market segments: Equity Index futures, Currency futures, and Bond futures. Each asset's position is analyzed using VX Daily Cycle levels and displayed with intuitive color-coding and symbols.
Assets Tracked
Equity Triad: ES1!, NQ1!, YM1!
Currency Triad: DXY (Capital.com), 6E1!, 6B1!
Bond Triad: ZB1!, TN1!, ZF1!
Visual Interpretation
The table uses three main colors to indicate market positioning:
Green: Asset is trading at a discount
Yellow: Asset is trading in the mean range
Red: Asset is trading at a premium
Symbols (▲▲, ▲, △, ▽, ▼, ▼▼) provide additional detail about position within each range:
Double symbols (▲▲, ▼▼): Extreme levels
Solid symbols (▲, ▼): Strong moves
Hollow symbols (△, ▽): Moderate moves
Updates
The table updates every 15 minutes
Works on all timeframes while maintaining consistency
Position calculations are based on recent price action
Usage
This indicator is particularly useful for:
Cross-market analysis
Identifying relative value opportunities
Multi-timeframe market analysis
Understanding market correlations
Spotting potential reversals or continuations
Note
The indicator requires access to all listed symbols for full functionality. Some brokers may not provide access to all market
Legend:
VX Levels Color and Symbol Cheat Sheet
Upper Extension Range (Red)
▲▲ : (Extreme Premium)
▲ : (High Premium)
△ : (Moderate Premium)
Mean Range (Yellow)
△ : (Upper Mean)
▽ : (Lower Mean)
Lower Extension Range (Green)
▽ : (Moderate Discount)
▼ : (High Discount)
▼▼ : (Extreme Discount)
BTC x M2 Divergence (Weekly)### Why the "M2 Money Supply vs BTC Divergence with Normalized RSI" Indicator Should Work
IMPORTANT
- Weekly only indicator
- Combine it with BTC Halving Cycle Profit for better results
The "M2 Money Supply vs BTC Divergence with Normalized RSI" indicator leverages the relationship between macroeconomic factors (M2 money supply) and Bitcoin price movements, combined with technical analysis tools like RSI, to provide actionable trading signals. Here's a detailed rationale on why this indicator should be effective:
1. **Macroeconomic Influence**:
- **M2 Money Supply**: Represents the total money supply, including cash, checking deposits, and easily convertible near money. Changes in M2 reflect liquidity in the economy, which can influence asset prices, including Bitcoin.
- **Bitcoin Sensitivity to Liquidity**: Bitcoin, being a digital asset, often reacts to changes in liquidity conditions. An increase in money supply can lead to higher asset prices as more money chases fewer assets, while a decrease can signal tightening conditions and lower prices.
2. **Divergence Analysis**:
- **Economic Divergence**: The indicator calculates the divergence between the percentage changes in M2 and Bitcoin prices. This divergence can highlight discrepancies between Bitcoin's price movements and broader economic conditions.
- **Market Inefficiencies**: Large divergences may indicate inefficiencies or imbalances that could lead to price corrections or trends. For example, if M2 is increasing (indicating more liquidity) but Bitcoin is not rising proportionately, it might suggest a potential upward correction in Bitcoin's price.
3. **Normalization and Smoothing**:
- **Normalized Divergence**: Normalizing the divergence to a consistent scale (-100 to 100) allows for easier comparison and interpretation over time, making the signals more robust.
- **Smoothing with EMA**: Applying Exponential Moving Averages (EMAs) to the normalized divergence helps to reduce noise and identify the underlying trend more clearly. This double-smoothed divergence provides a clearer signal by filtering out short-term volatility.
4. **RSI Integration**:
- **RSI as a Momentum Indicator**: RSI measures the speed and change of price movements, indicating overbought or oversold conditions. Normalizing the RSI and incorporating it into the divergence analysis helps to confirm the strength of the signals.
- **Combining Divergence with RSI**: By using RSI in conjunction with divergence, the indicator gains an additional layer of confirmation. For instance, a bullish divergence combined with an oversold RSI can be a strong buy signal.
5. **Dynamic Zones and Sensitivity**:
- **Good DCA Zones**: Highlighting zones where the divergence is significantly positive (good DCA zones) indicates periods where Bitcoin might be undervalued relative to economic conditions, suggesting good buying opportunities.
- **Red Zones**: Marking zones with extremely negative divergence, combined with RSI confirmation, identifies potential market tops or bearish conditions. This helps traders avoid buying into overbought markets or consider selling.
- **Peak Detection**: The sensitivity setting for detecting upside down peaks allows for early identification of potential market bottoms, providing timely entry points for traders.
6. **Visual Cues and Alerts**:
- **Clear Visualization**: The plots and background colors provide immediate visual feedback, making it easier for traders to spot significant conditions without deep analysis.
- **Alerts**: Built-in alerts for key conditions (good DCA zones, red zones, sell signals) ensure traders can act promptly based on the indicator's signals, enhancing the practicality of the tool.
### Conclusion
The "M2 Money Supply vs BTC Divergence with Normalized RSI" indicator integrates macroeconomic data with technical analysis to offer a comprehensive view of Bitcoin's market conditions. By analyzing the divergence between M2 money supply and Bitcoin prices, normalizing and smoothing the data, and incorporating RSI for momentum confirmation, the indicator provides robust signals for identifying potential buying and selling opportunities. This holistic approach increases the likelihood of capturing significant market movements and making informed trading decisions.
Sessions ALL + 5 Custom (Redcrabice)I created a simple script that show the most 5 important sessions. i know that there are many other "sessions" scripts out there but most of them doesnt do what i want and some even lag alot because of the amount of codes. so i decided to create a simple browser friendly script that show 5 most important sessions. asia , frankfurt, london , newyork open and newyork along with 5 custom session for your own liking.
this is 1/3 series and indicator that i use along with my other indicators.
this code is based on my 90min cycle indicator and not a "repaint" as some people might say.
have a lovely trading journey.
sign
REDCRABICE
RVL Unreal Edge (concept build)Designed with a purpose, this script was intended for use by bots automating trading of XLM using a 6hr timeframe.
However the script has turned out to be a fantastic indicator on its own, and much of the power behind it is derived from John Ehler's incredible CG oscillator.
John Ehler was an electrical engineer, a Raytheon employee who began trading in the 1970's. He is best known for his work creating super-smoothing algorithms and methods of analysing cycle length and behaviour in price action, and his work in the field of zero-lag indicators - indicators that don't follow the price action, but are in fact capable of leading it actionably, and responding with essentially zero lag.
By approaching the price action as a sine wave with demonstrably a fractal nature, Ehler's makes a number of important advancements. His CG indicator is derived from calculations typically used to derive the centre of gravity in a physical object. It effectively works as a band-pass filter and is possibly one of the very best leading indicators avaliable.
Financial Astrology Mercury Helio HarmonicsMercury Helio Harmonics indicator represent the tropical zodiac energy forces that develop through the course of Mercury in the heliocentric zodiac wheel. The waves indicates the strength of cardinal energy (initiator) and it's harmonics. In Financial Astrology, Mercury represents the commerce, negotiations, transactions and trading, is very important cycle for trading.
Note: The Mercury Helio Harmonics indicator is based on an ephemeris array that covers years 2010 to 2030, prior or after this years the data is not available, this daily ephemeris are based on UTC time so in order to align properly with the price bars times you should set UTC as your chart timezone.
Financial Astrology Jupiter DeclinationJupiter moving from South declination minima toward the North maxima and during all the travel from North maxima to zero declination produced the strong bullish long term trend, this coincide with other planets declinations observations, in general, we noted that when a planet is in North declination (above zero boundary) this strengthen the planet force and produces more strong price effects.
This Jupiter declination pattern needs more research in others markets, will be great to get the participation from more financial astrologers that could research this declination cycle in other markets and share feedback with us.
Note: The Jupiter declination indicator is based on an ephemeris array that covers years 2010 to 2030, prior or after this years the declination is not available, this daily ephemeris are based on UTC time so in order to align properly with the price bars times you should set UTC as your chart reference timezone.
Financial Astrology Sun DeclinationExtreme Sun declinations occurs at the solstices of summer and fall which correspond to the entry of Sun into Cancer and Capricorn respectively. At this extreme points we can observe that many markets tend to produce corrections. Is very interesting to see that when Sun reach the lowest and highest declination extremes. this events correlates very close to price corrections, is not an infalible rule, don't repeat for all observations but in many occurrences during all the historical data that we have of BTCUSD since 2010 have happened.
Is very likely that this same pattern repeats in others markets so will be great to get the participation of other financial astrologers that could research this cycle and share feedback with us.
Note: The Sun declination indicator is based on an ephemeris array that covers years 2010 to 2030, prior or after this years the declination is not available, this daily ephemeris are based on UTC time so in order to align properly with the price bars times you should set UTC as your chart reference timezone.
Retrograde Planets█ OVERVIEW
Retrograde Planets is a TradingView script that highlights the retrograde cycles for all the planets including : Mercury, Venus, Mars, Jupiter, Saturn, etc etc..
A lot of Time-Theory/Gann traders use these cycles to gauge volatility and trend of the market. This script can highlight all the previous retrograde cycles of any planet of your choice.
The settings are easy and simple, you will just need to select the planet and activate it from the setting. And of course, you can change the color of the highlighted area.
Retrograde Planets can also project the future retrograde cycles and highlights them for you a year in advance ( 365 days ).
█ Future Plans and upgrades to this script may include :
1. Advance labeling.
2. Statistics box.
And more! Feel free to contact me with any feature that you would like to see in this script
█ How to use :
1. Open the settings.
2. Choose the planet.
3. Enable the Cycles using the checkbox.
Give the script a few seconds and you should be set.
This script is coded as an addon to the Gann ToolBox package/scripts.
Cyclical volatility index v1This indicator is used to measure the volatility of the cycle in question.
It is very useful for clearly reading impulsive phases or corrective phases
Calculate average volatility and current volatility
The labels improve the visualization.
It is fully customizable in shapes and colors
C and the ability to disable labels
For any bugs contact the creators
Quad centered moving averages v1This indicator includes four centered moving average!
The missing periods have been reconstructed with a very complex approximation and projection technique!
The hatched areas are approximations of the missing periods projected into the future.
It is possible to set the centering of the averages through the variable "Approximation Lenght" and the ratio between the main average and the underlying in "Period Partition".
Practical example of setting:
"Approximation Lenght" equal to 2 means that the centering will be of half a period.
"Period Partition" makes sure to cascade all averages by dividing them by the same number.
//Once decided the Main Cycle (default 256) we will get the 4 averages:
-red to 128
-orange 64
-yellow 32
-white 16
This is a great tool for cyclical analysis.
It is not possible, due to the pinescript v4 language limit, to set the average under 35 periods and over 1070 periods.
For any bugs contact the creators
BEAMThe BEAM indicator helps identifying promising times during a cycle for buying and selling Bitcoin or other crypto currencies. It can also be used with gold or silver after adjusting its parameters, but does not work very well with stocks.
Disclaimer: This is not financial advice. For educational purposes only.
Financial Freedom WaveRipper - Momentum MulticatorIn the Spirit of '76 commemorating this day on July 4th, this is my third indicator released using Pine Script version 4.0, something I contributed to often in a small role, and will continue to do, in my free time. Without revealing my American secret sauce ingenuity excessively, this indicator uses a high performance momentum algorithm that blows most momentum algorithms out the water. It's characteristics display blatantly the swift momentum at which directional high speed wind driven swells create rip tides in an asset. Not being drug out to sea and quickly going "under water" so to speak, is best mitigated by very timely, accurate information. Regarding the use of this script, the bright yellow line has a damping factor of 4 and the longest adjustable damping factor is 66.
My idea initially was... while there is great "one liner indicators" to use, I thought, why not multi-line "multicators" with little to adjust concerning dominant cycle fluctuations in the market. And voila, another radical experiment, turned visually compelling, similar to tumultuous ocean waves and how incredibly fast turning points can wax and wane, yet be anticipated. Living in America, I was once again determined to attain a replica of "Old Glory" in this companion multicator as well. It's embedded artwork makes it an articator too. Which is why I waited to release this sibling appropriately on July 4th too, a day of celebration of freedom, an empowering idea that has reached dessimenation world wide to so many other nations and peoples.
I once again would personally like to thank the talented individuals at TV for providing a platform that embraces an initial free membership, which I first obtained myself, for people like me to freely code in Pine with mathemagical ideas and mental wizardry, creating ultimately, inventions like this eye candy display above.
Features List Includes:
"Source" Selection
Enable/disable dark background for enhanced visibility
Longest period adjustment providing any adjustable period setting
A subtly adjustable multiplier tweak
Minimalized enable/disable adjustment for the theme
This is not a freely available indicator, FYI. To witness my Pine poetry in action, properly negotiated requests for unlimited access, per indicator, may ONLY be obtained by direct contact with me using TV's "Private Chats" or by "Message" in my member name above. The comments section below is solely just for commenting and other remarks, ideas, compliments, etc... If you do have any questions or comments regarding this indicator, I will consider your inquiries, thoughts, and ideas presented below in the comments section, when time provides it. As always, "Like" it if you like it, and also return to my scripts list occasionally for additional postings. Have a profitable future everyone!
ALMA Hurst Cycles - Potential Pivot points.Experiment in finding potential pivots using using multiple period volatility measurements (ATR) and ALMA.
------------------------------------------------------------------------------------------------------------------------------------
Warning!!! Must be tuned to obtain a good price fit for your time frame and instrument (and probably general market conditions). Default settings are only eyeball fit for XBTUSD 5M
So proper write up for a change :p
So a single ATR measurement say ATR(5) doesn't give much information alone, it doesn't give us direction for example. However if we plot a MA (in this case the Arnaud Legoux MA) and plot bands which are a multiple of the ATR around the MA we get a potential trading range based on recent volatility.
The assumption being that if volatility remains approximately the same AND if price moves beyond this ATR range it is highly probable to result in a reversion to the mean. Having reached the limit of recent volatility, available buying/selling pressure is exhausted and price pivots from that point back to the mean.
Now, if we plot multiple MA's of different lengths, they alone don't tell us too much alone either. But we also find reversions to the mean occurring between say a long and short MA. The short MA will rise above/below the long MA, return to the mean etc creating crossovers.
So we combine the two concepts. Three different length MAs with corresponding ATR lengths. The smallest band cycles above/below the median of the medium band (diverging from and reverting to the mean) and the medium band cycles above/below the median of the large band.
We want to find extreme points where a pivot is probable. The small band "bounces" or cycles back and forth within the medium band and the medium band "bounces" or cycles back and forth within the large band. Approximate short, medium and long trading ranges relative to MAs.
So for example and theoretically when the small band cycles to the top of the medium band AND the medium band cycles to the top of the large band and the price has risen above all of them, there is a high probability of there being a reversal.
So here's the interesting bit. There is far more going on than is immediately apparent. If you take the bands and normalize them (ie you pulled the median, upper and lower bands so they're straight horizontal lines), the price's position relative to the bands would give you something very, very close to an RSI.
The bands effectively give you three different length RSI's. When price exceeds all three bands is roughly equivalent to seeing the confluence of overbought/sold on three different length RSI's.
However unlike RSI, we also get an approximate trading range and price levels that that RSI would have to reach to indicate it is overbought/sold that takes into account recent volatility.
------------------------------------------------------
Caveats :
Similar to RSI downsides. Multi leg pumps/dumps can remain overbought/sold and give false signals.
Extended, narrow and declining ranges/ squeezes don't require much change in price action to trigger false signals.
Performs the best when ranging.
------------------------------------------------------
Signals and Bar Colors :
Bar colors (optional in settings) :
Green - Short MA > Medium MA > Long MA
Red - Short MA < Medium MA < Long MA
Three "tiered" signals:
Large triangles. High probabilty pivot. Price exceeded all bands at the top/bottom.
Medium triangles. Price exceeded the small and medium bands, DIDN'T exceed the large band AND the small band HAS exceeded the medium band.
Small triangles. Price exceeded the small and medium bands, DIDN'T exceed the large band AND the small band DIDN'T exceed the medium band.
Schaff Trend CycleThis indicator was originally developed by Doug Schaff in the 1990s (published in 2008).
TMA cycle3ma cycles has 6 stages
green>lime>yellow>red>orange>aqua>green>...
trade on green and red zone:)
Full Moon and New Moon IndicatorThe Full Moon & New Moon Indicator is a custom Pine Script indicator which marks Full Moon (Pournami) and New Moon (Amavasya) events on the price chart. This indicator helps traders who incorporate lunar cycles into their market analysis, as certain traders believe these cycles influence market sentiment and price action. The current script is added for the year 2024 and 2025 and the dates are considered as per the Telugu calendar.
Features
✅ Identifies and labels Full Moon & New Moon days on the chart for the year 2024 and 2025
How it Works!
On a Full Moon day, it places a yellow label ("Pournami") above the corresponding candle.
On a New Moon day, it places a blue label ("Amavasya") above the corresponding candle.
Example Usage
When a Full Moon label appears, check for potential trend reversals or high volatility.
When a New Moon label appears, watch for market consolidation or a shift in sentiment.
Combine with candlestick patterns, support/resistance, or momentum indicators for a stronger trading setup.
🚀 Add this indicator to your TradingView chart and explore the market’s reaction to lunar cycles! 🌕
Medium Term Weighted Stochastic (STPMT) by DGTLa Stochastique Pondérée Moyen Terme (STPMT) , or Mᴇᴅɪᴜᴍ Tᴇʀᴍ Wᴇɪɢʜᴛᴇᴅ Sᴛᴏᴄʜᴀꜱᴛɪᴄꜱ created by Eric Lefort in 1999, a French trader and author of trading books
█ The STPMT indicator is a tool which concerns itself with both the direction and the timing of the market. The STPMT indicator helps the trader with:
The general trend by observing the level around which the indicator oscillates
The changes of direction in the market
The timing to open or close a position by observing the oscillations and by observing the relative position of the STPMT versus its moving average
STPMT Calculation
stpmt = (4,1 * stoch(5, 3) + 2,5 * stoch(14, 3) + stoch(45, 14) + 4 * stoch(75, 20)) / 11.6
Where the first argument of the stoch function representation above is period (length) of K and second argument smoothing period of K. The result series is then plotted as red line and its moving average as blue line. By default disabled gray lines are the components of the STPMT
The oscillations of the STPMT around its moving average define the timing to open a position as crossing of STMP line and moving average line in case when both trends have same direction. The moving average determines the direction.
Long examples
█ Tʜᴇ CYCLE Iɴᴅɪᴄᴀᴛᴏʀ is derived from the STPMT. It is
cycle = stpmt – stpmt moving average
It is indicates more clearly all buy and sell opportunities. On the other hand it does not give any information on market direction. The Cycle indicator is a great help in timing as it allows the trader to more easily see the median length of an oscillation around the average point. In this way the traders can simply use the time axis to identify both a favorable price and a favorable moment. The Cycle Indicator is presented as histogram
The Lefort indicators are not a trading strategy. They are tools for different purposes which can be combined and which can serve for trading all instruments (stocks, market indices, forex, commodities…) in a variety of time frames. Hence they can be used for both day trading and swing trading.
👉 For whom that would like simple version of the Cycle indicator on top of the main price chart with signals as presented below.
Please note that in the following code STMP moving average direction is not considered and will plot signals regardless of the direction of STMP moving average. It is not a non-repainting version too.
here is pine code for the overlay version
// © dgtrd
//@version=4
study("Medium Term Weighted Stochastic (STPMT) by DGT", "STPMT ʙʏ DGT ☼☾", true, format.price, 2, resolution="")
i_maLen = input(9 , "Stoch MA Length", minval=1)
i_periodK1 = input(5 , "K1" , minval=1)
i_smoothK1 = input(3 , "Smooth K1", minval=1)
i_weightK1 = input(4.1 , "Weight K1", minval=1, step=.1)
i_periodK2 = input(14 , "K2" , minval=1)
i_smoothK2 = input(3 , "Smooth K2", minval=1)
i_weightK2 = input(2.5 , "Weight K2", minval=1, step=.1)
i_periodK3 = input(45 , "K3" , minval=1)
i_smoothK3 = input(14 , "Smooth K3", minval=1)
i_weightK3 = input(1. , "Weight K3", minval=1, step=.1)
i_periodK4 = input(75 , "K4" , minval=1)
i_smoothK4 = input(20 , "Smooth K4", minval=1)
i_weightK4 = input(4. , "Weight K4", minval=1, step=.1)
i_data = input(false, "Components of the STPMT")
//------------------------------------------------------------------------------
// stochastic function
f_stoch(_periodK, _smoothK) => sma(stoch(close, high, low, _periodK), _smoothK)
//------------------------------------------------------------------------------
// calculations
// La Stochastique Pondérée Moyen Terme (STPMT) or Medium Term Weighted Stochastics calculation
stpmt = (i_weightK1 * f_stoch(i_periodK1, i_smoothK1) + i_weightK2 * f_stoch(i_periodK2, i_smoothK2) + i_weightK3 * f_stoch(i_periodK3, i_smoothK3) + i_weightK4 * f_stoch(i_periodK4, i_smoothK4)) / (i_weightK1 + i_weightK2 + i_weightK3 + i_weightK4)
stpmt_ma = sma(stpmt, i_maLen) // STPMT Moving Average
cycle = stpmt - stpmt_ma // Cycle Indicator
//------------------------------------------------------------------------------
// plotting
plotarrow(change(sign(cycle)), "STPMT Signals", color.green, color.red, 0, maxheight=41)
alertcondition(cross(cycle, 0), title="Trading Opportunity", message="STPMT Cycle : Probable Trade Opportunity\n{{exchange}}:{{ticker}}->\nPrice = {{close}},\nTime = {{time}}")
[blackcat] L2 Ehlers Cyber CycleLevel: 2
Background
John F. Ehlers introuced Cyber Cycle Indicator in his "Cybernetic Analysis for Stocks and Futures" chapter 4 on 2004.
Function
Trading the Cyber Cycle Indicator is straightforward. Buy when the at this point. Sell when the Cycle line crosses under the Trigger line. You are at the bottom of the cycle at this point. Sell when the Cycle line crosses under the Trigger line. You are at the top of the cycle in this case. To be sure, there are crossings at other than the cyclic turning points. Many of these can be eliminated by discretionary traders using their experience or others of their favorite tools. One of the more interesting aspects of the Cyber Cycle is that it was developed simultaneously with the Instantaneous Trendline. They are opposite sides of the same coin because the total frequency content of the market being analyzed is in one indicator or the other. This is important because the conventional methods of using moving averages and oscillators can be dispensed with.
Key Signal
Cycle ---> Cyber Cycle fast line
Cycle (2) ---> Cyber Cycle slow line
Pros and Cons
100% John F. Ehlers definition translation of original work, even variable names are the same. This help readers who would like to use pine to read his book. If you had read his works, then you will be quite familiar with my code style.
Remarks
The 24th script for Blackcat1402 John F. Ehlers Week publication.
Readme
In real life, I am a prolific inventor. I have successfully applied for more than 60 international and regional patents in the past 12 years. But in the past two years or so, I have tried to transfer my creativity to the development of trading strategies. Tradingview is the ideal platform for me. I am selecting and contributing some of the hundreds of scripts to publish in Tradingview community. Welcome everyone to interact with me to discuss these interesting pine scripts.
The scripts posted are categorized into 5 levels according to my efforts or manhours put into these works.
Level 1 : interesting script snippets or distinctive improvement from classic indicators or strategy. Level 1 scripts can usually appear in more complex indicators as a function module or element.
Level 2 : composite indicator/strategy. By selecting or combining several independent or dependent functions or sub indicators in proper way, the composite script exhibits a resonance phenomenon which can filter out noise or fake trading signal to enhance trading confidence level.
Level 3 : comprehensive indicator/strategy. They are simple trading systems based on my strategies. They are commonly containing several or all of entry signal, close signal, stop loss, take profit, re-entry, risk management, and position sizing techniques. Even some interesting fundamental and mass psychological aspects are incorporated.
Level 4 : script snippets or functions that do not disclose source code. Interesting element that can reveal market laws and work as raw material for indicators and strategies. If you find Level 1~2 scripts are helpful, Level 4 is a private version that took me far more efforts to develop.
Level 5 : indicator/strategy that do not disclose source code. private version of Level 3 script with my accumulated script processing skills or a large number of custom functions. I had a private function library built in past two years. Level 5 scripts use many of them to achieve private trading strategy.