HL-D Close Fraction Oscillator | AdulariDescription:
This indicator calculates the difference between price high's and low's, and fractions it by the close price. If it calculates the difference between a high and low or low and high is defined by whether the current close is higher than the previous close. It is then also rescaled to ensure the value is always appropriate compared to the last set amount of bars.
This indicator can be used to determine whether a market is trending or ranging, and if so in which direction it is trending.
How do I use it?
Never use this indicator as standalone trading signal, it should be used as confluence.
When the value is above the middle line this shows the bullish trend is strong.
When the value is below the middle line this shows the bearish trend is strong.
When the value crosses above the upper line this indicates the trend may reverse downwards.
When the value crosses below the lower line this indicates the trend may reverse upwards.
When the value crosses above the signal this indicates the current bearish trend is getting weak and may reverse upwards.
When the value crosses below the signal this indicates the current bullish trend is getting weak and may reverse downwards.
Features:
Oscillator value indicating the difference between highs and lows fractioned by the close price.
Signal indicating a clear trend and base line value.
Horizontal lines such as oversold, overbought and middle lines, indicating possible interest zones.
How does it work?
1 — Define trend by checking if current close is above or below previous close.
2 — If the current close is above the previous close, calculate the oscillator's value using this formula:
(high - low) / close
2 — If the current close is below the previous close, calculate the oscillator's value using this formula:
(low - high) / close
3 — Smooth the original value using a specified moving average.
4 — Rescale the value using this formula:
newMin + (newMax - newMin) * (value - oldMin) / math.max(oldMax - oldMin, 10e-10)
5 — Calculate signal value by applying smoothing to the oscillator's value.
Trend
BitCoin RSI TrendWhat is it?
This indicator will plot the RSI of BTC with a red or green background based on the top and bottom values which you can set.
How to use it?
For example, you want to trade only if the RSI of BTC is between 50 and 70, so the top value is 70 and bottom is 50. If the RSI value between those values the background will be green, else it will be red.
Why to use it?
The buy and sell strength of the BTC controls the other coins, and it is noticeable when the BTC is over sold and the RSI exceeding the 70, the price will reverse its movement to down, thus it is advisable to not open long position if the RSI of BTC is above the 70-75. Also, if the RSI is under 50 there is a big possibility to move down further to the over bought areas. The best is to buy a altcoins when the BTC RSI is between 50 and 70.
For example, I could avoid a bad long trade on MATICUSDT when the RSI of BTC is going under 50
Or, get a good long trade on MATICUSDT when the RSI of BTC is between 50 and 70
Generalized Smooth StepHello, folks. Sorry for not posting anything for a long time, just busy with my university studies for the moment.
Quick script for today — Smooth Step.
You can search for it in Wikipedia, but saying shortly and informatively, this is just an advanced type of oscillator, used as momentum indicator.
In the codes across the Internet everybody uses the 3rd order equation, BUT I found it kinda boring to use indicator this simple, so I made an option to choose the order of the equation in the settings — parameter "Order of the equation". This why it is called generalized smooth step, as it makes possible to use equation of virtually any order.
It is limited to 18 because very strange behaviour that you get after passing 18th order (it jsut becomes not tradeable any longer).
As I've mentioned above, it is an advanced version of classical oscillator, used as momentum indicator .
How to use it?
If smooth step is above 50, then the price momentum is bullish;
If smooth step is below 50, then the price momentum is bearish.
As simple as it is, it becomes useful enough on the higher timeframes (>=1H), so feel free to play with it and find optimal settings for yourself.
Hints
Try perform different smoothing and leading methods (developed by Ehler) to get better results;
You can use smooth step as confirmation/filter for trend-following trades.
Hope you will find it valueable.
Take your profits!
- Tarasenko Fyodor
RU:
Привет, ребята. Извините, что долго ничего не выкладывал, просто сейчас занят учебой в университете.
Быстрый скрипт на сегодня — Smooth Step.
Вы можете поискать его теоретическое обоснование в Википедии, но если говорить кратко и информативно, то это совершенствованный тип классического осциллятора, используемый в качестве моментум-индикатора .
В кодах в интернете все используют уравнение 3-го порядка, НО Мне было скучно пользоваться таким простым индикатором, поэтому я сделал возможность выбирать порядок уравнения в настройках — параметр " Порядок уравнения». Поэтому он называется обобщеннымsmooth step, так как позволяет использовать уравнение практически любого порядка.
Я ограничил порядок уравнения 18 , потому что индикатор показывает начинается очень странное поведение, когда вы делаете порядок больше 18 (индикатор просто начинается вести семя хаотично, что ли).
Как я уже упоминал выше, это усовершенствованная версия классического осциллятора, используемого в качестве моментум-индикатора .
Как им пользоваться?
Если smooth step выше 50, то импульс цены бычий;
Если smooth steз\p ниже 50, то импульс цены медвежий.
Хоть это и очень простой индикатор, он может оказаться достаточно полезным на старших таймфреймах (>=1H), так что не стесняйтесь играть с ним и находить оптимальные настройки для себя.
Советы
Попробуйте использовать различные методы сглаживания и лидирования (разработан Джоном Элером (John Ehler)), чтобы получить лучшие результаты;
Вы можете использовать smooth step в качестве подтверждения/фильтра для сделок, следующих за трендом.
Надеюсь, этот скрипт будет вам полезен.
Получите прибыль!
- Тарасенко Фёдор
Trend Line Adam Moradi v1 (Tutorial Content)
The Pine Script strategy that plots pivot points and trend lines on a chart. The strategy allows the user to specify the period for calculating pivot points and the number of pivot points to be used for generating trend lines. The user can also specify different colors for the up and down trend lines.
The script starts by defining the input parameters for the strategy and then calculates the pivot high and pivot low values using the pivothigh() and pivotlow() functions. It then stores the pivot points in two arrays called trend_top_values and trend_bottom_values. The script also has two arrays called trend_top_position and trend_bottom_position which store the positions of the pivot points.
The script then defines a function called add_to_array() which takes in three arguments: apointer1, apointer2, and val. This function adds val to the beginning of the array pointed to by apointer1, and adds bar_index to the beginning of the array pointed to by apointer2. It then removes the last element from both arrays.
The script then checks if a pivot high or pivot low value has been calculated, and if so, it adds the value and its position to the appropriate arrays using the add_to_array() function.
Next, the script defines two arrays called bottom_lines and top_lines which will be used to store trend lines. It also defines a variable called starttime which is set to the current time.
The script then enters a loop to calculate and plot the trend lines. It first deletes any existing trend lines from the chart. It then enters two nested loops which iterate over the pivot points stored in the trend_bottom_values and trend_top_values arrays. For each pair of pivot points, the script calculates the slope of the line connecting them and checks if the line is a valid trend line by iterating over the price bars between the two pivot points and checking if the line is above or below the close price of each bar. If the line is found to be a valid trend line, it is plotted on the chart using the line.new() function.
Finally, the script colors the trend lines using the colors specified by the user.
Tutorial Content
'PivotPointNumber' is an input parameter for the script that specifies the number of pivot points to consider when calculating the trend lines. The value of 'PivotPointNumber' is set by the user when they configure the script. It is used to determine the size of the arrays that store the values and positions of the pivot points, as well as the number of pivot points to loop through when calculating the trend lines.
'up_trend_color' is an input parameter for the script that specifies the color to use for drawing the trend lines that are determined to be upward trends. The value of 'up_trend_color' is set by the user when they configure the script and is passed to the color parameter of the line.new() function when drawing the upward trend lines. It determines the visual appearance of the upward trend lines on the chart.
'down_trend_color' is an input parameter for the script that specifies the color to use for drawing the trend lines that are determined to be downward trends. The value of 'down_trend_color' is set by the user when they configure the script and is passed to the color parameter of the line.new() function when drawing the downward trend lines. It determines the visual appearance of the downward trend lines on the chart.
'pivothigh' is a variable in the script that stores the value of the pivot high point. It is calculated using the pivothigh() function, which returns the highest high over a specified number of bars. The value of 'pivothigh' is used in the calculation of the trend lines.
'pivotlow' is a variable in the script that stores the value of the pivot low point. It is calculated using the pivotlow() function, which returns the lowest low over a specified number of bars. The value of 'pivotlow' is used in the calculation of the trend lines.
'trend_top_values' is an array in the script that stores the values of the pivot points that are determined to be at the top of the trend. These are the pivot points that are used to calculate the upward trend lines.
'trend_top_position' is an array in the script that stores the positions (i.e., bar indices) of the pivot points that are stored in the 'trend_top_values' array. These positions correspond to the locations of the pivot points on the chart.
'trend_bottom_values' is an array in the script that stores the values of the pivot points that are determined to be at the bottom of the trend. These are the pivot points that are used to calculate the downward trend lines.
'trend_bottom_position' is an array in the script that stores the positions (i.e., bar indices) of the pivot points that are stored in the 'trend_bottom_values' array. These positions correspond to the locations of the pivot points on the chart.
apointer1 and apointer2 are variables used in the add_to_array() function, which is defined in the script. They are both pointers to arrays, meaning that they hold the memory addresses of the arrays rather than the arrays themselves. They are used to manipulate the arrays by adding new elements to the beginning of the arrays and removing elements from the end of the arrays.
apointer1 is a pointer to an array of floating-point values, while apointer2 is a pointer to an array of integers. The specific arrays that they point to depend on the arguments passed to the add_to_array() function when it is called. For example, if add_to_array(trend_top_values, trend_top_posisiton, pivothigh) is called, then apointer1 would point to the tval array and apointer2 would point to the tpos array.
'bottom_lines' (short for "Bottom Lines") is an array in the script that stores the line objects for the downward trend lines that are drawn on the chart. Each element of the array corresponds to a different trend line.
'top_lines' (short for "Top Lines") is an array in the script that stores the line objects for the upward trend lines that are drawn on the chart. Each element of the array corresponds to a different trend line.
Both 'bottom_lines' and 'top_lines' are arrays of type "line", which is a data type in PineScript that represents a line drawn on a chart. The line objects are created using the line.new() function and are used to draw the trend lines on the chart. The variables are used to store the line objects so that they can be manipulated and deleted later in the script.
Loops
maxline is a variable in the script that specifies the maximum number of trend lines that can be drawn on the chart. It is used to determine the size of the bottom_lines and top_lines arrays, which store the line objects for the trend lines.
The value of maxline is set to 3 at the beginning of the script, meaning that at most 3 trend lines can be drawn on the chart at a time. This value can be changed by the user if desired by modifying the assignment statement "maxline = 3".
'count_line_low' (short for "Count Line Low") is a variable in the script that keeps track of the number of downward trend lines that have been drawn on the chart. It is used to ensure that the maximum number of trend lines (as specified by the maxline variable) is not exceeded.
'count_line_high' (short for "Count Line High") is a variable in the script that keeps track of the number of upward trend lines that have been drawn on the chart. It is used to ensure that the maximum number of trend lines (as specified by the maxline variable) is not exceeded.
Both 'count_line_low' and 'count_line_high' are initialized to 0 at the beginning of the script and are incremented each time a new trend line is drawn. If either variable exceeds the value of maxline, then no more trend lines are drawn.
'pivot1', 'up_val1', 'up_val2', up1, and up2 are variables used in the loop that calculates the downward trend lines in the script. They are used to store intermediate values during the calculation process.
'pivot1' is a loop variable that is used to iterate through the pivot points (stored in the trend_bottom_values and trend_bottom_position arrays) that are being considered for use in the trend line calculation.
'up_val1' and 'up_val2' are variables that store the values of the pivot points that are used to calculate the downward trend line.
up1 and up2 are variables that store the positions (i.e., bar indices) of the pivot points that are stored in 'up_val1' and 'up_val2', respectively. These positions correspond to the locations of the pivot points on the chart.
'value1' and 'value2' are variables that are used to store the values of the pivot points that are being compared in the loop that calculates the trend lines in the script. They are used to determine whether a trend line can be drawn between the two pivot points.
For example, if 'value1' is the value of a pivot point at the top of the trend and 'value2' is the value of a pivot point at the bottom of the trend, then a trend line can be drawn between the two points if 'value1' is greater than 'value2'. The values of 'value1' and 'value2' are used in the calculation of the slope and intercept of the trend line.
'position1' and 'position2' are variables that are used to store the positions (i.e., bar indices) of the pivot points that are being compared in the loop that calculates the trend lines in the script. They are used to determine the distance between the pivot points, which is necessary for calculating the slope of the trend line.
For example, if 'position1' is the position of a pivot point at the top of the trend and 'position2' is the position of a pivot point at the bottom of the trend, then the distance between the two points is given by 'position1' - 'position2'. This distance is used in the calculation of the slope of the trend line.
'different', 'high_line', 'low_location', 'low_value', and 'valid' are variables that are used in the loop that calculates the downward trend lines in the script. They are used to store intermediate values during the calculation process.
'different' is a variable that stores the slope of the downward trend line being calculated. It is calculated as the difference in value between the two pivot points (stored in up_val1 and up_val2) divided by the distance between the pivot points (calculated using their positions, stored in up1 and up2).
'high_line' is a variable that stores the current value of the trend line being calculated at a given point in the loop. It is initialized to the value of the second pivot point (stored in up_val2) and is updated on each iteration of the loop using the value of different.
'low_location' is a variable that stores the position (i.e., bar_index) on the chart of the point where the trend line being calculated first touches the low price. It is initialized to the position of the second pivot point (stored in up2) and is updated on each iteration of the loop if the trend line touches a lower low.
'low_value' is a variable that stores the value of the trend line at the point where it first touches the low price. It is initialized to the value of the second pivot point (stored in up_val2) and is updated on each iteration of the loop if the trend line touches a lower low.
'valid' is a Boolean variable that is used to indicate whether the trend line being calculated is valid. It is initialized to true and is set to false if the trend line does not pass through all the lows between the pivot points. If valid is still true after the loop has completed, then the trend line is considered valid and is drawn on the chart.
d_value1, d_value2, d_position1, and d_position2 are variables that are used in the loop that calculates the upward trend lines in the script. They are used to store intermediate values during the calculation process.
d_value1 and d_value2 are variables that store the values of the pivot points that are used to calculate the upward trend line.
d_position1 and d_position2 are variables that store the positions (i.e., bar indices) of the pivot points that are stored in d_value1 and d_value2, respectively. These positions correspond to the locations of the pivot points on the chart.
The variables d_value1, d_value2, d_position1, and d_position2 have the same function as the variables uv1, uv2, up1, and up2, respectively, but for the calculation of the upward trend lines rather than the downward trend lines. They are used in a similar way to store intermediate values during the calculation process.
thank you.
Trend and Momentum DashboardI created this indicator to tell me when it's time to trade (going long) and when it's time to wait (or going short).
You can enter up to 13 ticker (default is S&P500 and key market segments).
For each ticker, fibonacci levels are calculated and represented either in 5 color or 3 color mode as single lines.
(Thanks to eykpunter for the fibonacci level implementation. I'm using his code and modified it slightly).
Color coding (5 color mode) explanation:
blue = in uptrend area
light blue = in prudent buyers area
gray = in center area
light red = in prudent sellers area
red = in downtrend area
The topline is a combination of all ticker and shows if the market is either bullish or bearish (threshold adjustable in settings)
The bullish/bearish trend can also be used as background color. Alternatively the last bar in the selected time period is been highlighted.
How to use it:
The indicator works on all timeframes. Use the color coding explanation above to see the status of each asset.
a) You can evaluate "long" term trend using day or week timeframe. e.g. I'm usually trading only long and stay out of the market when it is not bullish (top line & background = blue). I'm also using it to know which segments/assets are currently "hot".
b) You can evaluate short term momentum (using 1h or lower timeframe) and see in which direction the market/assets are moving. e.g. I use this when the exchanges open to see how the day is going to move.
I've attached 3 examples in the screenshot - first is the default, in the second one I'm using different asset classes and the third one is for crypto.
Limitations:
There are security request limits as well as string limitations for the security calls in pine script, so I went to the maximum what is currently possible.
(No financial advise, for testing purposes only)
Open DriveOpen Drive is a market profile concept introduced by Jim Dalton. It occurs when the price moves directionally and persistently for the first 30 minutes from the cash market open.
It is necessary to use 30-minute bars as there needs to be enough time to measure an extreme move of the cash open. This means there will be fewer trades than other strategies using faster time periodicities.
The script finds open drives from these time points 0700/ 0800 and 1300/1430.
The entry signal also has a breakout threshold using the 5-bar high and 5-bar low to only take trades moving away from the prior 5-bar range. This weeds out most mid-range trades and small range expansion bars.
If the price has had a strong move from the open and has broken either below the prior 5-bar low or above the prior 5-bar high by an amount equal to the prior 5-bar range a trade is entered in the direction of the move.
The Exit criteria; exit after 3 bars which is 90mins when using a 30min periodicity.
Note, this script is shared to show that momentum generated on or around the cash open tends to persist. The entry and exits of this strategy are quite naive but there are plenty of ways to take more aggressive entries on faster time frames when an open drive occurs. The times chosen for this strategy will suit stock index futures mainly. The user can experiment with other futures products and their corresponding pit/ cash open hours.
Google "open drive market profile" for more information on open drives and market profile concepts.
Happy trading!
Price Filter [AstrideUnicorn]The indicator calculates a fast price filter based on the closing price of the underlying asset. Overall, it is intended to provide a fast, reliable way to detect trend direction and confirm trend strength, using statistical measures of price movements.
The algorithm was adapted from Marcus Schmidberger's (2018) article "High Frequency Trading with the MSCI World ETF". It demeans the price time series using the long-term average and then normalizes it with the long-term standard deviation. The resulting time series is then compared to specified thresholds to determine the trend direction.
HOW TO USE
The indicator surface is colored green if the price is trending upwards and red if the price is trending downwards. If the indicator outline is the opposite color of the indicator surface, it indicates that the price is moving against the trend and the current trend may be losing strength.
If the 'Use threshold' setting is enabled, the indicator will be colored blue if its value is within the range defined by the upper and lower thresholds. This indicates that the price is trending sideways, or that the current trend is losing strength.
SETTNGS
Length - the length of the long-term average used to calculate the price filter. Recommended range 20 - 200. The sensitivity of the indicator increases as the value becomes smaller, allowing it to detect smaller price moves and swings earlier.
Threshold - the threshold value used to detect trend direction.
Use threshold - a boolean (true/false) input that determines whether to use the threshold value for confirmation.
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).
Musashi_Fractal_Dimension === Musashi-Fractal-Dimension ===
This tool is part of my research on the fractal nature of the markets and understanding the relation between fractal dimension and chaos theory.
To take full advantage of this indicator, you need to incorporate some principles and concepts:
- Traditional Technical Analysis is linear and Euclidean, which makes very difficult its modeling.
- Linear techniques cannot quantify non-linear behavior
- Is it possible to measure accurately a wave or the surface of a mountain with a simple ruler?
- Fractals quantify what Euclidean Geometry can’t, they measure chaos, as they identify order in apparent randomness.
- Remember: Chaos is order disguised as randomness.
- Chaos is the study of unstable aperiodic behavior in deterministic non-linear dynamic systems
- Order and randomness can coexist, allowing predictability.
- There is a reason why Fractal Dimension was invented, we had no way of measuring fractal-based structures.
- Benoit Mandelbrot used to explain it by asking: How do we measure the coast of Great Britain?
- An easy way of getting the need of a dimension in between is looking at the Koch snowflake.
- Market prices tend to seek natural levels of ranges of balance. These levels can be described as attractors and are determinant.
Fractal Dimension Index ('FDI')
Determines the persistence or anti-persistence of a market.
- A persistent market follows a market trend. An anti-persistent market results in substantial volatility around the trend (with a low r2), and is more vulnerable to price reversals
- An easy way to see this is to think that fractal dimension measures what is in between mainstream dimensions. These are:
- One dimension: a line
- Two dimensions: a square
- Three dimensions: a cube.
--> This will hint you that at certain moment, if the market has a Fractal Dimension of 1.25 (which is low), the market is behaving more “line-like”, while if the market has a high Fractal Dimension, it could be interpreted as “square-like”.
- 'FDI' is trend agnostic, which means that doesn't consider trend. This makes it super useful as gives you clean information about the market without trying to include trend stuff.
Question: If we have a game where you must choose between two options.
1. a horizontal line
2. a vertical line.
Each iteration a Horizontal Line or a Square will appear as continuation of a figure. If it that iteration shows a square and you bet vertical you win, same as if it is horizontal and it is a line.
- Wouldn’t be useful to know that Fractal dimension is 1.8? This will hint square. In the markets you can use 'FD' to filter mean-reversal signals like Bollinger bands, stochastics, Regular RSI divergences, etc.
- Wouldn’t be useful to know that Fractal dimension is 1.2? This will hint Line. In the markets you can use 'FD' to confirm trend following strategies like Moving averages, MACD, Hidden RSI divergences.
Calculation method:
Fractal dimension is obtained from the ‘hurst exponent’.
'FDI' = 2 - 'Hurst Exponent'
Musashi version of the Classic 'OG' Fractal Dimension Index ('FDI')
- By default, you get 3 fast 'FDI's (11,12,13) + 1 Slow 'FDI' (21), their interaction gives useful information.
- Fast 'FDI' cross will give you gray or red dots while Slow 'FDI' cross with the slowest of the fast 'FDI's will give white and orange dots. This are great to early spot trend beginnings or trend ends.
- A baseline (purple) is also provided, this is calculated using a 21 period Bollinger bands with 1.618 'SD', once calculated, you just take midpoint, this is the 'TDI's (Traders Dynamic Index) way. The indicator will print purple dots when Slow 'FDI' and baseline crosses, I see them as Short-Term cycle changes.
- Negative slope 'FDI' means trending asset.
- Positive most of the times hints correction, but if it got overextended it might hint a rocket-shot.
TDI Ranges:
- 'FDI' between 1.0≤ 'FDI' ≤1.4 will confirm trend following continuation signals.
- 'FDI' between 1.6≥ 'FDI' ≥2.0 will confirm reversal signals.
- 'FDI' == 1.5 hints a random unpredictable market.
Fractal Attractors
- As you must know, fractals tend orbit certain spots, this are named Attractors, this happens with any fractal behavior. The market of course also shows them, in form of Support & Resistance, Supply Demand, etc. It’s obvious they are there, but now we understand that they’re not linear, as the market is fractal, so simple trendline might not be the best tool to model this.
- I’ve noticed that when the Musashi version of the 'FDI' indicator start making a cluster of multicolor dots, this end up being an attractor, I tend to draw a rectangle as that area as price tend to come back (I still researching here).
Extra useful stuff
- Momentum / speed: Included by checking RSI Study in the indicator properties. This will add two RSI’s (9 and a 7 periods) plus a baseline calculated same way as explained for 'FDI'. This gives accurate short-term trends. It also includes RSI divergences (regular and hidden), deactivate with a simple check in the RSI section of the properties.
- BBWP (Bollinger Bands with Percentile): Efficient way of visualizing volatility as the percentile of Bollinger bands expansion. This line varies color from Iced blue when low volatility and magma red when high. By default, comes with the High vols deactivated for better view of 'FDI' and RSI while all studies are included. DDWP is trend agnostic, just like 'FDI', which make it very clean at providing information.
- Ultra Slow 'FDI': I noticed that while using BBWP and RSI, the indicator gets overcrowded, so there is the possibility of adding only one 'FDI' + its baseline.
Final Note: I’ve shown you few ways of using this indicator, please backtest before using in real trading. As you know trading is more about risk and trade management than the strategy used. This still a work in progress, I really hope you find value out of it. I use it combination with a tool named “Musashi_Katana” (also found in TradingView).
Best!
Musashi
Linear Regression AngleThere are several Linear Regression indicator in the Public Library, but I don't think there is one that converts the Linear Regression (LR) curve into angle in degrees, relative to a set reference frame. Due to the large price range between tickers, creating this indicator isn't as straight forward as I originally thought. For example, given the same time period, a stock that fluctuate in the 10's will have a true linear regression angle dramatically different from a penny stock. Even changing the scale on your chart will affect the "apparent" angle you see on the chart. Hence, this indicator DOES NOT provide the true linear regression angle, but only a relative one based on a defined number of historical bars.
Originality and usefulness
This indicator provides Linear Regression (LR) Angle in degree that may be more easily interpreted by some traders as we are more accustomed to line angles in degree and know how to visualize them.
This script also provides the option to overlay up to four LR curves of different periods, as well as an average curve of the enabled curves. This allows traders to analysis short to long term trends.
Furthermore, slope (rate of change) of each LR curves can be toggled. The slope plot can help traders visualize accelerations and decelerations of the LR curves which may help in spotting trend reversals.
Data table provides real time data for each curve.
Example of using slope plot with a 30 bars Linear Regression Angle:
MAGIC MACDMAGIC MACD ( MACD Indicator with Trend Filter and EMA Crossover confirmation and Momentum). This MACD uses Default Trading view MACD
from Technical indicators library and adding a second MACD along with 3 EMA's to detect Trend and confirm MACD Signal.
Eliminates usage of 3different indicators (Default MACD , MACD-2,EMA5, EMA20, EMA50)
Basic IDEA.
Idea is to filter Histogram when price is above or below 50EMA. Similar to QQE -mod oscillator but Has a EMA Filter
1.Take DEFAULT MACD crossover signals with lower period
2.check with a Higher MACD Histogram.
3.Enter upon EMA crossover signal and Histogram confirmation.
Histogram changes to GRAY when price is below EMA 50 or above EMA 50 (Follows Trend)
4.Exit on next Default MACD crossover signal.
Overview :
Moving Average Convergence Divergence Indicator Popularly Known as MACD is widely used. MACD Usually generates a lots of False signals
and noise in Lower Time Frames, making it difficult to enter a trade in sideways market. Divergence is a major issue along with sideways
movement and tangling of MACD and Signal Lines. There is no way to confirm a Default MACD signal, except to switch time frames and
verify.
Magic MACD Can be used to in combination with other signals.
This MACD uses two MACD Signals to verify the signal given by Default MACD . The Histogram Plot shown is of a higher period
MACD (close,5,50,30) values. When a signal is generated on a lower MACD it is verified by the histogram with higher time period.
Technicals Used:
1. Lower MACD-1 values 12,26 and signal-9 (crossover Signals)
2. Higher MACD-2 values 5,50 and signal-30 (Histogram)
3. EMA 50 (Histogram Filter to allow only if price above or below Ema 50)
4. EMA 5 and EMA 20 for crossover confirmation of trend
What's is in this Indicator?
1.Histogram-(higher period 5,50 and 30signal)
2. MACD crossover Signals-(lower period Default MACD setting)
3.Signal Lines-( EMA 5 & 20)
Implemented & Removed in this Indicator
1. Default MACD and Signal Lines are removed completely
2. MACD crossover are taken on lower periods and plotted as signals(Blue Triangle or Red Triangle)
3. Histogram is plotted from a higher Period providing a clear picture with Higher Time period
4. EMA 5 and EMA 20 are used for MACD signal confirmation
How to use?
Up Signal
1. MACD Default (12,26,30) up signals are shown in Blue
2. Wait till the Histogram changes Blue
3. Look for EMA signals crossover near by
Down Signal
1. MACD Default (12,26,30) up signals are shown in Red
2. Wait till the Histogram changes Red
3. Look for EMA signals crossover near by
Do's
Consider only opposite color as signals
1. Red Triangle on Blue Histogram(likely to move down direction)
2. Blue Triangle on Red Histogram (Likely to move up direction)
Don'ts
1.Ignore Blue Signal on Blue Histogram (pull back signals can be used to enter trade if you miss first crossover)
2.Ignore Red Signal on Red Histogram(pull back signals can be used to enter trade if you miss first crossover)
3.Ignore Up and Down signals till Gray or Blacked out area is finished in Histogram
Tips:
1. EMA plot also shows pull back areas along with signals
2.side by side opposite signals shows sides ways movement
3. EMA 5,20 is plotted on MACD Histogram for Additional Benefit
Thanks & Credits
To Tradingview Team for allowing me to use their default MACD version and coding it in to a MAGIC MACD by adding a few lines of code that
makes it more enhanced.
Warning...!
This is purely for Educational purpose only. Not to be used as a stand alone indicator. Usage is at your own Risk. Please get familiar with its working before implementing. Its not a Financial Advice or Suggestion . Any losses or gains is at your own risk.
Trend Finder with Coefficient of VariationCoefficient of variation (“COV”) is a statistical measure used to describe the variability of values within a data set, it’s calculated by taking the standard deviation divided by the mean.
Traditionally, COV is applied to the expected returns of competing investment portfolios. A risk adverse investor prefers to accept a portfolio with a relatively lower COV value.
On the other hand, when applying COV to price charts, the difference is that instead of looking at expected returns, we now treat price as the source of data. We look at price from a moving average perspective. This script purely focuses on price.
What this indicator does:
Firstly, to go over the parameters:
Let ‘n’ be the lookback period for computing COV, and ‘m’ be the period for comparing the ranking of COVs.
Logics in a nutshell:
This program will (A) calculate the COV by dividing the moving standard deviation by moving average over ‘n’ bars, and then (B) illustrate the relationship of how COV at each bar ranks compared to COVs over past ‘m’ bars. We use a color scale (default black and yellow) for visualizing ranking in terms of percentiles. If COV is below its median value, then we assume that price is consolidating.
Hypothesis:
Using COV on top of regular SMA signals should reduce a lot of unwanted noise such as consecutive crossovers during ranging-periods. Traders want volatility, but not too much of it when sniping for entry opportunities (speaking of initial position; need to add to winning positions after, but this is for another topic). For this reason, the median value of COV is suitable as a metric for signals.
Applications:
We use the median value of COV to form a decision rule. A signal is generated when COV > median(COV,m), and the direction of trend is determined based on relative position of price with respect to sma(price,n). When the value of COV is increasing, it can also be thought of seeing Bollinger Bands beginning to bulge. When trends begin, this program will plot triangles to signify entry opportunities.
Immediate Trend - VHXIMMEDIATE TREND - VULNERABLE_HUMAN_X
This indicator is used to identify the immediate trend in the market.
When a Short Term High (STH) is engulfed and closed above, we consider that as a bullish trend.
And Similarly, when a Short Term Low (STL) is engulfed and closed below, we consider that as a bullish trend.
STH - A candle that is higher than the one candle towards it's left and one candle towards it's right.
STL - A candle that is lower than the one candle towards it's left and one candle towards it's right.
HOW TO USE:
1. Do not take trades purely based on the immediate trend showcased by the indicator. Rather, use them as confluence with your trading strategy.
2. When you are expecting price to reverse at your point of interest (Denamd/Supply zone), this indicator can help you predict the reversal by showcasing the current trend.
3. Using this indicator you can travel the trend as long as there is a change of trend predicted by this indicator.
M0PB (Momentum Pullback)Long/short strategy that identifies extreme readings on the rsi as a *momentum signal*, unlike most RSI strategies the script will look to buy or sell the first pullback in the direction of the extreme RSI reading.
Enters positions on the first pullback to the 5ema(low)/ 5ema(high) and exits at rolling 12 bar high/ low. The rolling high/ low feature means that if the price enters into a prolonged consolidation the profit target will begin to reduce with each new bar. The best trades tend to work within 2-6 bars.
Built for use on 5 min intervals on FX, Indexes, and Crypto. Lower than 5 minute time frames tend to be noisier and mean more commissions and a higher risk of slippage so the suggested timeframe is 5 mins.
Hard stop is X ATR (users can experiment with this) from the position entry price. This can be adjusted in user inputs.
There is a lot of slack left in entries and exits but the overall strategy is fairly robust across timeframes and markets and has between 60%-70% win rate with larger winners.
Signals that occur from economic news volatility are best avoided.
Gedhusek TrendFibonacciThis indicator is a trend filter based on fibonacci retracement levels
How to read:
- There are three filled zones --> red, yellow and green
- If the price is inside of red zone, there is a downtrend on the market
- If the price is inside the yellow zone, there is a sideways trend on the market
- If the price is inside the green zone, there is a uptrend on the market
- Also, candles are going to have a corresponding color based on the current trend
Calculations of the indicator:
1. Calculate distance between maximal and minimal price over the last "x" bars (choose value for "x" in inputs menu under the "Analysis period")
2. Use this distance for calculating two retracement levels (choose retracement levels in inputs menu)
3. These two retracement levels create an area of what is going to be considered as sideways market
Example:
- Lets say we chose Analysis period of 100, Lower Fibonacci Level as 0.382 and Upper Fibonacci Level as 0.618
- Maximum price over the last 100 bars was of 120 and minimum price was 20. That leaves us with the difference of 100 points
- Now we calculate the fibonacci levels --> 100*0.382 = 38.2 and 100*0.618 = 61.8
- The next step is to add the levels to the lowest price point --> 20 + 38.2 = 58.2 and 20 + 61.8 = 81.8
- And now we have our zones. If the price is going to be below the lower fibonacci level (in this case 58.2), we consider it as a bearish trend. If the price is between those fibonacci levels (58.2 and 81.8), we consider it as a sideways trend. And if the price is above the upper fibonacci level (81.8), we consider it as a bullish trend.
Inputs:
- Analysis period --> number of bars within which the system is going to look for max and min price
- Lower Fibonacci Level --> Choose from options and must be lower or the same as "Upper Fibonacci Level"
- Upper Fibonacci Level --> Choose from options and must be higher or the same as "Lower Fibonacci Level"
- Show Filling --> whether you wish to fill the areas with color
- Change Candle Color --> whether you wish to change the color of candles based on current trend.
[-_-] Volatility Calibrated ATRDescription:
An indicator based on ATR adjusted for volatility of the market. It uses Heikin Ashi data to find short and long opportunities and displays a dynamic stop loss level. Additionally, it has alerts for when the trend changes (which is an entry signal).
How it works:
It works by dynamically calculating the Period for ATR which depends on current volatility level that is calculated by a function that uses Standard Deviation of price. ATR is then smoothed by Weighted Moving Average and multiplied by ATR Factor, resulting in a plot that changes its colour to red when we're in a downtrend and green when in an uptrend. This plot should be used as a dynamic Stop Loss level. Trend change is determined by price crossing the dynamic Stop Loss level. The squared red and green labels appear when the trend changes, and should be used as Entry signals.
Parameters:
- Source -> data used for calculations
- ATR Factor -> higher values produce less noise and longer trends, lower values give more signals
RSItrendRSItrend is a trend indicator based on the standard RSI.
The logic of building the indicator: We build a channel based on the RSI extremes. The exit of the RSI from the channel up is the beginning of the uptrend, the exit of the RSI from the channel down is the beginning of the downtrend. In the downtrend, the candles are colored blue, in the uptrend - orange.
Possible use of the indicator:
I recommend using it with heiken ashi
On small timeframes, you can trade using extremes that are easy to determine by the indicator, as shown in the example given.
On the higher timeframes above the day, you can simply buy an orange bar, sell a blue one. Add a few money management techniques and make a profit.
Gedhusek UltraTrendThis indicator serves a purpose of a trend recognizer. It is able to tell you whether the market is bullish, bearish or if the price goes sideways.
Process of determining the trend:
- The indicator uses 3 moving averages to determine the trend
- For each of these averages, there is calculated value change over a certain period. So, if the value of Moving average was 100 and now it is 110, the change is going to be +10
- After these calculations are done, all three of these values are summed up into one
- Based on this value we can determine whether the overall sentiment is bullish or bearish (if the value is larger than 0, the sentiment is bullish and if it is bellow 0, it is bearish)
- One more metric is used when determining the overall trend, and that is the ATR indicator. This indicator represents a certain movement threshold that has to be surpassed in order to have a valid trend
- So all of this can be summed up into this -> if the summed up value of the value shift of 3 moving averages over certain period is larger than ATR value for certain period, the trend is considered as bullish and if this summed up value is lower than ATR value *-1, the trend is considered as bearish. In case the summed value is smaller than ATR value and larger than ATR value *-1, there is no trend.
-----------------------------------------------------------------------------------------
How to use the Indicator:
- The indicator should be used as a tool for giving you a generic feel about the current trend
- It is not a signal providing system
- It can be adjusted for any trading style by changing the Periods in input menu. (As the values are lower, it will give you more short time trend and vice versa)
- It is a great tool to combine with any trend following strategy
-----------------------------------------------------------------------------------------
Which markets and TimeFrame:
- The UltraTrend Indicator works on all of the markets and all of the TF
- I usually use it on 15min and 1H TF, but that is solely my preference
-----------------------------------------------------------------------------------------
Inputs:
First Period = Period of the first MA
Second Period = Period of the second MA
Third Period = Period of the third MA
ATR Period = Period of the ATR
Ticker vs IndexI was exploring a simple idea how I can visualize the ticker performance against the underlying Index (or any other ticker) performance.
how it works:
When the line is moving up (blue zone), the ticker is performing better than the underlying index (e.g. SPX)(configurable).
When the line is moving down (red zone), the ticker is performing worse than the underlying index.
How to use it:
Use as confirmation always in conjunction with other (main) indicators, avoid "buy" when indicator is in the red zone
Also, crossing over the zero line is often an indication for an upcoming upward move
Try to different SMA length - default is 20 but 10 was often showing better results
(No financial advise, for testing purposes only)
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.
True Accumulation/Distribution (TG fork)An accumulation/distribution indicator that works better against gaps and with trend coloring.
Accumulation/Distribution was developed by Marc Chaikin to provide insight into strength of a trend by measuring flow of buy and sell volume .
The fact that A/D only factors current period's range for calculating the volume multiplier causes problem with price gaps. They are ignored or even misinterpreted.
True Accumulation/Distribution solves the problem by using True Range instead of only relying on current period's high and low.
Most of the time, True A/D reverts to producing the same values as the original A/D. The difference between True A/D and original A/D can be better seen when a gap has occurred, True A/D has handles it better than Accumulation/Distribution which a bearish close in period's range cause it to misinterpret the strong buy pressure as sell volume
The Moving Average Cloud is simply the filling between the moving average and the True A/D. This feature was inspired by D7R ACC/DIST closed-source indicator, kudos to D7R for making such neat visual indicators (but unfortunately all closed source!).
This indicator was made to extend the original work by adding MTF support and a moving average cloud and coloring.
If you like this indicator, please show the original author RezzaHmt some love:
Musashi_Katana=== Musashi-Katana ===
This tool was designed to fit my particular trading style and personal theories about the "Alchemy of the markets" and ''Harmonic Structure'.
Context
When following a Technical approach to to surf the markets, there are teachings that must be understood before reaching a confort-zone, this usually happen the possible worst way by constant experimentation, it hurts.
Here few technical hints:
- Align High timeframes with lower timeframes:
This simple concept relax a lot complexity of finding of a trend bias. Musashi-Katana allows you to use technical indicator corresponding to specific timeframes, like daily weekly or yearly. They wont change when you change the chart's timeframe, its very useful as you know where you're standing in the long term, Its quite relaxing.
- Use volume:
The constant usage of volume will allow you to sync with the market's breathing. This shows you the mass of money flowing into and out of the market, is key if you want to understand momentum. This tool can help here, as it have multi-period vwaps. You can use yearly, monthly for swing trading, and even weekly if you enjoy scalping.
Useful stuff:
- You have access to baselines, AMA and Kijun-sen with the possibility of adding ATR bands.
- AMAs come as two lines strategies for different approaches, fast medium or slow.
- You can experiment with normal and multi timeframe moving averages and other trend tools.
Final Note
If used correctly Musashi-Katana is a very powerful tool, which makes no sense as there is no correct usage. Don't add everything at the same time, experiment, combine stuff, every market is different.
Backtest every possible strategy before using it, see what works and doesn't. This gives you a lot of peace, specially while you're at the tip of the spear surfing the markets
--> I personally use this in combination with 'Musashi_Slasher (Mometum+Volatility)', as it gives me volatility and momentum in a very precise way.
Band of Filtered RS by Mustafa ÖZVERBand of Filtered RS by Mustafa ÖZVER
This code shows a range (max-min values) price may get if we get strong movements. These values is based on RSI (Relative Strange Index). And also these are calculated using RSI, if we get trades to make rsi is equal to 25 (or rsi down limit) or 75 (rsi up limit) or any value you set, how much will price value get? This code calculate these and shows these to you on graph.
This price are between these band limits because we expect cross reaction to hard movements on price.
For scalping, we can use these values as
long signal when price under down limit,
short signal when price over up limit,
But only these values can not guarantee good results for trading. BE CAREFUL