custom Bollinger bands with filters - indicator (AS)-----------Description-------------
This indicator is basically Bollinger bands with many ways to customize. It uses highest and lowest values of upper and lower band for exits. I think something is wrong with the script but cant find any mistakes – most probably smoothing. The ATR filter is implemented but is working incorrectly. In code you can also turn it into strategy but I do not recommend it for now as it is not ready yet.
So this is my first script and I am looking for any advice, ideas to improve this script, sets of parameters, markets to apply, logical mistakes in code or any ideas that you may have. Indicator was initially designed for EURUSD 5MIN but I would be interested in other ideas.
-----------SETTINGS--------------
---START - In starting settings we can choose
Line 1: what parts to use BB/DC/ATR
Line 2: what parts to plot on chart
Line 3 Whether or not apply smoothing to BB or ATR filter
Line 4 Calculate deviation for BB from price or Moving average
Line 5 Fill colors and plot other parts for debug (overlay=false)
Line 6:( for strategy) – enable Long/Short Trades
---BB and DC – here we modify Bollinger bands and Donchian
Line 1: Length and type of BB middle line and also length of DC from BB
Line 2: Length and type of BB standard deviation and multiplier
Line 3: Length and type of BB smoothing and %width for BB filter
---ATR filter – (not ready fully yet)
Line 1: type and length of ATR
Line 2: threshold and smoothing value of ATR
---DATE and SESSION
Line 1: apply custom date or session?
Line 2: session hours settings
Line 3:Custom starting date
Line 4: Custom Ending date
-----------HOW TO USE--------------
We open Long if BB width is bigger than threshold and close when upper band is no longer highest in the period set. Exact opposite with Short
Bands and Channels
DB Support Resistance Levels + Smart Higher Highs and Lower LowsDB Support Resistance Levels + Smart Higher Highs and Lower Lows
The indicator plots historic lines for high, low and close prices shown in settings as "base levels". Users can control the lookback period that is plotted along with an optional multiplier. Traders will notice that the price bounces off these historic base levels. The base levels are shown as light gray by default (customizable in the settings). Users may choose to display base levels by a combination of historic high, low and close values.
On top of the historic base levels, the indicator display higher high and lower low levels from the current bar high/low. Higher highs are shown by default in pink and lower lows by default in yellow. The user can adjust the lookback period for displaying higher highs and the optional multiplier. Only historic values higher than the current bar high are displayed filtering out (by highlighting) the remaining levels for the current bar. Users may choose to use a combination of historic open, low and close values for displaying higher highs. The user can adjust the lookback period for displaying lower lows and the optional multiplier. Only historic values lower than the current bar low are displayed filtering out (by highlighting) the remaining levels for the current bar. Users may choose to use a combination of historic open, low and close values for displaying lower low.
The indicator includes two optional filters for filtering out higher highs and lower lows to focus (highlight) the most relevant levels. The filters include KC and a simple price multiplier filter. The latter is enabled by default and recommended.
The indicator aims to provide two things; first a simple plot of historic base levels and second as the price moves to highlight the most relevant levels for the current price action. While the indicator works on all timeframes, it was tested with the weekly. Please keep in mind adjusting the timeframe may require the lookback settings to be adjusted to ensure the bars are within range.
How should I use this indicator?
Traders may use this indicator to gain a visual reference of support and resistance levels from higher periods of time with the most likely levels highlighted in pink and yellow. Replaying the indicator gives a visual show of levels in action and just how very often price action bounces from these highlighted levels.
Additional Notes
This indicator does increase the max total lines allowed which may impact performance depending on device specs. No alerts or signals for now. Perhaps coming soon...
SMI Momentum Bollinger Squeeze Signals - TradeUIMomentum Bollinger Squeeze Signals - TradeUI
The Squeeze Momentum Indicator (SMI) uses the principles of the Squeeze Indicator, which is a volatility indicator, and combines them with a momentum calculation to provide a more comprehensive view of the market.
The original Squeeze Indicator uses the relationship between the Bollinger Bands and Keltner Channels to identify periods of low volatility, known as "Squeezes", and potential breakout points. The SMI takes this one step further by adding a momentum calculation, making it a more dynamic tool for trading.
The momentum calculation is based on the rate of change of the asset's price. When the price increases rapidly, it signifies positive momentum, and when the price decreases rapidly, it signifies negative momentum.
Purple CloudThe above lines calculate several intermediate values used in the indicator's calculations. Here's a breakdown of each variable:
a1: Represents a modified Exponential Moving Average (EMA) of the high price series, subtracted by a Simple Moving Average (SMA) of the low price series.
a2: Takes the square root of the lowest value between the highest close price over the last 200 bars and the current close price, multiplied by a1.
b1: Represents a modified EMA of the low price series, subtracted by an SMA of the high price series.
b2: Takes the square root of the highest value between the lowest close price over the last 200 bars and the current close price, multiplied by b1.
c1: Represents the square root of a2 multiplied by b2.
These lines create multiple plots using the plot function. Each plot represents a displaced version of c1 by a certain multiple of the Average True Range (ATR) multiplied by a constant factor (0.1, 0.2, 0.3, etc.). The transparency (transp) is set to 100 for all plots.
Bollinger Bands, RSI, and MA StrategyThe "Bollinger Bands, RSI and MA Strategy" is a trend-following strategy that combines the Bollinger Bands indicator, the Relative Strength Index (RSI), and a moving average (MA). It aims to identify potential entry and exit points in the market based on price volatility, momentum, and trend.
The strategy uses two Bollinger Bands with different standard deviations to create price channels. The default settings for the Bollinger Bands are a length of 20 periods and a standard deviation of 2.0. The upper and lower bands of the Bollinger Bands serve as dynamic resistance and support levels, respectively.
The RSI indicator is employed to gauge the strength of price momentum.
The strategy also incorporates a 50-period moving average (MA) to help identify the overall trend direction. When the price is above the MA, it suggests an uptrend, and when the price is below the MA, it suggests a downtrend.
The entry conditions for long trades are when the RSI is above the overbought level and there is no contraction in the Bollinger Bands. For short trades, the entry conditions are when the RSI is below the oversold level and there is no contraction in the Bollinger Bands.
The exit conditions for long trades are when the RSI drops below the overbought level or when the price closes below the 50-period MA.
For short trades, the exit conditions are when the RSI goes above the oversold level or when the price closes above the 50-period MA.
The strategy generates alerts for potential long and short entry signals, as well as for exit signals when the specified conditions are met. These alerts can be used to receive notifications or take further actions, such as placing trades manually or using automated trading systems.
It is important to note that this strategy serves as a starting point and should be thoroughly backtested and validated with historical data before applying it to live trading. Additionally, it is recommended to consider risk management techniques, including setting appropriate stop-loss and take-profit levels, to effectively manage trades.
Psychological levels (Bank levels) PsychoLevels v3 - TartigradiaPsychological levels (Bank levels) plots the closest "round" price levels above and below current price, based on neuroscience research of how humans intuitively calculate in logarithms.
Psychological levels, also called bank levels, are "round" price numbers, by truncating after the nth leftmost digits, around which price often experience resistance or support, because traders and investors tend to set orders around these round numbers.
The calculation done here is fully automatic and dynamic, contrary to other similar scripts, this one uses a mathematical calculation that extracts the 1, 2 or 3 leftmost digits and calculate the previous and next level by incrementing/decrementing these digits. This means it works for any symbol under any price range.
This approach is based on neuroscience research, which found that human brains intuitively approximate numbers on a logarithmic scale, adults and children alike, and similarly to macaques, for more info see Numerical Cognition , Weber-Fechner Law , Zipf law .
For example, if price is at 0.0421, the next major price level is 0.05 and medium one is 0.043. For another asset currently priced at 19354, the next and previous major price levels are 20000 and 10000 respectively, and the next/previous medium levels are 20000 and 19000, and the next/previous weak levels are 19400 and 19300.
IMPORTANT: Please enable "Scale price chart only" in the chart's scale's options, as otherwise major levels may make the chart's scale very small and hard to read.
How it works
At any time, there are 3 levels of strength (1 leftmost digit, 2 leftmost digits, 3 leftmost digits) represented by different sizes, and 3 directional levels for each of these strengths (level above, level below, and half-level) represented by different colors and positions, around current price.
Indeed, contrary to other similar price levels scripts, we do not plot ALL price levels at all times, because otherwise the chart becomes wayyy too cluttered, and also it's highly processing intensive to plot so many lines. So we here use a dynamical approach: we plot only the relevant levels, the closest ones according to current price.
Hence, when a level disappears, it does not mean that it does not exist anymore, but simply that we are not drawing it right now because it is not pertinent for the current price movement (ie, too far away).
Breakouts can be detected in two different ways depending on if SMA is set to a value higher than 1 or not: if SMA == 1, then there is no smoothing, so the levels adapt instantaneously to the current price, so to detect breakout, you should refer to the levels at the previous tick and whether they were broken by current tick's price; if SMA > 1, then there is some smoothing, and so the levels will stay in-place even if there is a breakout, so it's easier to spot breakouts without having to look at the previous ticks, but on the other hand you won't see the new levels for the new price range until after a few more ticks for the smoothing window to adapt. Hence, by default, smoothing is disabled, so that you can see the currently pertinent levels at all time, even right after or during a breakout.
By default, the strong above level is in green, strong below level is in red, medium above level is in blue, medium below level is in yellow, and weak levels aren't displayed but can be. Half levels are also displayed, in a darker color. Strong levels are increments of the first leftmost digit (eg, 10000 to 20000), medium levels are increments of the second leftmost digit (eg, 19000 to 20000), and weak levels of the third leftmost digit (eg, 19100 to 19200). Instead of plotting all the psychological levels all at once as a grid, which makes the chart unintelligible, here the levels adapt dynamically around the current price, so that they show the above/below/half levels relatively to the current price.
Indeed, "half-levels" are also displayed (eg, medium level can also display 19500 instead of only 19000 or 20000). This was made because otherwise the gap between two levels was too big, especially for the strongest levels (eg, there was no major level between 20000 and 30000, but with a half-step we also get a half-level at 25000, and empirically price tends to respect these half levels - I also tried quarter levels but empirically the results were not good). In addition to this hard-coded half-level, you can also create more subdivisions (eg, quarter levels) by setting the simple moving average to a value higher than 1.
The script can be made to run on the daily timeframe whatever the current chart's timeframe is, to reduce the variability in levels, to make it less noisy than intraday price movement. But by default, the chart resolution is used, because I empirically found that the levels found with this indicator work on all time resolutions quite well.
The step can be adjusted to increase the gap between levels, eg, if you want to display one every 2 levels then input step = 2 (eg, 22000, 24000, 26000, etc), or if you want to display quarter levels, input 0.25 (eg, 22000, 22250, 22500, etc). The default values should fit most use cases and cover most psychological levels.
How to read
Focust first on bigger dotted levels, they are stronger and more likely to cause a rebound or a major event or price to stay at this level.
Remember that it's not enough to just look at levels, the context is important, because levels have various effects depending on current price movement: if price is above a level, the level is a support on which price can rebound; if price is below a level, the level is a resistance on which price can rebound (or break); and finally sometimes price also stays hovering around a level for some time.
Levels closer to 9 are less weaker, and levels closer to 0 are stronger, according to Zipf law. This is now reflected since v3 in the transparency, levels that are closer to 9 will be more transparent.
The switch in color for the same level illustrates how a level switches from being a support to a resistance and inversely. Eg, if a major level turns from green to red, then it changed from being a resistance (above) to a support (below).
As is well known in trading, longer standing levels are stronger. This indicator provides a direct illustration: in practice, the number of consecutive dots on the same line influences the strength of the level: the longer the chain of dots, the more you can expect this price level to be significant. The length does not mean the level will necessarily hold, but that other traders are likely to monitor if it holds, and if not then price will break down. Hence, longer levels are good spots to place stop losses, or to enter trades depending on your strategy. In general, a single dot is not enough to consider a level significant, but 2 or more is a good enough level, and 10+ is a strong level. Intuitively, this makes sense, and is what pro traders do: the longer a level is tested, the stronger it is. This indicator can visually represent this intuition and allows to use it as a more systematic trading signal.
Motivation
I initially made the first version of the PsychoLevels indicator mainly to train with PineScript, but I found it surprisingly accurate to define levels that are respected by price movements. So I guess it can be useful for new traders and experienced traders alike, as it's easy to forget that psychological levels can often be as strong if not stronger than technical levels. It can also be used to quickly screen other minor assets for trading opportunities. For example, a hybrid strategy would be to manually define levels on BTCUSD but using this script to automatically define levels in crypto altcoins and quickly screen them for a trade opportunity that can be greater than with BTCUSD but with the same trend.
Personally, although initially I did not believe an automated tool would work well for this purpose, I could now empirically verify that it is quite reliable for the purpose of detecting levels, and so I use it all the time to find the levels automatically and help me monitor them like a hawk, so that I only have to draw uber major levels, the ones that last between cycles and that are hard to autodetect, but otherwise all daily/weekly levels are usually covered. However, trendlines must still be drawn manually or with another indicator (but note that up to now I have found none that worked well enough), as PsychoLevels only draws levels (ie, horizontal lines, not oblique ones!).
Differences with the previous version PsychoLevels v2
price levels now have a transparency according to their importance for the human brain: numbers closer to 9 are weaker, and numbers closer to 0 are stronger and represent a major psychological threshold (eg, that's why prices marked as $9.99 sell better than $10.00). This option can be disabled to get the exact same behavior as v2.
modularized and typed code
PsychoLevels v2 can be found here:
TrueLevel BandsTrueLevel Bands is a powerful trading indicator that employs linear regression and standard deviation to create dynamic, envelope-style bands around the price action of a financial instrument. These bands are designed to help traders identify potential support and resistance levels, trend direction, and volatility.
The TrueLevel Bands indicator consists of multiple envelope bands, each constructed using different timeframes or lengths, and a multiple (mult) factor. The multiple factor determines the width of the bands by adjusting the number of standard deviations from the linear regression line.
Key Features of TrueLevel Bands
1. Multi-Timeframe Analysis: Unlike traditional moving average-based indicators, TrueLevel Bands allow traders to incorporate multiple timeframes into their analysis. This helps traders capture both short-term and long-term market dynamics, offering a more comprehensive understanding of price behavior.
2. Customization: The TrueLevel Bands indicator offers a high level of customization, allowing traders to adjust the lengths and multiple factors to suit their trading style and preferences. This flexibility enables traders to fine-tune the indicator to work optimally with various instruments and market conditions.
3. Adaptive Volatility: By incorporating standard deviation, TrueLevel Bands can automatically adjust to changing market volatility. This feature enables the bands to expand during periods of high volatility and contract during periods of low volatility, providing traders with a more accurate representation of market dynamics.
4. Dynamic Support and Resistance Levels: TrueLevel Bands can help traders identify dynamic support and resistance levels, as the bands adjust in real-time according to price action. This can be particularly useful for traders looking to enter or exit positions based on support and resistance levels.
5. The "Global Trend Line" refers to the average of the bands used to indicate the overall trend.
Why TrueLevel Bands are Different from Classic Moving Averages
TrueLevel Bands differ from conventional moving averages in several ways:
1. Linear Regression: While moving averages are based on simple arithmetic means, TrueLevel Bands use linear regression to determine the centerline. This offers a more accurate representation of the trend and helps traders better assess potential entry and exit points.
2. Envelope Style Bands: Unlike moving averages, which are single lines, TrueLevel Bands form envelope-style bands around the price action. This provides traders with a visual representation of potential support and resistance levels, trend direction, and volatility.
3. Multi-Timeframe Analysis: Classic moving averages typically focus on a single timeframe. In contrast, TrueLevel Bands incorporate multiple timeframes, enabling traders to capture a broader understanding of market dynamics.
4. Adaptive Volatility: Traditional moving averages do not account for changing market volatility, whereas TrueLevel Bands automatically adjust to volatility shifts through the use of standard deviation.
The TrueLevel Bands indicator is a powerful, versatile tool that offers traders a unique approach to technical analysis. With its ability to adapt to changing market conditions, provide multi-timeframe analysis, and dynamic support and resistance levels, TrueLevel Bands can serve as an invaluable asset to both novice and experienced traders looking to gain an edge in the markets.
Variance WindowsJust a quick trial at using statistical variance/standard deviation as an indicator. The general idea is that higher variance in the short term tends to indicate more volatility/movement. The other thing is that it can help set probabilistic boundaries for movements (e.g., if you set the bars to be 2 standard deviations, you are visualizing a range that denotes a 95% probability window).
I haven't really tried forming any sort of strategies around this indicator, but there are a few potential possibilities for its usability.
Generally speaking, the magnitude of the standard deviation (relative to the price) is small when the market is consolidating. It is larger when the market is trending up or own.
If the long term variance and the short-term variance are close to each other in scale, the trend is strong. Otherwise, the trend is weak. Note that I am only saying that the "trend" is strong , not that it is necessarily positive. this could be an up-trend, down-trend, or a sideways trend.
When the magnitudes of the variances are changing from very similar to very different (usually it's the long-term variance getting much larger than the short-term one), that's an indication that the previous trend is coming to an end.
Typically, it's the long-term variance that is bigger than the short-term. However, when you see them cross where the short-term is bigger or even much bigger than the long-term, it's indicative of a spike event (more often than not, one that is not favorable if you are holding any position on a given security).
Because you have probabilistic windows based on some n standard deviations from the midline (which in this version, I've used a ZLEMA as that midline), those boundaries could possibly be used to set stop-loss limits and the like.
There's nothing too complicated or deep about this particular indicator. All I'm really doing is assuming that we are dealing with a Gaussian random process. I am actually using EMA as my mean computation, even though for a proper Gaussian variance calculation, I should be using SMA. When I used SMA, though, it felt a lot more sensitive to noise, which made it feel less usable. In any case, it's just a simple first trial in many years after not having even looked at Pine Script to finally messing around with it again. Open to a litany of criticisms as I'm sure there will be many that are rightly deserved. Otherwise, happy scalping to thee.
Advanced Trend Detection StrategyThe Advanced Trend Detection Strategy is a sophisticated trading algorithm based on the indicator "Percent Levels From Previous Close".
This strategy is based on calculating the Pearson's correlation coefficient of logarithmic-scale linear regression channels across a range of lengths from 50 to 1000. It then selects the highest value to determine the length for the channel used in the strategy, as well as for the computation of the Simple Moving Average (SMA) that is incorporated into the strategy.
In this methodology, a script is applied to an equity in which multiple length inputs are taken into consideration. For each of these lengths, the slope, average, and intercept are calculated using logarithmic values. Deviation, the Pearson's correlation coefficient, and upper and lower deviations are also computed for each length.
The strategy then selects the length with the highest Pearson's correlation coefficient. This selected length is used in the channel of the strategy and also for the calculation of the SMA. The chosen length is ultimately the one that best fits the logarithmic regression line, as indicated by the highest Pearson's correlation coefficient.
In short, this strategy leverages the power of Pearson's correlation coefficient in a logarithmic scale linear regression framework to identify optimal trend channels across a broad range of lengths, assisting traders in making more informed decisions.
Trend Reversal Buy and sell signalAlways check the previous candle before you enter a trade. If the previous candle is colored in yellow then there's a higher probability. Do not enter if the signal candle body size is too small compared to the previous one.
Advanced Trend Channel Detection (Log Scale)The Advanced Trend Channel Detection (Log Scale) indicator is designed to identify the strongest trend channels using logarithmic scaling. It does this by calculating the highest Pearson's R value among all length inputs and then determining which length input to use for the selected slope, average, and intercept. The script then draws the upper and lower deviation lines on the chart based on the selected slope, average, and intercept, and optionally displays the Pearson's R value.
To use this indicator, you will need to switch to logarithmic scale. There are several advantages to using logarithmic scale over regular scale. Firstly, logarithmic scale provides a better visualization of data that spans multiple orders of magnitude by compressing large ranges of values into a smaller space. Secondly, logarithmic scale can help to minimize the impact of outliers, making it easier to identify patterns and trends in the data. Finally, logarithmic scale is often utilized in scientific contexts as it can reveal relationships between variables that may not be visible on a linear scale.
If the trend channel does not appear on the chart, it may be necessary to scroll back to view historical data. The indicator uses past price data to calculate the trend channel, so if there is not enough historical data visible on the chart, the indicator may not be able to identify the trend channel. In this case, the user should adjust the chart's timeframe or zoom out to view more historical data. Additionally, the indicator may need to be recalibrated if there is a significant shift in market conditions or if the selected length input is no longer appropriate.
Average Trend with Deviation Bands v2TL;DR: An average based trend incl. micro trend spotting and multiple display options.
This script is basically an update of my "Average Trend with Deviation Bands" script. I made the following changes:
Not an overlay anymore - The amount of drawn lines makes the chart pretty messy. That's why I moved it to a pane. If you preferred the overlay you can use my "Average Trend with Deviation Bands" script. *This is also the reason why I publish this script instead of updating the existing one.
I added an EMA to represent the price movement instead of candles
I added a signal (SMA) to spot micro trends and early entry/exit signals
I added the option to switch between a "line view" which shows the average trend and deviation bands and an "oscillator view" which shows an oscillator and histogram (MACD style)
General usage:
1. The white line is the average trend (which is an average of the last N bars open, close, high, low price).
2. Bands around the average trend are standard deviations which can be adjusted in the options menu and are only visible in "lines view". Basically they are like the clouds in the Ichimoku Cloud indicator - In big deviation bands the price movement needs more "power" to break through the average trend and vice versa.
3. Indicator line (blue line) - This is the EMA which represents the price. Crossing the average trend from below indicates an uptrend and vice versa (crossing from above indicates a down trend).
4. Signal line (red line) - This is a smoothed version of the indicator line which can be used to predict the movement of the price when crossed by the indicator line (like at MACD and many other indicators).
Oscillator usage:
When switched to "oscillator view" the indicator line oscillates around a zero line which can be seen as the average trend. The usage is basically the same as described above. However there is also the histogram which shows the difference between the indicator and signal. Of course the histogram can be deactivated. Additionally a color filling can be added to easily spot entry/exit signals.
As always: Code is free do whatever you like. If you have any questions/comments/etc. just drop it in the comment section.
Volume Channel - [With Volume Filter]The indicator calculates two volume-weighted moving averages (VWMA) using different lengths, and filters them based on a moving average of volume. The filtered VWMA values are then plotted on the chart as lines, representing the fast and slow moving averages. In addition, upper and lower bands are calculated based on the slow VWMA and plotted as lines on the chart.
The fast and slow VWMA lines can be used to identify trends in the market. When the fast VWMA is above the slow VWMA, it is an indication of an uptrend, and when the fast VWMA is below the slow VWMA, it is an indication of a downtrend. The position of the VWMA lines relative to the upper and lower bands can also be used to identify potential trade signals.
When the price is near the upper band, it indicates that the market is overbought, and when the price is near the lower band, it indicates that the market is oversold. Traders can use these signals to enter or exit trades.
The indicator also includes a volume filter, which means that the VWMA values are only calculated when the volume is above a certain moving average of volume. This helps to filter out noise in the market and provide more accurate signals.
Explanation for each parameter
vwmaLength1: This is the length of the fast volume-weighted moving average (VWMA) used in the calculation. The default value is 10, and it can be adjusted by the user.
vwmaLength2: This is the length of the slow volume-weighted moving average (VWMA) used in the calculation. The default value is 25, and it can be adjusted by the user.
bandLength: This is the length of the moving average used to calculate the upper and lower bands. The default value is 34, and it is not adjustable by the user.
volumeFilterLength: This is the length of the moving average of volume used as a filter for the VWMA calculation. The default value is 5, and it can be adjusted by the user.
src: This is the input source for the VWMA calculation. The default value is close, which means the indicator is using the closing price of each bar. However, the user can select a different input source by changing this parameter.
filteredVwma1: This is the filtered VWMA calculated based on the volume filter and the fast VWMA length. It is plotted as a line on the chart and can be used to identify short-term trends.
filteredVwma2: This is the filtered VWMA calculated based on the volume filter and the slow VWMA length. It is plotted as a line on the chart and can be used to identify long-term trends.
ma: This is the moving average of the filtered slow VWMA values, which is used to calculate the upper and lower bands. It is plotted as a line on the chart.
offs: This is the offset used to calculate the upper and lower bands. It is based on the standard deviation of the filtered slow VWMA values and is multiplied by 1.6185 * 3. It is plotted as a line on the chart.
up: This is the upper band calculated as the moving average plus the offset. It is plotted as a line on the chart and can be used to identify overbought conditions.
dn: This is the lower band calculated as the moving average minus the offset. It is plotted as a line on the chart and can be used to identify oversold conditions.
Matrix Momentum Expansion [IkkeOmar]The indicator consists of several features:
Candlestick chart: The indicator plots a candlestick chart based on the input parameters of the user. The candlesticks are colored blue or orange depending on whether the closing price is above or below the upper and lower bands.
Support and Resistance levels: The indicator also plots support and resistance levels based on the CCI (Commodity Channel Index) of the asset's price. These levels are dynamic and change based on the user's input parameters.
Momentum: The indicator calculates the momentum of the market based on the smoothed and standard deviation of the asset's price. It uses this momentum to calculate upper and lower bands that are plotted on the chart.
Warning signals: The indicator can also be used to identify potential warning signals. When the closing price of the asset moves above the upper band, it could indicate that the market is overbought and a potential reversal could occur. Conversely, when the closing price moves below the lower band, it could indicate that the market is oversold and a potential reversal could occur.
Contractions and expansions in the bands can provide important information to traders about potential price movements.
When the bands contract, it indicates that the market is experiencing low volatility and the price is likely to move sideways. During these periods, traders may look for other signals, such as support and resistance levels or price patterns, to determine potential entry and exit points.
On the other hand, when the bands expand, it indicates that the market is experiencing high volatility and the price is likely to move in a particular direction. Traders can use this information to identify potential trend reversals or continuation patterns. When the upper and lower bands move further apart, it indicates that the trend is becoming stronger, while when they move closer together, it indicates that the trend may be weakening.
When the price moves outside of the bands, it can also provide important information to traders. If the price moves above the upper band, it could indicate that the market is overbought and a potential reversal could occur. Conversely, if the price moves below the lower band, it could indicate that the market is oversold and a potential reversal could occur.
Very important note!
When you see contractions, please understand that it's a wonderful opportunity to pivot into position to catch a good trade because we will see an expansion after!
MESThe Double Bollinger Bands strategy is a trend-following strategy that aims to identify high-probability trading opportunities in trending markets. The strategy involves using two sets of Bollinger Bands with different standard deviation values to identify potential entry and exit points.
Bollinger Bands are a technical analysis tool that consists of three lines plotted on a price chart: a simple moving average (SMA) in the middle, and an upper and lower band that are each a certain number of standard deviations away from the SMA. The standard deviation value determines the width of the bands, with a larger deviation resulting in wider bands.
In this indicator, the first set of Bollinger Bands is calculated using a length of 20 bars and a standard deviation of 2, while the second set uses a length of 20 bars and a standard deviation of 3. The bands are plotted on the price chart along with the SMA for each set.
The buy signal is generated when the price falls below the lower band of the second set of Bollinger Bands (the 3-standard deviation band) and then rises above the lower band of the first set (the 2-standard deviation band). This is interpreted as a potential reversal point in a downtrend and a signal to enter a long position.
Conversely, the sell signal is generated when the price rises above the upper band of the second set of Bollinger Bands and then falls below the upper band of the first set. This is interpreted as a potential reversal point in an uptrend and a signal to enter a short position.
To make it easier to identify buy and sell signals on the price chart, the indicator plots triangles above the bars for sell signals and below the bars for buy signals.
Overall, the Double Bollinger Bands strategy can be a useful tool for traders who want to follow trends and identify potential entry and exit points. However, as with any trading strategy, it is important to backtest and thoroughly evaluate its performance before using it in live trading.
Mean ReversionThe "Mean Reversion" indicator in this script is a popular trading strategy that is based on the concept that over time, prices tend to move back towards their mean or average. This trading strategy seeks to identify instances where the price has deviated significantly from its mean and therefore presents an opportunity to profit from its eventual reversion to the mean.
The script calculates the distance between the current price and the EMA using the ATR, which is a measure of volatility. By multiplying the ATR by a specified factor, the script establishes a distance between the current price and the EMA. If the price falls below this distance, it triggers a potential buy signal, indicating that the price may be oversold and due for a rebound.
The script also uses Bollinger Bands to help identify potential buying and selling opportunities. The Bollinger Bands are a technical indicator that measures the volatility of an asset by plotting two standard deviations away from a moving average. When the price moves outside of the Bollinger Bands, it can indicate that the asset is overbought or oversold, potentially triggering a buy or sell signal.
The script's "buySignal" variable is triggered when the price is below the EMA by the specified ATR distance and also falls below the lower Bollinger Band. Conversely, the "sellSignal" variable is triggered when the price is above the EMA by the specified ATR distance and also rises above the upper Bollinger Band.
The script plots the EMA, Bollinger Bands, and the buy and sell signals on the chart for easy visualization. Additionally, the script includes alerts that can be set up to notify the user when a buy or sell signal is triggered, so that they can act on the information in a timely manner.
In summary, this script is a Mean Reversion indicator that aims to identify potential opportunities to buy or sell assets based on deviations from their mean price using a combination of the ATR, EMA, and Bollinger Bands.
Vollinger BandsI'm happy to present to you... VOLLINGER BANDS. Loosely based on bollinger bands, this indicator uses the new Up/Down Volume indicator from tradingview, which I have add moving averages, and a width calculation between them to determine squeeze. Essentially I have created a volume squeeze bollinger band derivative, hence the term "Vollinger Band".
The bands are NOT a deviation of any middle line or moving average, but rather their own moving averages of the volume delta, respectively.
Blue background = Volume Squeeze (vollinger bands width is less than the squeeze strength line), meaning consolidation, and a big move may happen soon.
Top line = A moving average of the Up Volume delta
Bottom line = A moving average of the Down Volume delta
Vol MA = the moving average length of both the top/bottom line
> If you zoom in, you can see a white line, which is the squeeze represented as a single line, calculated using bollinger bands width. The squeeze strength is a moving average of the squeeze line, which then determines if the width is below that moving average, then the squeeze will occur (white line below purple)
The bands are colored based on the sum of the Up/Down volume over the specified number of bars (preset at 5). If the volume is more buying than selling over that amount of bars, then the line is colored green, and vice versa.
Keltner Trend V3It's just a simple keltner trend with options added to:
Eradicate repainting
more MAs
Json alerts (useful for bots)
I recommend using "open" option for all sources if you are going to use it with a bot, or if you want to be safe and enter with confirmations. Using the default settings would also show you all the entries without repainting as it uses high and low prices to check breakouts and not solely the close price (which is generally a false representative in historic analysis).
My favorite lengths are 7, 14, and 21. There is no specific reason, they just seem to work well most of the time. You can (and should) optimize it to your purposes.
Thanks to the original author @jaggedsoft this script is just a improved version of theirs.
FibonRSI / ErkOziHello,
This software is a technical analysis script written in the TradingView Pine language. The script creates a trading indicator based on Fibonacci retracement levels and the RSI indicator, providing information about price movements and asset volatility by using Bollinger Bands.
There are many different scripts in the market that draw RSI and Fibonacci retracement levels. However, this script was originally designed by me and shared publicly on TradingView.
***The indicator uses RSI (Relative Strength Index) and Bollinger Bands (BB) as the basis for the FibonRSI strategy. RSI measures the strength of a price movement, and BB measures the volatility of an asset. The FibonRSI strategy is based on the idea that the Fibonacci ratios and RSI can be used to predict a asset's price retracement levels.
***The script allows for various parameters to be adjusted. Users can specify the price source type and adjust the periods for RSI and Bollinger Bands. The standard deviation number for Bollinger Bands can also be customized.
***The script calculates the current RSI indicator position and the basic, upper, and lower levels of Bollinger Bands. It then calculates and draws the Fibonacci retracement levels. The color of the RSI line is determined by the upper and lower distribution levels of Bollinger Bands. Additionally, the color of the Fibonacci retracement levels can also be customized by the user.
***This script can be used to determine potential buy and sell signals using Fibonacci retracement levels and RSI. For example, when the RSI is oversold and the price is close to a Fibonacci retracement level, it can be interpreted as a buying opportunity. Similarly, when the RSI is overbought and the price is close to a Fibonacci retracement level, it can be interpreted as a selling opportunity.
***The script takes input parameters such as the price source used for calculation, the period for the RSI indicator, the period for the Moving Average in Bollinger Bands, and the number of standard deviations used in Bollinger Bands.
***The script's conditions include elements such as calculating the current position of the RSI indicator, calculating the upper and lower Bollinger Bands, calculating the dispersion factor, and calculating Fibonacci levels.
***The parameters in the code can be adjusted for calculation, including the price type used, the RSI period, the Moving Average period for BB, and the standard deviation count for BB. After this, the current position of the RSI, Moving Average, and standard deviation for BB are calculated. After calculating the upper and lower BB, the levels above and below the average are calculated using a specific dispersion constant.
CONDITIONS FOR THE SCRIPT
current_rsi = ta.rsi(src, for_rsi) // Current position of the RSI indicator
basis = ta.ema(current_rsi, for_ma)
dev = for_mult * ta.stdev(current_rsi, for_ma)
upper = basis + dev
lower = basis - dev
dispersion = 1
disp_up = basis + (upper - lower) * dispersion
disp_down = basis - (upper - lower) * dispersion
// Fibonacci Levels
f100 = basis + (upper - lower) * 1.0
f78 = basis + (upper - lower) * 0.78
f65 = basis + (upper - lower) * 0.65
f50 = basis
f35 = basis - (upper - lower) * 0.65
f23 = basis - (upper - lower) * 0.78
f0 = basis - (upper - lower) * 1.0
***When calculating Fibonacci levels, the distance between the average of BB and the upper and lower BB is used. These levels are 0%, 23.6%, 35%, 50%, 65%, 78.6%, and 100%. Finally, the RSI line that changes color according to a specific RSI position, Fibonacci levels, and BB are visualized. Additionally, the levels of 70, 30, and 50 are also shown.
The script then sets the color of the RSI position according to the EMA and draws Bollinger Bands, RSI, Fibonacci levels, and the 70, 30, and 50 levels.
In conclusion, this script enables traders to analyze market trends and make informed decisions. It can also be customized to suit individual trading strategies.
This script analyzes the RSI indicator using Bollinger Bands and Fibonacci levels. The default settings are 14 periods for RSI, 233 periods and 2 standard deviations for BB. The MA period inside BB is selected as the BB period and is used when calculating Fibonacci levels.
***The reason for selecting these settings is to provide enough time for BB period to confirm a possible trend. Additionally, the MA period inside BB is matched with the BB period and used when calculating Fibonacci levels.
***Fibonacci levels are calculated from the distance between the upper and lower bands of BB and show how RSI movement is related to these levels. Better results can be achieved when RSI periods are set to Fibonacci numbers such as 21, 55, and 89. Therefore, the use of Fibonacci numbers is recommended when adjusting RSI periods. Fibonacci numbers are among the technical analysis tools that can capture the reflection of naturally occurring movements in the market. Therefore, the use of Fibonacci numbers often helps to better track fluctuations in the market.
Finally, the indicator also displays the 70 and 30 levels and the middle level (50) with Fibonacci levels drawn in circles. Changing these settings can help optimize the Fibonacci levels and further improve the indicator.
Thank you in advance for your suggestions and opinions......
Donchian Channel Oscillator (DonOsc) Preface
DonOsc stands for Donchian Channel Oscillator. This channel envelopes all prices, so if you set the height of the channel to 100 percent, you can plot the prices as percent in between, creating this sub-pane oscillator. For clarity the example chart shows a Donchian channel in the main-pane with the same look-back as the DonOsc, this way you can see how both are related.
Price River
Not only the close is plotted, but also the high and the low of the bar. Thus you get a structure that can be associated with a river, streaming from left to right, in which the price moves between the left bank (i.e. the plotted highs) and the right bank (i.e. the plotted lows), which meanders between the high border (100%) and the low border (0%) of the oscillator. The surface of the price river is gray. The price line is blue when up and dark red when down. The river has also color patches dark red, light red, blue and aqua. Stochastic patches; up: aqua, down: light red
If you look at the price river, you may notice that the price line is closer to the left bank (highs) when moving up and to the right bank (lows) when moving down. Because this phenomenon is used in the stochastic indicator, I named these stochastic patches. These are depicted on the wide side for visibility, so the aqua patches are to the right of the price line and the light-red patches to the left.
Widening patches; up: blue, down: red
If you look at tops or bottoms in bar charts, you may notice that long bars (wide range) tend to be there. You may say that prices turn with a ‘range bang’. This causes a widening of the price river, depicted as a patch on the wide side.
Channel Features
High (76.4 %) and low (23.6 %) Fibonacci levels.
In the oscillator there is no need to calculate Fibonacci levels, we can just plot them. If the price is above 50% the low level is shown with a green color, when below the high level with a pink color. When the price river crosses a level a ‘near border’ highlighter will flash, lime near the high border and orange near the low one.
New high and new low markers.
A flaw in the oscillator is that is doesn’t show actual new lows and new highs in the Donchian Channel, because everything is made relative. This is ‘repaired’ by adding markers, dark red for new low depicted between the high fib and border, blue for new high depicted between low fib and border. Used are the same colors as in the widening patches, because new highs and lows also lead to widening of the actual Channel.
Uptrend and downtrend highlighters.
If in the actual Channel the bars run in the upper half, an uptrend is happening as long as these remain there, a downtrend when the bars remain in the lower half. In the oscillator a yellow highlighter flashes when the price is higher than 50%, a red highlighter below 50%.
Interpretation of the DonOsc
This sub-pane indicator provides a wealth of useful information about what is going on in the market. First of all you immediately see whether there is an up or down trend and whether these lead to new highs or lows. Second of all you can estimate the importance of price movements in the context of the look-back period. Thirdly the width of the price river reveals the emotions in the market. The higher the emotions run, the more risk is involved in a postilion in the charted instrument.
Settings of the DonOsc
Look-back settings.
By default the script sets the look-back, depending on the time frame. This overrules the standard manual setting. If you switch this off, the manual setting will work. A feed-back label can by shown which informs about the current setting.
Smoothing
This concerns the price river. Default is 2, if you increase this setting, the river will loose its touch with the channel borders. O.t.o.h. the river wil be wider and better visible. Maximum setting is 5.
Colors
The momentum colors set both the river widening patches and new high and low markers.
Take care, Eykpunter.
Bollinger Bands - Breakout StrategyThe Bollinger Bands - Breakout Strategy is a trend-following optimized for short-term trading in the crypto market. This strategy employs the Bollinger Bands, a widely recognized technical indicator, as its primary instrument for pinpointing potential trades. It is capable of executing both long and short positions, depending on whether the market is in a spot or futures, and is particularly effective in trending markets.
The strategy boasts a high degree of configurability, allowing users to set the Bollinger Bands period and deviation, trend filter, volatility filter, trade direction filter, rate of change filter, and date filter. Furthermore, it offers options for Take Profit, Stop Loss, and Trailing Stop for both long and short positions, ensuring a comprehensive risk management approach. The inclusion of a maximum intraday loss feature adds another layer of protection, making this strategy a valuable tool for traders seeking a professional and adaptable trading system.
Name : Bollinger Bands - Breakout Strategy
Category : Trend Follower based on Bollinger Bands
Operating mode : Long and Short on Futures or Long on Spot
Trade duration : Intraday
Timeframe : 2H, 3H, 4H, 5H
Market : Crypto
Suggested usage : Trending Markets
Entry : When the price crosses above or below the Bollinger Bands
Exit : Opposite Cross or Profit target, Trailing stop or Stop loss
Configuration :
- Bollinger Bands period and deviation
- Trend Filter
- Volatility Filter
- Trade direction filter
- Rate of Change filter
- Date Filter (for backtesting purposes)
- Take Profit, Stop Loss and Trailing Stop for long and short positions
- Risk Management: Max Intraday Loss
Backtesting :
⁃ Exchange: BINANCE
⁃ Pair: BTCUSDT.P
⁃ Timeframe: 4H
⁃ Fee: 0.025%
⁃ Slippage: 1
- Initial Capital: 10000 USDT
- Position sizing: 10% of Equity
- Start : 2019-09-19 (Out Of Sample from 2022-12-23)
- Bar magnifier: on
Credits :
- LucF of Pine Coders for f_security function to avoid repainting using security.
- QuantNomad for Monthly Table.
Disclaimer : Risk Management is crucial, so adjust stop loss to your comfort level. A tight stop loss can help minimise potential losses. Use at your own risk.
How you or we can improve? Source code is open so share your ideas!
Leave a comment and smash the boost button!
Thanks for your attention, happy to support the TradingView community.
SuperTrend with Chebyshev FilterModified Super Trend with Chebyshev Filter
The Modified Super Trend is an innovative take on the classic Super Trend indicator. This advanced version incorporates a Chebyshev filter, which significantly enhances its capabilities by reducing false signals and improving overall signal quality. In this post, we'll dive deep into the Modified Super Trend, exploring its history, the benefits of the Chebyshev filter, and how it effectively addresses the challenges associated with smoothing, delay, and noise.
History of the Super Trend
The Super Trend indicator, developed by Olivier Seban, has been a popular tool among traders since its inception. It helps traders identify market trends and potential entry and exit points. The Super Trend uses average true range (ATR) and a multiplier to create a volatility-based trailing stop, providing traders with a dynamic tool that adapts to changing market conditions. However, the original Super Trend has its limitations, such as the tendency to produce false signals during periods of low volatility or sideways trading.
The Chebyshev Filter
The Chebyshev filter is a powerful mathematical tool that makes an excellent addition to the Super Trend indicator. It effectively addresses the issues of smoothing, delay, and noise associated with traditional moving averages. Chebyshev filters are named after Pafnuty Chebyshev, a renowned Russian mathematician who made significant contributions to the field of approximation theory.
The Chebyshev filter is capable of producing smoother, more responsive moving averages without introducing additional lag. This is possible because the filter minimizes the worst-case error between the ideal and the actual frequency response. There are two types of Chebyshev filters: Type I and Type II. Type I Chebyshev filters are designed to have an equiripple response in the passband, while Type II Chebyshev filters have an equiripple response in the stopband. The Modified Super Trend allows users to choose between these two types based on their preferences.
Overcoming the Challenges
The Modified Super Trend addresses several challenges associated with the original Super Trend:
Smoothing: The Chebyshev filter produces a smoother moving average without introducing additional lag. This feature is particularly beneficial during periods of low volatility or sideways trading, as it reduces the number of false signals.
Delay: The Chebyshev filter helps minimize the delay between price action and the generated signal, allowing traders to make timely decisions based on more accurate information.
Noise Reduction: The Chebyshev filter's ability to minimize the worst-case error between the ideal and actual frequency response reduces the impact of noise on the generated signals. This feature is especially useful when using the true range as an offset for the price, as it helps generate more reliable signals within a reasonable time frame.
The Great Replacement
The Modified Super Trend with Chebyshev filter is an excellent replacement for the original Super Trend indicator. It offers significant improvements in terms of signal quality, responsiveness, and accuracy. By incorporating the Chebyshev filter, the Modified Super Trend effectively reduces the number of false signals during low volatility or sideways trading, making it a more reliable tool for identifying market trends and potential entry and exit points.
In-Depth Guide to the Modified Super Trend Settings
The Modified Super Trend with Chebyshev filter offers a wide range of settings that allow traders to fine-tune the indicator to suit their specific trading styles and objectives. In this section, we will discuss each setting in detail, explaining its purpose and how to use it effectively.
Source
The source setting determines the price data used for calculations. The default setting is hl2, which calculates the average of the high and low prices. You can choose other price data sources such as close, open, or ohlc4 (average of open, high, low, and close prices) based on your preference.
Up Color and Down Color
These settings control the color of the trend line when the market is in an uptrend (up_color) and a downtrend (down_color). You can customize these colors to your liking, making it easier to visually identify the current market trend.
Text Color
This setting controls the color of the text displayed on the chart when using labels to indicate trend changes. You can choose any color that contrasts well with your chart background for better readability.
Mean Length
The mean_length setting determines the length (number of bars) used for the Chebyshev moving average calculation. A shorter length will make the moving average more responsive to price changes, while a longer length will produce a smoother moving average. It is crucial to find the right balance between responsiveness and smoothness, as a too-short length may generate false signals, while a too-long length might produce lagging signals. The default value is 64, but you can experiment with different values to find the optimal setting for your trading strategy.
Mean Ripple
The mean_ripple setting influences the Chebyshev filter's ripple effect in the passband (Type I) or stopband (Type II). The ripple effect represents small oscillations in the frequency response, which can impact the moving average's smoothness. The default value is 0.01, but you can experiment with different values to find the best balance between smoothness and responsiveness.
Chebyshev Type: Type I or Type II
The style setting allows you to choose between Type I and Type II Chebyshev filters. Type I filters have an equiripple response in the passband, while Type II filters have an equiripple response in the stopband. Depending on your preference for smoothness and responsiveness, you can choose the type that best fits your trading style.
ATR Style
The atr_style setting determines the method used for calculating the Average True Range (ATR). By default (false), it uses the traditional high-low range. When set to true, it uses the absolute difference between the open and close prices. You can choose the method that works best for your trading strategy and the market you are trading.
ATR Length
The atr_length setting controls the length (number of bars) used for calculating the ATR. Similar to the mean_length, a shorter length will make the ATR more responsive to price changes, while a longer length will produce a smoother ATR. The default value is 64, but you can experiment with different values to find the optimal setting for your trading strategy.
ATR Ripple
The atr_ripple setting, like the mean_ripple, influences the ripple effect of the Chebyshev filter used in the ATR calculation. The default value is 0.05, but you can experiment with different values to find the best balance between smoothness and responsiveness.
Multiplier
The multiplier setting determines the factor by which the ATR is multiplied before being added
Super Trend Logic and Signal Optimization
The Modified Super Trend with Chebyshev filter is designed to minimize false signals and provide a clear indication of market trends. It does so by using a combination of moving averages, Average True Range (ATR), and a multiplier. In this section, we will discuss the Super Trend's logic, its ability to prevent false signals, and the early warning crosses added to the indicator.
Super Trend Logic
The Super Trend's logic is based on a combination of the Chebyshev moving average and ATR. The Chebyshev moving average is a smooth moving average that effectively filters out market noise, while the ATR is a measure of market volatility.
The Super Trend is calculated by adding or subtracting a multiple of the ATR from the Chebyshev moving average. The multiplier is a user-defined value that determines the distance between the trend line and the price action. A larger multiplier results in a wider channel, reducing the likelihood of false signals but potentially missing out on valid trend changes.
Preventing False Signals
The Super Trend is designed to minimize false signals by maintaining its trend direction until a significant change in the market occurs. In a downtrend, the trend line will only decrease in value, and in an uptrend, it will only increase. This helps prevent false signals caused by temporary price fluctuations or market noise.
When the price crosses the trend line, the Super Trend does not immediately change its direction. Instead, it employs a safety logic to ensure that the trend change is genuine. The safety logic checks if the new trend line (calculated using the updated moving average and ATR) is more extreme than the previous one. If it is, the trend line is updated; otherwise, the previous trend line is maintained. This mechanism further reduces the likelihood of false signals by ensuring that the trend line only changes when there is a significant shift in the market.
Early Warning Crosses
To provide traders with additional insight, the Modified Super Trend with Chebyshev filter includes early warning crosses. These crosses are plotted on the chart when the price crosses the trend line without the safety logic. Although these crosses do not necessarily indicate a trend change, they can serve as a valuable heads-up for traders to monitor the market closely and prepare for potential trend reversals.
In conclusion, the Modified Super Trend with Chebyshev filter offers a significant improvement over the original Super Trend indicator. By incorporating the Chebyshev filter, this modified version effectively addresses the challenges of smoothing, delay, and noise reduction while minimizing false signals. The wide range of customizable settings allows traders to tailor the indicator to their specific needs, while the inclusion of early warning crosses provides valuable insight into potential trend reversals.
Ultimately, the Modified Super Trend with Chebyshev filter is an excellent tool for traders looking to enhance their trend identification and decision-making abilities. With its advanced features, this indicator can help traders navigate volatile markets with confidence, making more informed decisions based on accurate, timely information.
Adaptive Price Channel StrategyThis strategy is an adaptive price channel strategy based on the Average True Range (ATR) indicator and the Average Directional Index (ADX). It aims to identify sideways markets and trends in the price movements and make trades accordingly.
The strategy uses a length parameter for the ATR and ADX indicators, which determines the length of the calculation for these indicators. The strategy also uses an ATR multiplier, which is multiplied by the ATR to determine the upper and lower bounds of the price channel.
The first step of the strategy is to calculate the highest high (HH) and lowest low (LL) over the specified length. The ATR is also calculated over the same length. Then the strategy calculates the positive directional indicator (+DI) and negative directional indicator (-DI) based on the up and down moves in the price, and uses these to calculate the ADX.
If the ADX is less than 25, the market is considered to be in a sideways phase. In this case, if the price closes above the upper bound of the price channel (HH - ATR multiplier * ATR), the strategy enters a long position, and if the price closes below the lower bound of the price channel (LL + ATR multiplier * ATR), the strategy enters a short position.
If the ADX is greater than or equal to 25 and the +DI is greater than the -DI, the market is considered to be in a bullish phase. In this case, if the price closes above the upper bound of the price channel, the strategy enters a long position. If the ADX is greater than or equal to 25 and the +DI is less than the -DI, the market is considered to be in a bearish phase. In this case, if the price closes below the lower bound of the price channel, the strategy enters a short position.
The strategy exits a position after a certain number of bars have passed since the entry, as specified by the exit_length input.
In summary, this strategy attempts to trade in accordance with the prevailing market conditions by identifying sideways markets and trends and making trades based on price movements within a dynamically-adjusted price channel.
This strategy takes a read on the market and either takes a channel strategy or trades volatility based on current trend. Works well on 2, 3 ,4, 12 hour for BTC. It’s my first attempt and creating a strategy. I am very interested in constructive criticism. I will look into better risk management, maybe a trailing stop loss. Other suggestions welcome. This is my first attempt at a strategy.
Here are the settings I used.
Inputs
Length 20
Exit 10
ATR 3.2
Dates I picked when I got into Crypto
Properties
Capital 1000
Order size 2 Contracts
Pyramiding 1
Commission .05