Stochastic EMA, SMA, VWMA + DivergenceEvery MetaTrader User knows the function to switch the stochastic calculation from simple to exponential.
So i took the original Stochastic code from TV and enhanced it for the SMA, EMA, and VWMA smoothing. If you are using a longer K Smoothing interval you will recognize a notable difference between SMA and EMA.
Standard Stochastic Calculation that is well kown
Option to switch smoothing calculation
Choice between Simple Moving Average, Exponential Moving Average, Volume Weighted Moving Average
If you have more wishes regarding the smoothing, just leave a comment i can add a lot more...
On my to-do list is also the divergence lines known from the "divergence indicator" (RSI).
I hope this helps to get better entries ;-)
Have fun!
Oscillators
JS-TechTrading: VWAP Momentum_Pullback StrategyGeneral Description and Unique Features of this Script
Introducing the VWAP Momentum-Pullback Strategy (long-only) that offers several unique features:
1. Our script/strategy utilizes Mark Minervini's Trend-Template as a qualifier for identifying stocks and other financial securities in confirmed uptrends.
NOTE: In this basic version of the script, the Trend-Template has to be used as a separate indicator on TradingView (Public Trend-Template indicators are available on TradingView – community scripts). It is recommended to only execute buy signals in case the stock or financial security is in a stage 2 uptrend, which means that the criteria of the trend-template are fulfilled.
2. Our strategy is based on the supply/demand balance in the market, making it timeless and effective across all timeframes. Whether you are day trading using 1- or 5-min charts or swing-trading using daily charts, this strategy can be applied and works very well.
3. We have also integrated technical indicators such as the RSI and the MA / VWAP crossover into this strategy to identify low-risk pullback entries in the context of confirmed uptrends. By doing so, the risk profile of this strategy and drawdowns are being reduced to an absolute minimum.
Minervini’s Trend-Template and the ‘Stage-Analysis’ of the Markets
This strategy is a so-called 'long-only' strategy. This means that we only take long positions, short positions are not considered.
The best market environment for such strategies are periods of stable upward trends in the so-called stage 2 - uptrend.
In stable upward trends, we increase our market exposure and risk.
In sideways markets and downward trends or bear markets, we reduce our exposure very quickly or go 100% to cash and wait for the markets to recover and improve. This allows us to avoid major losses and drawdowns.
This simple rule gives us a significant advantage over most undisciplined traders and amateurs!
'The Trend is your Friend'. This is a very old but true quote.
What's behind it???
• 98% of stocks made their biggest gains in a Phase 2 upward trend.
• If a stock is in a stable uptrend, this is evidence that larger institutions are buying the stock sustainably.
• By focusing on stocks that are in a stable uptrend, the chances of profit are significantly increased.
• In a stable uptrend, investors know exactly what to expect from further price developments. This makes it possible to locate low-risk entry points.
The goal is not to buy at the lowest price – the goal is to buy at the right price!
Each stock goes through the same maturity cycle – it starts at stage 1 and ends at stage 4
Stage 1 – Neglect Phase – Consolidation
Stage 2 – Progressive Phase – Accumulation
Stage 3 – Topping Phase – Distribution
Stage 4 – Downtrend – Capitulation
This strategy focuses on identifying stocks in confirmed stage 2 uptrends. This in itself gives us an advantage over long-term investors and less professional traders.
By focusing on stocks in a stage 2 uptrend, we avoid losses in downtrends (stage 4) or less profitable consolidation phases (stages 1 and 3). We are fully invested and put our money to work for us, and we are fully invested when stocks are in their stage 2 uptrends.
But how can we use technical chart analysis to find stocks that are in a stable stage 2 uptrend?
Mark Minervini has developed the so-called 'trend template' for this purpose. This is an essential part of our JS-TechTrading pullback strategy. For our watchlists, only those individual values that meet the tough requirements of Minervini's trend template are eligible.
The Trend Template
• 200d MA increasing over a period of at least 1 month, better 4-5 months or longer
• 150d MA above 200d MA
• 50d MA above 150d MA and 200d MA
• Course above 50d MA, 150d MA and 200d MA
• Ideally, the 50d MA is increasing over at least 1 month
• Price at least 25% above the 52w low
• Price within 25% of 52w high
• High relative strength according to IBD.
NOTE: In this basic version of the script, the Trend-Template has to be used as a separate indicator on TradingView (Public Trend-Template indicators are available in TradingView – community scripts). It is recommended to only execute buy signals in case the stock or financial security is in a stage 2 uptrend, which means that the criteria of the trend-template are fulfilled.
This strategy can be applied to all timeframes from 5 min to daily.
The VWAP Momentum-Pullback Strateg y
For the JS-TechTrading VWAP Momentum-Pullback Strategy, only stocks and other financial instruments that meet the selected criteria of Mark Minervini's trend template are recommended for algorithmic trading with this startegy.
A further prerequisite for generating a buy signals is that the individual value is in a short-term oversold state (RSI).
When the selling pressure is over and the continuation of the uptrend can be confirmed by the MA / VWAP crossover after reaching a price low, a buy signal is issued by this strategy.
Stop-loss limits and profit targets can be set variably.
Relative Strength Index (RSI)
The Relative Strength Index (RSI) is a technical indicator developed by Welles Wilder in 1978. The RSI is used to perform a market value analysis and identify the strength of a trend as well as overbought and oversold conditions. The indicator is calculated on a scale from 0 to 100 and shows how much an asset has risen or fallen relative to its own price in recent periods.
The RSI is calculated as the ratio of average profits to average losses over a certain period of time. A high value of the RSI indicates an overbought situation, while a low value indicates an oversold situation. Typically, a value > 70 is considered an overbought threshold and a value < 30 is considered an oversold threshold. A value above 70 signals that a single value may be overvalued and a decrease in price is likely , while a value below 30 signals that a single value may be undervalued and an increase in price is likely.
For example, let's say you're watching a stock XYZ. After a prolonged falling movement, the RSI value of this stock has fallen to 26. This means that the stock is oversold and that it is time for a potential recovery. Therefore, a trader might decide to buy this stock in the hope that it will rise again soon.
The MA / VWAP Crossover Trading Strategy
This strategy combines two popular technical indicators: the Moving Average (MA) and the Volume Weighted Average Price (VWAP). The MA VWAP crossover strategy is used to identify potential trend reversals and entry/exit points in the market.
The VWAP is calculated by taking the average price of an asset for a given period, weighted by the volume traded at each price level. The MA, on the other hand, is calculated by taking the average price of an asset over a specified number of periods. When the MA crosses above the VWAP, it suggests that buying pressure is increasing, and it may be a good time to enter a long position. When the MA crosses below the VWAP, it suggests that selling pressure is increasing, and it may be a good time to exit a long position or enter a short position.
Traders typically use the MA VWAP crossover strategy in conjunction with other technical indicators and fundamental analysis to make more informed trading decisions. As with any trading strategy, it is important to carefully consider the risks and potential rewards before making any trades.
This strategy is applicable to all timeframes and the relevant parameters for the underlying indicators (RSI and MA/VWAP) can be adjusted and optimized as needed.
Backtesting
Backtesting gives outstanding results on all timeframes and drawdowns can be reduced to a minimum level. In this example, the hourly chart for MCFT has been used.
Settings for backtesting are:
- Period from April 2020 until April 2021 (1 yr)
- Starting capital 100k USD
- Position size = 25% of equity
- 0.01% commission = USD 2.50.- per Trade
- Slippage = 2 ticks
Other comments
• This strategy has been designed to identify the most promising, highest probability entries and trades for each stock or other financial security.
• The RSI qualifier is highly selective and filters out the most promising swing-trading entries. As a result, you will normally only find a low number of trades for each stock or other financial security per year in case you apply this strategy for the daily charts. Shorter timeframes will result in a higher number of trades / year.
• As a result, traders need to apply this strategy for a full watchlist rather than just one financial security.
Fair Value Strategy - ekmllThis is a strategy using SPX's Fair Value derived from Net Liquidity.
The main difference between this one and calebsandfort's one is net liquidity values in this one are calculated in TradingView and doesn't need author's daily library updates to function.
Net Liquidity function is simply: Fed Balance Sheet - Treasury General Account - Reverse Repo Balance
Formula for calculating the fair value of and Index using Net Liquidity looks like this: (WALCL - WTREGEN - RRPONTSYD)/1000000000/scalar - subtractor
The Index Fair Value is then subtracted from the Index value which creates an oscillating diff value.
When diff is greater than the overbought threshold, Index is considered overbought and we go short/sell.
When diff is less than the oversold signal, Index is considered oversold and we cover/buy.
Parameters:
Index: SPX, NDX, RUT
Strategy: Short Only, Long Only, Long/Short
Inverse (bool): check if using an inverse ETF to go long instead of short.
Scalar (float)
Subtractor (int)
Overbought Threshold (int)
Oversold Threshold (int)
Start After Date: When the strategy should start trading
Close Date: Day to close open trades. I just like it to get complete results rather than the strategy ending with open trades.
I've optimized the parameters for SPX.
Equilibrium╭━━━╮╱╱╱╱╱╱╭╮╱╭╮
┃╭━━╯╱╱╱╱╱╱┃┃╱┃┃
┃╰━━┳━━┳╮╭┳┫┃╭┫╰━┳━┳┳╮╭┳╮╭╮
┃╭━━┫╭╮┃┃┃┣┫┃┣┫╭╮┃╭╋┫┃┃┃╰╯┃
┃╰━━┫╰╯┃╰╯┃┃╰┫┃╰╯┃┃┃┃╰╯┃┃┃┃
╰━━━┻━╮┣━━┻┻━┻┻━━┻╯╰┻━━┻┻┻╯
╱╱╱╱╱╱┃┃
╱╱╱╱╱╱╰╯
Overview
Equilibrium is a tool designed to measure the buying & selling pressure in the market. It is depicted as a “pressure gauge” that automatically adjusts as new candles are formed, providing a real-time indication of who's on top right now, buyers or sellers?
Background
Supply & demand is considered to be the main driving force of our modern economies, where the interaction between the two parties(sellers & buyers) leads to the determination of the fair price for a given product. Stock markets are no exception, they operate very much based around the idea of supply & demand.
In simple terms, supply refers to the availability of a product, and demand is the willingness of consumers to buy that product at a given price. It is obvious that different vendors may sell the same product at slightly different prices, and similarly, different customers may choose to buy the same product from different vendors at varying prices. The idea is that the price is allowed to fluctuate from time to time, but in a free & fair market, the price will eventually settle down to a value that makes both the parties happy. Such a state is known as the “Price-Equilibrium”, and this process is also referred to as the market mechanism.
This is the basic assumption around which this tool is based, the market is always trying to move towards a state of equilibrium.
Calculations
This tool takes a simplistic approach to estimate the degree of imbalance between buyers & sellers, here’s a brief summary of how the pressure is calculated:
- We compute the total lengths of red & green candles for a given period, i.e. price range multiplied by the volume for that candle.
- Then the distribution of each type of candle is calculated.
- Assuming more red candles denote more selling pressure, and green candles denote buying pressure, the gauge is populated cell by cell.
- As the pressure on one side increases, the intensity of the cell color also increases, signifying the extent to which one side is dominating.
How to use it
- The indicator is designed as a pressure gauge that moves up(vertical alignment) or to the right(horizontal alignment) as the buying pressure increases, and moves down or to the left as the selling pressure increases. How it is to be used & applied, that completely depends on your trading methodology. But, the general idea is that we expect the market to be in a state of equilibrium, and if that is not the case the tool will highlight that, and this is also where the opportunity lies to find suitable trades.
- Just by having an idea about who’s dominating the market currently, a trader can also pick sides wisely. Remember, the market is always striving to come back a state of equilibrium, and a slight imbalance can indicate the current trend, and more importantly, who’s more likely to make the next move.
User Settings
The tool offers some minimal configurations for the end user:
- You can choose to display the actual percentage value in the gauge(Show Text).
- You can adjust colors that denote buyers & sellers.
- You can change the layout of gauge, default is vertical(right side of the screen).
- Last, and most important, you can adjust the number of candles to traverse for calculating the pressure. Default is 50, can go upto 1000.
Supertrend ANY INDICATOR (RSI, MFI, CCI, etc.) + Range FilterThis indicator will generate a supertrend of your chosen configuration on any of the following indicators:
RSI
MFI
Accum/Dist
Momentum
On Balance Volume
CCI
There is also a RANGE FILTER built into the scripts so that you can smooth the indicators for the supertrend. This is an optional configuration in the settings. Also, you can change the oversold/overbought bounds in the settings (they are removed entirely for indicators without bounds).
If you find this indicator useful, please boost it and follow! I am open to suggestions for adding new indicators to this script, it's very simple to add new ones, just suggest them in the comments.
RSI is in Normal Distribution?Does RSI Follow a Normal Distribution?
The value of RSI was converted to a value between 0~2, 2~4, ..., 98~100, and the number of samples was graphed.
The Z values are expressed so that the values corresponding to 30 and 70 of the RSI can be compared with the standard normal distribution.
Additionally, when using the RSI period correction function of the 'RSI Candle Advanced V2' indicator that I made before, it shows no change in standard deviation.
RSI는 정규분포를 따를까요
RSI의 값을 0~2, 2~4, ..., 98~100 사이 값으로 변환하고 그 표본 갯수를 그래프로 표현하였습니다.
Z 값은 RSI의 30, 70에 해당하는 값을 표준정규분포와 비교할 수 있도록 표현하였습니다.
추가적으로 제가 예전에 만들었던 'RSI Candle Advanced V2' 지표의 RSI 기간 보정 함수를 사용할 경우 표준편차의 변화가 없음을 보입니다.
Relative Strength Index Wave Indicator [CC]The Relative Strength Index Wave Indicator was created by Constance Brown (Technical Analysis for the Trading Professional), and this is a unique indicator that uses the weighted close formula, but instead of using the typical price values, it uses the RSI calculated from the various prices. It then creates a rainbow by smoothing the weighted RSI with four different lengths. As far as the buy or sell signals with this indicator go, I did change things from the original source, so feel free to experiment and let me know if anything works better for you. I decided to do a variation of the original source and create buy and sell signals based on crossovers, but my version only uses the first and second smoothed RSI lines. You could also average all of the lines and buy when the average is rising and sell when it starts to fall. I have used my typical buy and sell signals to use darker colors for strong signals and lighter colors for normal signals. Because of the rainbow effect from the wave, the color changes will only appear for the bar itself when you enable that setting.
Let me know if there is any other script you would like to see me publish! I will have plenty more RSI scripts to publish in the next week. Let me know if you like this indicator series.
Reverse Double Smoothed Relative Strength Index Bands[CC]The Reverse Double Smoothed Relative Strength Index Bands is a custom script of mine that is another part of my RSI indicator series, which I will be publishing over the next week or so. This takes my Double Smoothed Relative Strength Index script and applies the Reverse RSI formula to create a new Bollinger Bands type indicator. This concept can work for almost any oscillator with some slight tweaking. I have a reverse RSI being calculated for each major RSI level to give you an approximation of what the price would look like if that RSI level was hit. Feel free to tweak the RSI levels of course. I will publish more Reverse indicators since that doesn't seem to be a topic that is touched on very frequently. I have color coded the indicator to show darker colors when it is a strong signal and lighter colors for normal signals. Buy when the lines turn green and sell when they turn red.
This was a custom request from @kerpiciwuasile so let me know if you want to see me publish another custom script!
Reverse Relative Strength Indicator [CC]The Reverse Relative Strength Index was created by Giorgos Siligardos (Stocks & Commodities V. 21:6 (18-30)). It is a handy indicator that reverse engineers the RSI price calculation to show what the price would have to be for the RSI value to match our chosen input. You can select your chosen RSI level using the RSI Level input for this indicator. For example if you wanted to see what the price would be for the RSI value to match the oversold level then you would set the RSI Level for 30 and it will plot that price on the chart. This uses some simple math to extrapolate the price with some basic algebra from the typical RSI calculation. This, of course, is a very similar concept to my previous Reverse Moving Average Convergence Divergence script. This indicator formula can be used for any oscillator with some slight tweaking and could also be customized to show the price for overbought and oversold levels, which I will probably do in the near future. This indicator is useful in many ways such as a trend indicator as my example shows or for a price projection tool. For example, if you had a current RSI level of 66 and it was going up and you want to see what the price would be if it reached the overbought level then you could do that. Let me know what works well for you and if you have any suggestions for how to further improve upon this script. I have included darker colors to show stronger signals and lighter colors to show normal signals. Buy when the line turns green and sell when it turns red.
I have a bunch of backlogged scripts that I'm trying to publish, so I figured I would focus on my RSI scripts since I have a bunch, so be prepared to see a bunch of those over the next week or so. Let me know if there are any other scripts you would like to see me publish!
Soheil PKO's 5 min Hitman Scalp - 3MA + Laguerre RSI + ADX [Pt]Someone sent me this strategy found on YouTube. It is Soheil PKO's "The Best and Most Profitable Scalping Strategy" Best way to find out is to code it =)
This strategy uses Moving Average Ribbon, Laguerre RSI, and ADX. This script only displays the MA ribbon, you will need to add Laguerre RSI and ADX separately.
Long Entry Criteria:
- 16 EMA > 48 EMA > 200 SMA
- Laguerre RSI > 80
- ADX > 20
Long Exit Criterion:
- 16 EMA < 48 EMA
Short Entry Criteria:
- 16 EMA < 48 EMA < 200 SMA
- Laguerre RSI < 20
- ADX > 20
Short Exit Criterion:
- 16 EMA > 48 EMA
As mentioned in the video, risk management is very important, especially for scalping strategies. Therefore, I've added option for setting Stop Loss and Price Target in the options for you guys to play with.
All parameters are configurable.
Enjoy~~
Trend Indicator with RSI and Fibbonacci Band 0.702 crossingsToday we have a new Indicator set, which I created using inspiration from the Trend Magic Indicator from KivancOzbilgic and adding several new aspects to it and a slightly modified calculation of the trend indicator itself.
You can change the inputs by changing the pre set values in the settings, but I found the current settings quite accurate. Feel free to experiment to fine tune the indicators.
Here are the details of the script:
Trend indicated within candles and as a line
- bullish and bearish trends are now also indicated within the candle based on the CCI calculation.
- Bullish is indicated by a green circle below the candle or as one may call it a "dot"
- bearish trend is indicated by a red circle above the candle
Entry Signal based on RSI crossing its EMA
- my motivation was to have a clearer entry signal besides highlighting a trend, which can not really be used to identify a good entry but to give confidence or when loosing trend to give an exit signal.
- after studiying the RSI and how it works together with its EMA it looks quite interesting as an entry or exit signal. But be cautios if the EMA and RSI values are moving in a narrow area we get a lot of crosses and therefore signals which should rather be ignored rather to be act on. So the the range where the cross happens is also quite important. But this aspect is not yet reflected as a rule/ logic.
But I am thinking of adding something.. or alternativly best to switch to another timeframe to get some better data
RSI overbought and oversold as Diamonds
- I also added key indications of oversold or overbought as Blue and Pink diamonds, can be considered as additional information to maybe identify a short term top or bottom.. but its not very accurate.
Entry signal based on crossing Fibbonachi Band 0.702
- So far the 0.702 seems to be quite an interesting retracement level which seems to be met a lot of times
- based on the assumption the price will evantually hit the 0.702 either direction I wanted to get a signal when this happens
- BUT! a big but, unfortunalty the Fibbonachi bands tend to bloat up in case of high volatility so it is not easy to find the crossing on higher timeframes
Here are the standard value which I found quite accurate for the assets I use this indicator set:
CCI Period = 5
ATR Multiplier = 1
ATR Period = 1
Source = High Low Close (hlc3 average value of the candle
Here the inputs used for the RSI Crossing signal (here you should play around a little to see which entry would have been best..)
RSI Length = 14
RSI Oversold = 25 (to be used for the "golden" entry signal based on the FBB crossing)
RSI Overbought = 80 (to be used for the "golden" entry signal based on the FBB crossing)
RSI Moving Average Length
In future versions I will add options to activate or deactive some of the plotting and espacially this golden dot when the fibbonachi band is being crossed needs some fine tuning..
And lets see if there is a way to fix the bloating of those bands..
TASC 2023.03 Every Little Bit Helps - Special EditionMy first Published contribution.
Gracious thank you to all Pine Coders,
this has subtle features that have multiple shifts based on inputs.
with some experimentation, one might try pushing other sources
at the hue dials and see more dynamic indication.
for John Ehlers article
TASC Magazine This Month.
- Special Edition.
MACD & RSI Overlay (Expo)█ Overview
The MACD & RSI Overlay (Expo) trading indicator is a technical analysis tool that combines two popular indicators, the Relative Strength Index (RSI ) and the Moving Average Convergence Divergence (MACD ), and overlays them onto the price chart. The indicator oscillates relative to price, so it plots the RSI and MACD around price while still displaying the same insights as the regular MACD and RSI indicators. This feature gives traders a unique perspective, allowing them to see the relationship between price, momentum, and trend in a single chart.
This indicator is a valuable addition to any trader's technical analysis toolkit, whether they are a beginner or an experienced trader.
█ MACD
█ RSI
The RSI comes with overbought and oversold areas, which can be set by the trader.
█ MACD & RSI
█ Trend Feature
What sets the MACD & RSI Overlay indicator apart is its ability to factor in the underlying trend. This feature makes the indicator more useful than ever before, as traders can use it to filter trades in the direction of the trend. By considering the underlying trend, traders can gain valuable insights into market trends.
█ Benefits
One of the primary benefits of having the MACD and RSI plotted directly on the price chart is that it provides a more intuitive understanding of the relationship between price, momentum, and trend. Traders can quickly identify the direction of the trend by observing the price movement relative to the MACD and RSI lines. In addition, by having these indicators plotted on the chart, traders can quickly identify potential buy and sell signals and develop new trading strategies.
█ How to use
One of the most popular strategies is to use the MACD & RSI Overlay indicator to look for crossings. A crossing occurs when the MACD and RSI lines cross over each other or when they cross over the signal line. These crossings can signal potential trend reversals and momentum shifts. For example, if the MACD line crosses over the signal line from below, it could indicate a bullish signal, while a cross from above could indicate a bearish signal.
-----------------
Disclaimer
The information contained in my Scripts/Indicators/Ideas/Algos/Systems does not constitute financial advice or a solicitation to buy or sell any securities of any type. I will not accept liability for any loss or damage, including without limitation any loss of profit, which may arise directly or indirectly from the use of or reliance on such information.
All investments involve risk, and the past performance of a security, industry, sector, market, financial product, trading strategy, backtest, or individual's trading does not guarantee future results or returns. Investors are fully responsible for any investment decisions they make. Such decisions should be based solely on an evaluation of their financial circumstances, investment objectives, risk tolerance, and liquidity needs.
My Scripts/Indicators/Ideas/Algos/Systems are only for educational purposes!
Shorting when Bollinger Band Above Price with RSI (by Coinrule)The Bollinger Bands are among the most famous and widely used indicators. A Bollinger Band is a technical analysis tool defined by a set of trendlines plotted two standard deviations (positively and negatively) away from a simple moving average ( SMA ) of a security's price, but which can be adjusted to user preferences. They can suggest when an asset is oversold or overbought in the short term, thus providing the best time for buying and selling it.
The relative strength index ( RSI ) is a momentum indicator used in technical analysis. RSI measures the speed and magnitude of a security's recent price changes to evaluate overvalued or undervalued conditions in the price of that security. The RSI can do more than point to overbought and oversold securities. It can also indicate securities primed for a trend reversal or corrective pullback in price. It can signal when to buy and sell. Traditionally, an RSI reading of 70 or above indicates an overbought situation. A reading of 30 or below indicates an oversold condition.
The short order is placed on assets that present strong momentum when it's more likely that it is about to reverse. The rule strategy places and closes the order when the following conditions are met:
ENTRY
The closing price is greater than the upper standard deviation of the Bollinger Bands
The RSI is less than 70.
EXIT
The trade is closed when the RSI is less than 70
The lower standard deviation of the Bollinger Band is less than the closing price.
This strategy was backtested from the beginning of 2022 to capture how this strategy would perform in a bear market.
The strategy assumes each order to trade 70% of the available capital to make the results more realistic. A trading fee of 0.1% is taken into account. The fee is aligned to the base fee applied on Binance, which is the largest cryptocurrency exchange by volume.
Ehlers Stochastic Center Of Gravity [CC]The Stochastic Center Of Gravity Indicator was created by John Ehlers (Cybernetic Analysis For Stocks And Futures pgs 79-80), and this is one of the many cycle scripts that I have created but not published yet because, to be honest, I don't use cycle indicators in my everyday trading. Many of you probably do, so I will start publishing my big backlog of cycle-based indicators. These indicators work best with a trend confirmation or some other confirmation indicator to pair with it. The current cycle is the length of the trend, and since most stocks generally change their underlying trend quite often, especially during the day, it makes sense to adjust the length of this indicator to match the stock you are using it on. As you can see, the indicator gives constant buy and sell signals during a trend which is why I recommend using a confirmation indicator.
I have color-coded it to use lighter colors for normal signals and darker colors for strong signals. Buy when the line turns green and sell when it turns red.
Let me know if there are any other scripts you would like to see me publish!
RSI Trendlines with BreakoutsA pivot-based breakout indicator that attempts to provide traders with a visual aid for finding breakouts on the RSI. Similar to how we use trendlines on our charts, using them on the Relative Strength Index can also give us a sense of direction in the markets.
This script uses its own pivot-based system that checks for real-time swing levels and triggers a new pivot event after every dip and nth bars. The breakout alerts that are given were not designed to be taken as signals since their purpose is to provide an extra bit of confluence. Because of this, I added no other conditions that try to make the alerts "perfect", but instead, print every breakout that is detected. Despite stating this, I did happen to add a condition that checks the difference in RSI and the breakout value, but that's as far as it'll go.
There are alerts built-in to the script, along with adjustable repainting options.
🔳 Settings
Lookback Range: Lookback period to trigger a new pivot point when conditions are met.
RSI Difference: The difference between the current RSI value and the breakout value. How much higher in value should the current RSI be compared to the breakout value in order to detect a breakout?
RSI Settings
Styling Options
🔳 Repaint Options
On: Allows repainting
Off - Bar Confirmation: Prevents repainting and generates alerts when the bar closes. (1 candle later)
🔳 How it Works
Before a trendline is drawn, the script retrieves the slope between the previous pivot point and the current. Then it adds or subtracts the slope x amount of times (based on the lookback range) from the current pivot value until the current x-axis is reached. By doing this we can get a trendline that will detect a breakout accurately.
The result
When using the RSI Difference condition, the script will print breakouts whenever the condition is true, because of this dotted lines were added to track where the alert was triggered.
🔳 Alerts
Simple_RSI+PA+DCA StrategyThis strategy is a result of a study to understand better the workings of functions, for loops and the use of lines to visualize price levels. The strategy is a complete rewrite of the older RSI+PA+DCA Strategy with the goal to make it dynamic and to simplify the strategy settings to the bare minimum.
In case you are not familiar with the older RSI+PA+DCA Strategy, here is a short explanation of the idea behind the strategy:
The idea behind the strategy based on an RSI strategy of buying low. A position is entered when the RSI and moving average conditions are met. The position is closed when it reaches a specified take profit percentage. As soon as the first the position is opened multiple PA (price average) layers are setup based on a specified percentage of price drop. When the price hits the layer another position with the same position size is is opened. This causes the average cost price (the white line) to decrease. If the price drops more, another position is opened with another price average decrease as result. When the price starts rising again the different positions are separately closed when each reaches the specified take profit. The positions can be re-opened when the price drops again. And so on. When the price rises more and crosses over the average price and reached the specified Stop level (the red line) on top of it, it closes all the positions at once and cancels all orders. From that moment on it waits for another price dip before it opens a new position.
This is the old RSI+PA+DCA Strategy:
The reason to completely rewrite the code for this strategy is to create a more automated, adaptable and dynamic system. The old version is static and because of the linear use of code the amount of DCA levels were fixed to max 6 layers. If you want to add more DCA layers you manually need to change the script and add extra code. The big difference in the new version is that you can specify the amount of DCA layers in the strategy settings. The use of 'for loops' in the code gives the possibility to make this very dynamic and adaptable.
The RSI code is adapted, just like the old version, from the RSI Strategy - Buy The Dips by Coinrule and is used for study purpose. Any other low/dip finding indicator can be used as well
The distance between the DCA layers are calculated exponentially in a function. In the settings you can define the exponential scale to create the distance between the layers. The bigger the scale the bigger the distance. This calculation is not working perfectly yet and needs way more experimentation. Feel free to leave a comment if you have a better idea about this.
The idea behind generating DCA layers with a 'for loop' is inspired by the Backtesting 3commas DCA Bot v2 by rouxam .
The ideas for creating a dynamic position count and for opening and closing different positions separately based on a specified take profit are taken from the Simple_Pyramiding strategy I wrote previously.
This code is a result of a study and not intended for use as a full functioning strategy. To make the code understandable for users that are not so much introduced into pine script (like myself), every step in the code is commented to explain what it does. Hopefully it helps.
Enjoy!
Leavitt Convolution Acceleration [CC]The Leavitt Convolution Slope indicator was created by Jay Leavitt (Stocks and Commodities Oct 2019, page 11), who is most well-known for creating the Volume-Weighted Average Price indicator. This indicator didn't have a good explanation or description so I custom-coded most of it. The way it works is it will give trend spikes in the direction of the underlying trend. If you don't see a spike then it means that the stock isn't trending at the moment. One possible avenue to explore with this indicator is judging the size of the trend spike before you open a position in that direction (or the opposite direction if you are shorting). I added a normalization function using code from a good friend @loxx that I recommend leaving on but feel free to experiment with it. I have color coded the lines to turn light green for a standard buy signal or dark green for a strong buy signal and light red for a standard sell signal, and dark red for a strong sell signal.
This is another indicator in a series that I'm publishing to fulfill a special request from @ashok1961 so let me know if you ever have any special requests for me.
[blackcat] L1 Ehlers Every Little Bit HelpsLevel 1
Background
Inspired by "Averaging The Open And Close To Reduce Noise" on March 2023 by John F. Ehlers’ article in the March issue, “Every Little Bit Helps”, I further smooth it because noise was still large and “Every Little Bit Does Not Helps Much”.
Function
In John F. Ehlers' 03/2023 article, "Every Little Bit Helps," he suggests that noise can be reduced by simply averaging the open and close prices of a bar, rather than just using the close price. The data sampling example presented in this article compares the traditional RSI using close data to an RSI calculated using the average of the open and close.
Compared to RSI, I used my customized RMI version which is more suitable for moment smoothing. For example, the price entry of the 1st RMI can be changed from Close to (Close + Open) / 2. In fact, the RMI indicator itself has a price input that can be changed in a similar way. You can change the input parameter "m" to "More Help", which is 5 by default.
Remarks
Feedbacks are appreciated.
CBDE OscillatorWhat makes The Universe grow at an accelerating pace?
Dark Energy.
What makes The Economy grow at an accelerating pace?
Debt.
Debt is the Dark Energy of The Economy.
The Central Bank Dark Energy Oscillator (CBDEO) is a companion to the popular CBDET (Central Bank Dark Energy Tracer) script.
CBDEO is an oscillator that shows up in a separate TradingView pane in order to provide a relative change signal. It uses the same equations to aggregate central bank liquidity that are used in CBDET, and adds unique analysis tools that provide rate of change data.
There are 2 signals in the chart. First is the change/delta on a per bar basis, based on the chart time frame. The default style for this plot is "columns". This style parameter can be changed in the settings, along with each plot's visibility.
The second plot is a divergence signal that tests the change vs a simple moving average of the CBDET signal (central bank liquidity). The SMA length is customizable in the Input tab within the settings for the indicator. The SMA is based on the chart's current time frame.
The changes in liquidity on various time frames, and calculated as divergence against the liquidity signal SMA can be useful in determining the rate of change in liquidity, and therefore potential thrust in market price action.
Negroni MA & RSI Strategy, plus trade entry and SL/TP optionsI will start with the context, and some things to think about when using a strategy tool to back-test ideas.
CONTEXT
FIRST: This is derived from other people's work, but I honestly hadn't found a mixed indicator MA strategy tool that does what this now does. If it is out there, apologies!!
This tool can help back-test various MA trends (SMA, EMA, HMA, VWMA); as well as factoring in RSI levels (or not); and can factor in a fixed HTF MA (or not). You can apply a 'retest entry' or a 'breakout entry', and you can also apply various risk mgt for SL/TP orders: 1) No SL/TP; or 2) a fixed %, or 3) dynamic ATR multipliers.
Find below, some details explaining what this tool is attempting to do.
Thank you, tack, salute!
THINGS TO REVIEW (it is not just about 'profitability'!!)
Whilst discretion is always highly encouraged as a trader, and a 100% indicator-driven strategy is VERY unlikely to yield sustainable results going forward, at the very least back-testing your strategies can help provide some guidance, not just on win rate Vs profit factor, but other things including:
a) Trade frequency: if a strategy has an 75% win rate and profit factor of 4, with all your parameters and confluence checks, but only triggers 3 trades every 5 years, is that realistically implementable to your trading situation if you have a $10,000 account?
b) Trade entry type: is it consistently better to wait for a retest of an 'MA zone', or is it better to market buy/sell on breakout of the 'MA zone'?
c) Risk management (SL/TP): is it consistently better to have a fixed static % for SL/TP ("I always place my stops 2% away, whether it is EURUSD or BTCUSDT"), or would you be better placed to try using an ATR multiplier of the respective assets?
d) Moving average type: is your old faithful 100 EMA really serving you well, or is the classic SMA more reliable, or how about the HMA, or the VWMA? Is the 100/200 cross holding up, or do you need something more sensitive? Is there any significant difference between a 10 EMA/20 EMA trend zone compared to a 13 EMA /25 EMA zone?
e) Confluence: Do added confluence checks (RSI, higher timeframe MA) actually improve profitability? But even if they do, is at the cost of cutting too many trades?
INPUTS AND PARAMETERS
Choice 1) Entry Strategy: Retest or Breakout - You can select both!
[ ]:
a) RETEST entry strat: price crosses UNDER FastMA INTO the 'MA trend zone'.
b) BREAKOUT entry strat: price crosses OVER FastMA OUT the 'MA trend zone'.
Choice 2) Risk Management (SL and TP) - You can select more than 1 strategy!
a) No SL/TP: Long trades are closed when the LOW crosses back UNDER the fastMA again, and shorts are closed when the HIGH crosses back OVER the fastMA again.
b) Static % SL/TP: Your SL/TP will be a fixed % away from avg. position price... WARNING: You should change this for various asset classes; FX vol is not the same as crypto altcoin vol!
c) Dynamic ATR SL/TP: Your SL/TP is a multiple of your selected ATR range (default is 50, see 'info' when you select ATR range). ATR accounts for the change in vol of different asset classes somewhat, HOWEVER... you should probably still not have the same multiplier trading S&P500 as you would trading crypto altcoins!
Then select your preferred parameters: EMA, SMA, HMA, VWMA, etc. You can mix and match, and most options have a info/tooltip guide.
RSI note: If you don't care for RSI levels, then set buy signal at 1... i.e always buys! Similarly set sell signal at 99.
ATR note: standard ATR length is usually 14, however... your SL/TP will move POST entry, and can tighten or widen your initial SL/TP... for better AND usually for worse! Go find a trade (strat 3) on the chart, look at the SL/TP lines, now change the number to 5, you'll see.
Fixed HTF MA note: If you don't care for HTF MA confluence, just change the timeframe/options to match the 'Slow MA' options you've chosen.
Short Term Bubble RiskThis risk indicator uses the extension of the closing price to the 20W SMA and displays a color-coded risk oscillator. The higher the oscillator is, the greater the short-term risk and vice-versa. This indicator has historically worked well for estimating the short-term risk of Bitcoin and Ethereum on a weekly timeframe.
Divergence for Many [Dimkud - v5]Strategy is based on "Divergence for Many Indicators v4 ST" strategy by CannyTolany01
which is based on "Divergence for Many Indicator" indicator by LonesomeTheBlue
This strategy is searching for divergences on 18 indicators which you can select and optimise one by one.
Additionally you can connect any other External Indicator value. (just add this indicator the the chart and select option in settings)
To the original indicator/strategy I have added 9 additional indicators:
( Money Flow Index, Williams_Vix, Stochastic RSI , SMI Ergodic Oscillator, Volume Weighted MACD , Bull Bear Power, Balance of Power , Relative Volatility Index , Logistic Settings).
Converted strategy to v5 of Pine Script.
Added Static SL/TP in percents (%).
Added filters to filter enters:
1. Volume Weighted MACD - Multi-TimeFrame Filter
(It checks for histogram to falling or rising for a set periods of bars)
2. Money Flow Index - Multi-TimeFrame Filter
(It checks if MFI Oscillator is in the set diapason.
Also It checks if MFI is falling or rising for a set periods of bars )
3. ATR filter
(check changes in fast ATR to slow ATR )
Strategy shows good backtest results on many crypto tokens on 45m - 1h periods. (with parameters optimisation for every indicator)
To find best parameters - you can enable indicators one-by one, and optimise best parameters for each of them.
Then enable all indicators with successful results.
Optimise SL/TP.
Then try to enable and optimise filters (channels etc.)
The better is to optimise parameters separately for Short and Long trading. And run two separate bots (in settings enable only Long or only Short.)
Updates:
- Added visualisation for open trades (SL/TP)
- Added Volatility filter by ATR with many options for tests.
- Fixed some small bugs.
- Added second RSI filter (you can use two RSIs with different TF or settings)
- Updated ATR volatility and MFI filter. Removed non-effective options
- Added CCI filter
- Added option to Enable/Disable visualisation of TP/SL on chart
- Fixed one small quick bug. ("ATR filter short" was not working)
- Added Super Trend filter
- Added Momentum filter
- Added Volume Filter
- All "request.security" MultiTimeFrame calls changed to 100% non-repait function "f_security()"