Bear Bull Ratio (BBR)This indicator calculates the ratio of bearish to bullish candles over a certain window of time. It does this by keeping track of the number or distance (depending on the "Enable True Range Mode" input) between the high and low prices of bullish and bearish candles, respectively, and then dividing the total distance of bullish candles by the sum of the distances of both bullish and bearish candles. The resulting ratio is then plotted on the chart as a percentage. The indicator also plots a smoothed version of the ratio using a weighted moving average and the average of the ratio over the entire length of the chart, for both the "True Range Mode" and "Normal Mode".
M-oscillator
Volume Cross ━ (For Volume Crop) [whvntr]This fulfills a request from user: iTibu to make an oscillator to go along with one of my indicators named: " Volume Crop ━ Hidden Volume Divergence ". It essentially does the same thing, without the Midline Tool , so you can better understand where the crosses are happening. Again, the hidden MACD Divergence circles formula originated from TheLark. I converted these values to volume instead of price.
Disclaimer: using this indicator, or any indicator anywhere, involves risk when trading and isn't a guarantee of 100% accurate results.
Super 8 - 30M BTCWelcome to Super 8, the ultimate automatic trading script for Pine!
This bad boy is designed to go both long and short, and it's equipped with all the tools you need to maximize your profits. Whether you're looking to take profit, set a trailing stop, or protect yourself with a stop loss, Super 8 has you covered.
But that's not all! Super 8 is also loaded with 8 powerful indicators to help you make informed decisions. We've got the EMA, ADX, SAR, MACD, VOLUME, BOLLINGER BANDS, DONCHIAN, and ATR all working together to give you the best possible trading experience.
And if you want to take it to the next level, Super 8 also has a feature that lets you use stepped entries in normal mode or incremental 1,2,3,... to improve your average price. Plus, if you're using trailing stop, you can activate the Backtest precision to use lower timeframes.
But what's in a name? Super 8 is called that because it's just that... super! It's tailored specifically for the OKX:BTCUSDT.P pair, so you know you're getting the best possible results. it's highly adjustable and can be used with any other pair. So no matter what market you're trading in, Super 8 has got you covered.
So if you want to level up your trading game, give Super 8 a try. You won't be disappointed.
Certain Risks of Live Algorithmic Trading:
Backtesting Cannot Assure Actual Results.
The relevant market might fail or behave unexpectedly.
Your broker may experience failures in its infrastructure, fail to execute your orders in a correct or timely fashion or reject your orders.
The system you use for generating trading orders, communicating those orders to your broker, and receiving queries and trading results from your broker may fail.
Time lag at various point in live trading might cause unexpected behavior.
The systems of third parties in addition to those of the provider from which we obtain various services, your broker, and the applicable securities market may fail or malfunction.
ATR Oscillator - Index (Average True range Oscillator)The purpose of converting the ATR value indicator to an oscillator;
It is known that the ATR value is not between the two specified values. So it is not compressed between 0 and 100 like RSI and %B etc. Therefore, conditions such as "A condition if ATR value is X, B condition if ATR value is Y" cannot be created. In order to create these conditions, the max and min value range of the ATR value must be determined. This indicator converts the ATR values into a percentage number according to the maximum and minimum ATR values in the period you will choose. Max value is 100, min value is 0. The considered ATR value, on the other hand, corresponds to the % of the difference between the max and min value in the selected period.
In this way, conditions such as "If the ATR Oscillator value is greater than 10 or 20 or 30" can now be created, or the value of another indicator can be calculated based on the ATR Oscillator value. For example; Let's say we want the standard deviation of BBand to change according to the value of the ATR Oscillator. If BBand Standard Deviation is 3 if ATRO value is 100, BBand Standard Deviation is 2 if ATRO value is 0, and BBand Standard Deviation is 2.5 when ATRO value is 50;
We can encode it as BBand_Std_Dev=((ATRO*0.01)+2 )
If the ATRO value is between .... and ...., you can make improvements such as plot color X.
Fibonacci Moving Average (FMA)The Fibonacci Moving Average (FMA) is a technical analysis tool that uses a weighting system based on the Fibonacci sequence to smooth out fluctuations in data and help identify trends. It is calculated by first finding the metallic mean of the source data and then applying a weight to each data point based on its position in the Fibonacci sequence. The weighted data points are then averaged to create the FMA line. This script allows the user to specify the source data and the length of the moving average, and plots the resulting FMA line on a chart.
[LazyBear] SQZ Momentum + 1st Gray Cross Signals ━ whvntrI have modified LazyBears Squeeze Momentum Indicator with enhancements, plus added signals
LazyBear mentioned that in John F. Carter's book, Chapter 11, "Mastering the Trade", that "Mr. Carter suggests waiting till the first gray after a black cross, and taking a position in the direction of the momentum (for ex., if momentum value is above zero, go long). Exit the position when the momentum changes (increase or decrease --- signified by a color change)." I have done just that. Now at each "first gray after a black cross", there are now Bearish and Bullish signals.. The signals only appear in the direction of the momentum.
Disclaimer: This indicator does not constitute investment advice. Trade at your own
risk with this method of identifying changes in stock market momentum.
Correlation Coefficient: Visible Range Dynamic Average R -Correlation Coefficient with Dynamic Average R (shows R average for the visible chart only, changes as you zoom in or out)
-Label: Vis-Avg-R = Visable Average R
-the Correlation Coefficient function for Pearson's R is taken from "BA🐷 CC" indicator by @balipour (highly recommended; more thorough treatment of R and other stats, but without the dynamic average)
-I wrote this primarily to add a dynamic Average R, showing correlation for arbitrary start times/end times; whether it be the last month, last year, of some specific period from the past (backtest mode)
-I have been using this to get an idea of correlation regimes over time between Bonds vs Stocks (ZB1! vs ES1!).
-As you see from the above, most of 2022 has seen an unusually strong positive correlation between Bonds and Stocks
~~inputs:
-lookback length for calculation of R
-Backtest mode (true by default): displays Average R for ONLY the visible range displayed on any part of chart history (LHS to RHS of screen only)
-source for both Ticker and compared Asset (close, open, high, low, ohlc4.. etc)
~~some other assets worth comparing:
Aussie vs Gold; Aussie vs ES; Btc vs ES; Copper vs ES
DRM StrategyOne of the ways I go when I develop strategies is by reducing the number of parameters and removing fixed parameters and levels.
In this strategy, I'm trying to create an RSI indicator with a dynamic length.
Length is computed based on the correlation between Price and its momentum.
You can set min and max values for the RSI, and if the correlation is close to 1, we'll be at a min RSI value. When it's -1, we'll be at the max level.
I got this idea from Sofien Kaabar's book.
The strategy is super simple, and there might be much room for improvement.
Performance on the deep backtesting is not excellent, so I think the strategy needs some filters for regimes, etc.
Thanks to @MUQWISHI for helping me code it.
Disclaimer
Please remember that past performance may not indicate future results.
Due to various factors, including changing market conditions, the strategy may no longer perform as well as in historical backtesting.
This post and the script don’t provide any financial advice.
Volume Weighted Exponential Moving Average Suite (VWEMA)This is a volume weighted exponential moving average (EMA) script that allows users to customize various parameters to fit their specific needs.
The script includes four different EMA styles: EMA, DEMA, TEMA, and EHMA. Users can choose which style they would like to use by selecting it in the input field. The script also allows users to customize the length of the EMA, with options for both a maximum and minimum length. Users can also choose to use a manual length or to use the dominant cycle within a range as the length.
In addition to these options, the script also includes the ability to turn on or off volume weighting and a daily reset feature that resets the EMA every day. There is also an option to turn on deviation bands, which show the standard deviation of the selected EMA.
Overall, this script offers a wide range of customization options to help users find the best EMA settings for their needs. It is an advanced tool that can be very helpful for traders looking to optimize their EMA strategy.
Cumulative length instead of cycle length
Double EMA Volume Weighted
Triple EMA Volume Weighted
EHMA Volume Weighted
Higher time frame
Deviation Bands
Squeeze Momentum MTF [LPWN]//ENGLISH
Squeeze momentum of lazy bear, multiple time frames, It gives you information if the cycles with high temporality momentums are in harmony, by default two more momentums are shown, I prefer to use only one extra, in the options you can change the time frame of the momentums, in addition to the momentums you can add the RSI and ADX, if the momentum look small, you can change the value of general scale to make them bigger, the table gives us information on how the momentums and the adx are, in the options you can set the candles to color according to the harmony of the momentums
// SPANISH
Squeeze momentum de lazy bear, multiple time frames, te da informacion si los ciclos con momentums de temporalidad alta estan en armonia,por defecto se muestran dos momentums mas, yo prefiero usar solo uno extra, en las opcoines puedes cambiar la temporalidad de los momentums, ademas de los momentums puedes agregar el RSI y el ADX, si el momentum se ve pequeño, puedes cambiar el valor de general scale para hacerlos mas grandes, la tabla nos da infomracion de como estan los momentums y el adx, en las opciones puedes poner que las velas se pongan del color de acuerdo a la armonia de los momentums
AlexD Market annual seasonalityThe indicator displays the percentage of bullish days with a given date over several years.
This allows you to determine the days of the year when the price usually goes up or down.
Indicator has a built-in "simple moving average" shifted back by half a period, due to which the delay of this smoothing is removed.
Slope NormalizerBrief:
This oscillator style indicator takes another indicator as its source and measures the change over time (the slope). It then isolates the positive slope values from the negative slope values to determine a 'normal' slope value for each.
** A 'normal' value of 1.0 is determined by the average slope plus the standard deviation of that slope.
The Scale
This indicator is not perfectly linear. The values are interpolated differently from 0.0 - 1.0 than values greater than 1.0.
From values 0.0 to 1.0 (positive or negative): it means that the value of the slope is less than 'normal' **.
Any value above 1.0 means the current slope is greater than 'normal' **.
A value of 2.0 means the value is the average plus 2x the standard deviation.
A value of 3.0 means the value is the average plus 3x the standard deviation.
A value greater than 4.0 means the value is greater than the average plus 4x the standard deviation.
Because the slope value is normalized, the meaning of these values can remain generally the same for different symbols.
Potential Usage Examples/b]
Using this in conjunction with an SMA or WMA may indicate a change in trend, or a change in trend-strength.
Any values greater than 4 indicate a very strong (and unusual) trend that may not likely be sustainable.
Any values cycling between +1.0 and -1.0 may mean indecision.
A value that is decreasing below 0.5 may predict a change in trend (slope may soon invert).
Band Pass Normalized Suite (BPNS)Outlier-Free Normalization and Band Pass Filtering
We present a technique for normalizing and filtering a given time series, source, in order to improve its stationarity and enhance its features. The technique includes two stages: outlier-free normalization and band pass filtering.
Outlier-Free Normalization:
In order to normalize source and reduce the impact of outliers, we first smooth the time series using an exponential moving average with a smoothing factor of alpha. The smoothed time series is then normalized by subtracting the minimum value within a given lookback period, dev_lookback, and dividing the result by the range (maximum - minimum) within the same lookback period. Outliers are detected and excluded from the normalization process by identifying values that are more than outlier_level standard deviations away from the exponentially smoothed average.
Band Pass Filtering:
After normalization, the time series is passed through a band pass filter to remove low and high frequency components. The specifics of the band pass filter implementation are not provided.
Code snippet:
bes(float source = close, float alpha = 0.7) =>
var float smoothed = na
smoothed := na(smoothed) ? source : alpha * source + (1 - alpha) * nz(smoothed )
max(source, outlier_level, dev_lookback)=>
var float max = na
src = array.new()
stdev = math.abs((source - bes(source, 0.1))/ta.stdev(source, dev_lookback))
array.push(src, stdev < outlier_level ? source : -1.7976931348623157e+308)
max := math.max(nz(max ), array.get(src, 0))
min(source, outlier_level, dev_lookback) =>
var float min = na
src = array.new()
stdev = math.abs((source - bes(source, 0.1))/ta.stdev(source, dev_lookback))
array.push(src, stdev < outlier_level ? source : 1.7976931348623157e+308)
min := math.min(nz(min ), array.get(src, 0))
min_max(src, outlier_level, dev_lookback) =>
(src - min(src, outlier_level, dev_lookback))/(max(src, outlier_level, dev_lookback) - min(src, outlier_level, dev_lookback)) * 100
To apply the outlier-free normalization and band pass filter to a given time series, source, the min_max() function can be called with the desired values for outlier_level and dev_lookback as arguments. For example:
normalized_source = min_max(source, 2, 50)
This will apply the outlier-free normalization and band pass filter to source, using an outlier_level of 2 standard deviations and a lookback period of 50 data points for both the normalization and outlier detection steps. The resulting normalized and filtered time series will be stored in normalized_source.
It is important to note that the choice of values for outlier_level and dev_lookback will have a significant impact on the resulting normalized and filtered time series. These values should be chosen carefully based on the characteristics of the input time series and the desired properties of the normalized and filtered output.
In conclusion, the outlier-free normalization and band pass filtering technique presented here provides a useful tool for preprocessing time series data and improving its stationarity and feature content. The flexibility of the method, through the choice of outlier_level and dev_lookback values, allows it to be tailored to the specific characteristics of the input time series.
Slope Normalized (SN)Introduction:
The Normalized Slope script is a technical indicator that aims to measure the strength and direction of a trend in a financial market. It does this by calculating the slope of the source data series, which can be any type of data (such as price, volume, or an oscillator) over a specified length of time. The slope is then normalized, meaning it is transformed to a scale between -1 and 1, with 0 representing a flat trend.
Methodology:
The Normalized Slope script uses an exponential smoothing function to smooth the source data series. The smoothing factor, or alpha, can be adjusted by the user through the input parameter "Pre Smoothing".
Next, the script calculates the slope of the smoothed data series by finding the average difference between the current value and the values of the previous "Length" periods. This slope is then normalized using a function that scales the data to a range of -1 to 1, with 0 representing a flat trend. The normalization function takes the minimum and maximum values of the slope, calculates the difference between them, and then scales the data to the range of -1 to 1.
The normalized slope is then smoothed again using another exponential smoothing function with a user-adjustable smoothing factor (the "Post Smoothing" input parameter). A center line representing a flat trend can also be plotted on the chart by enabling the "Center Line" input parameter. Additionally, the user can choose to display bounds at the -1 and 1 levels by enabling the "Bounds" input parameter.
Conclusion:
The Normalized Slope script provides traders with a visual representation of the strength and direction of a trend in a financial market. It can be used as a standalone indicator or in combination with other technical analysis tools to help traders make informed trading decisions.
Regime Filter [CHE]About:
A market regime filter is a tool used by traders and investors to identify the current state or "regime" of the market and adjust their investment strategies accordingly. This can involve identifying trends in market behavior, such as bullish or bearish trends, and using that information to make decisions about which assets to buy or sell.
Market regime filters can be based on a variety of factors, including economic indicators, market sentiment, and technical analysis. They are often used in conjunction with other trading strategies and can help traders and investors manage risk and optimize their returns.
It's important to note that market regime filters are not always accurate and can change over time, so it's important for traders and investors to regularly review and update their filters to ensure that they are relevant and effective.
Understanding the use of a regime filter in trading:
The importance of a trading filter cannot be overemphasized. As a matter of fact, the chances of any trading system making consistent returns over the long term depends on it trading in the right market environment — buying when the market is bullish and selling when the market is bearish. Some traders may want to stay out of the market when the conditions are unfavorable.
The heard of this Regime Filter is the well kown Andean Oscillator. The proposed indicator aims to measure the degree of variations of individual up-trends and down-trends in the price, thus allowing to highlight the direction and amplitude of a current trend.
Settings
Length : Determines the significance of the trends degree of variations measured by the indicator.
Signal Length : Moving average period of the signal line.
The regime filter uses the color yellow and blue, yellow stands for bullish and blue for bearish.
In daily use I have found that it makes sense to use it in different timeframes to identify meaningful trends.
best regards and I hope you enjoy this new indicator
Chervolino
Impulse Alerts - Riccardo Di GiacomoThis is the Impulse indicator that allows you to receive alerts in the case one of the following situation occurs:
1) Buy Setup
- Price above Exponential Moving Average 260
- Moving Average 21 above Exponential Moving Average 260
- Moving Average 9 above Moving Average 21
- RSI(14) above 50
- Stochastic equal or below 20
2) Sell Setup
- Price below Exponential Moving Average 260
- Moving Average 21 below Exponential Moving Average 260
- Moving Average 9 below Moving Average 21
- RSI(14) below 50
- Stochastic equal or above 80
The Bollinger Bands represents another useful information:
- If the price is near the upper band when the first situation occurs, it is another green light, otherwise be careful
- If the price is near the lower band when the second situation occurs, it is another green light, otherwise be careful
Oscillator ExtremesThe Oscillator Extremes indicator plots the normalized positioning of the selected oscillator versus the Bollinger Bands' upper and lower boundaries. Currently, this indicator has four different oscillators to choose from; RSI, CMO, CCI, and ROC.
When the oscillator pushes towards one extreme, it will bring the value of the prevailing line closer to zero. If the bullish or bearish line crosses the zero line, the oscillator is past the extreme of the Bollinger Band.
Example: If the RSI crosses over the upper boundary of the Bollinger, the bullish(green) line will cross under the zero line.
Crossovers of the bullish and bearish lines can indicate a shift in momentum and are a signal. Where the line crossing under, towards zero, is the prevailing trend. The plotted lines will highlight green(bullish) or red(bearish) to show the prevailing trend. This is similar to a DI+- crossover that is commonly associated with the ADX.
We have included an optional normalized ADX to help validate signals. The ADX will change color based on the slope of the ADX. Purple indicates a positive slope and white for a negative slope.
Vector MagnitudeThe pine indicator is a script for technical analysis of stock market data. It calculates the direction and magnitude of a moving average, and plots the result on a chart. The length of the moving average is specified by the user as an input parameter. The script uses the simple moving average (SMA) function from the TA-Lib library to calculate the average of the data. It then determines the direction of the vector by comparing the current value to the average. If the current value is greater than the average, the direction is set to 1. If it is less than the average, the direction is set to -1. Otherwise, the direction is set to 0. The magnitude of the vector is calculated using the Pythagorean theorem. The output is the magnitude of the vector, with the sign indicating the direction.
A trader may use this pine script to help identify trends in the stock market. By plotting the direction and magnitude of the moving average on a chart, the trader can quickly see whether the market is trending up or down, and how strong the trend is. This can help the trader make informed decisions about when to buy and sell stocks. Additionally, the script allows the user to customize the length of the moving average, which can be useful for analyzing different time frames and making more accurate predictions.
LowHighFinderThis chart display how value change of (low,high,close,open) is considered as a factor for buying or selling. Each element take same weight when consider the final price. The price change over a certain threshold would be the decision point (buy/sell)
Factors considered in this chart
1.Quotes: High,low,close,open,volume. If one of them higher than previous day, then it increase, otherwise decreases.
2. Multipler: If you think one quote is more important than other (High more important than close, you can set multipler higher)
3. EMA smoother: It is using to balance the price effect. Like if price increased dramatically, EMA would notify whether could be a good time to sell. (Because high deviation between MA and price suggest price increase too fast)
4. Length of line: set length of line for you need
5. Percentage change: how much percentage change is considered a significant change? 5%? or 10%? In which case should it count toward the final indicator? Adjust percentage change needed, smaller for minutes chart (less than 10) higher for hours chart (10-20), even higher for day chart
Buy/Sell method:
1. When green dot appears, wait after price start to get close to moving average to find the low point and buy.
2. Reverse for red dot.
True Momentum OscillatorThe True Momentum Oscillator (TMO) calculates the delta of the price using the open and close. We have taken the true momentum oscillator a step further and have added the momentum of the main signal (TMO) and the smooth signal line. We believe this helps give a clearer picture of price momentum and helps verify crossovers of the TMO and the smooth signal line. The momentum lines can also help confirm a divergence of the TMO. We have also added multiple moving average options so the user can customize the TMO to suit their needs.
TMO- Green when above Smooth Signal Line, red when below Smooth Signal Line
Smooth Signal- Gray Line
Histogram- TMO-Smooth Signal
TMO Momentum- Orange line
Smooth Signal Momentum- Yellow line
Overbought/Oversold regions- Gray highlighted boundaries
The TMO has defined overbought and oversold regions where either a crossover signal or divergence in the oscillator itself can be taken as a signal. Similar to the MACD, a crossover of the zero line by the TMO can also be utilized as a signal.
Custom OBV OscillatorThis is a modified OBV indicator that creates an oscillator by smoothing the difference between the value of the OBV and a short moving average of the OBV. SMAs of the oscillator are also provided to study crosses and convergence/divergence.
The indicator should mostly be used on common stock, but works on futures contracts with some tuning and a shorter timeframe.
Divergence Strength OscillatorDetects divergence before it has formed a valid divergent pivot, across multiple indicators. After publishing my Strength of Divergence Across Multiple Indicators script, it seemed there were a lot of people who wanted to see the divergence signals before the divergent pivots were actually confirmed. Everyone complains about indicators repainting, yet in the next breath they complain about not wanting to wait for a signal to be confirmed before it appears on their chart! No matter how many times you ask, you can't have your cake and eat it too.
While this isn't exactly cake, it's as close as you're gonna get. This oscillator will calculate the strength of divergence as it forms on any bar that could potentially be a pivot point (e.g. for a pivot low, the preceding bars must be higher than it) and track the net (bullish - bearish) value.
For example:
PLEASE NOTE that this is not intended to be a "Buy" or "Sell" signal, and it would be foolish to use it as such. The purpose of this script is to show you potential divergences as early as possible, so that you have more time to plan and evaluate confluent signals, etc.
The Divergence Strength Calculation:
The total divergence strength value is the sum of the divergence strengths of all indicators for which divergence was detected at a given bar. Each indicator's individual divergence strength is comprised of two basic components: (1) |ΔPrice| - the magnitude of the change in price over the divergence period (pivot-to-pivot), and (2) |ΔIndicator| - the magnitude of the change in indicator value over the divergence period.
Because different indicators' scales and volatility can vary greatly, the Δ values are expressed in terms of standard deviation to ensure that the values are meaningful and equitable across all indicators and assets/instruments/currency pairs, etc:
|ΔIndicator| = |indicator_value_1 - indicator_value_2| / 2 * StDev(indicator_series,100)
Based on work for my Strength of Divergence Across Multiple Indicators script:
Extended Recursive Bands StrategyThe original indicator was created by alexgrover .
All credit goes to alexgrover for creating the indicator that this strategy uses.
This strategy was posted because there were multiple requests for it, and no strategy based on this indicator exists yet.
The Recursive Bands Indicator, an indicator specially created to be extremely efficient, I think you already know that calculation time is extra important in algorithmic trading, and this is the principal motivation for the creation of the proposed indicator. Originally described in Alex's paper "Pierrefeu, Alex (2019): Recursive Bands - A New Indicator For Technical Analysis", the indicator framework has been widely used in his previous uploaded indicators, however it would have been a shame to not upload it, however user experience being a major concern for me, I decided to add extra options, which explain the term "extended".
The Indicator
The indicator displays one upper and one lower band, every common usages applied to bands indicators such as support/resistance , breakout, trailing stop, etc, can also be applied to this one. Length controls how reactive the bands are, higher values will make the bands cross the price less often.
In order to provide more flexibility for the user alexgrover added the option to use various methods for the calculation of the indicator, therefore the indicator can use the average true range , standard deviation, average high-low range, and one totally exclusive method specially designed for this indicator.
Added logic:
We have implemented a logic that checks whether the bands have been following in the same direction for a set amount of bars. This logic must be true before it can enter trades. This is completely new code that was written by us entirely, and it makes a huge difference on strategy performance.
Strategy Long conditions:
1 — Price low is below the the lower band.
2 — The lower band keeps increasing in value until the 'lookback' setting amount of bars is reached.
Strategy Short conditions:
1 — Price high is above the upper band.
2 — The upper band keeps decreasing in value until the 'lookback' setting amount of bars is reached.
Strategy Properties:
We have set a default commission of 0.06% because these are Bybit's fees. The strategy uses an order size of 10% of equity, since drawdown is very low like this. We also use a 10 tick slippage to keep results realistic and account for this. All other settings were left as default apart from initial capital, just to decrease the size of the numbers.