MarketStructureLibrary "MarketStructure"
This library contains functions for identifying Lows and Highs in a rule-based way, and deriving useful information from them.
f_simpleLowHigh()
This function finds Local Lows and Highs, but NOT in order. A Local High is any candle that has its Low taken out on close by a subsequent candle (and vice-versa for Local Lows).
The Local High does NOT have to be the candle with the highest High out of recent candles. It does NOT have to be a Williams High. It is not necessarily a swing high or a reversal or anything else.
It doesn't have to be "the" high, so don't be confused.
By the rules, Local Lows and Highs must alternate. In this function they do not, so I'm calling them Simple Lows and Highs.
Simple Highs and Lows, by the above definition, can be useful for entries and stops. Because I intend to use them for stops, I want them all, not just the ones that alternate in strict order.
@param - there are no parameters. The function uses the chart OHLC.
@returns boolean values for whether this bar confirms a Simple Low/High, and ints for the bar_index of that Low/High.
f_localLowHigh()
This function finds Local Lows and Highs, in order. A Local High is any candle that has its Low taken out on close by a subsequent candle (and vice-versa for Local Lows).
The Local High does NOT have to be the candle with the highest High out of recent candles. It does NOT have to be a Williams High. It is not necessarily a swing high or a reversal or anything else.
By the rules, Local Lows and Highs must alternate, and in this function they do.
@param - there are no parameters. The function uses the chart OHLC.
@returns boolean values for whether this bar confirms a Local Low/High, and ints for the bar_index of that Low/High.
f_enhancedSimpleLowHigh()
This function finds Local Lows and Highs, but NOT in order. A Local High is any candle that has its Low taken out on close by a subsequent candle (and vice-versa for Local Lows).
The Local High does NOT have to be the candle with the highest High out of recent candles. It does NOT have to be a Williams High. It is not necessarily a swing high or a reversal or anything else.
By the rules, Local Lows and Highs must alternate. In this function they do not, so I'm calling them Simple Lows and Highs.
Simple Highs and Lows, by the above definition, can be useful for entries and stops. Because I intend to use them for trailing stops, I want them all, not just the ones that alternate in strict order.
The difference between this function and f_simpleLowHigh() is that it also tracks the lowest/highest recent level. This level can be useful for trailing stops.
In effect, these are like more "normal" highs and lows that you would pick by eye, but confirmed faster in many cases than by waiting for the low/high of that particular candle to be taken out on close,
because they are instead confirmed by ANY subsequent candle having its low/high exceeded. Hence, I call these Enhanced Simple Lows/Highs.
The levels are taken from the extreme highs/lows, but the bar indexes are given for the candles that were actually used to confirm the Low/High.
This is by design, because it might be misleading to label the extreme, since we didn't use that candle to confirm the Low/High..
@param - there are no parameters. The function uses the chart OHLC.
@returns - boolean values for whether this bar confirms an Enhanced Simple Low/High
ints for the bar_index of that Low/High
floats for the values of the recent high/low levels
floats for the trailing high/low levels (for debug/post-processing)
bools for market structure bias
f_trueLowHigh()
This function finds True Lows and Highs.
A True High is the candle with the highest recent high, which then has its low taken out on close by a subsequent candle (and vice-versa for True Lows).
The difference between this and an Enhanced High is that confirmation requires not just any Simple High, but confirmation of the very candle that has the highest high.
Because of this, confirmation is often later, and multiple Simple Highs and Lows can develop within ranges formed by a single big candle without any of them being confirmed. This is by design.
A True High looks like the intuitive "real high" when you look at the chart. True Lows and Highs must alternate.
@param - there are no parameters. The function uses the chart OHLC.
@returns - boolean values for whether this bar confirms an Enhanced Simple Low/High
ints for the bar_index of that Low/High
floats for the values of the recent high/low levels
floats for the trailing high/low levels (for debug/post-processing)
bools for market structure bias
Dowtheory
Trend From Volume And Price (TFVAP)Indicator that indicates buying and selling times based on price and volume and who is imposed of the two (VAP).
It uses the trends of the Dow theory (primary: 365 days/1 year, secondary: 90 days/3 months and tertiary: 21 days/3 weeks) and the identification of Elliot waves, both impulse and correction, based on the Fibonacci retracements (23.61% , 38.2%, etc.).
- Purple line is the evolution in percentage of the price in the primary trend
- Blue line is the evolution in percentage of the volume in the primary trend
- White line is the evolution in percentage of the (volume % - price %) in the primary trend, if white line > 0
- Green triangleup is time of start to buy
- Green square is time of stop to buy
- Red triangledown is time of sell
To understand it better:
If the purple line goes up it indicates that the price is rising, if it goes down, that the price is down.
If the blue line is greater than 0 it indicates that there are more purchases than sales, if the blue line is less than 0 it indicates that there are more sales than purchases.
If the white line is greater than 0 there is a high volume of purchases or low sales for the price that there is, it is likely that the price will rise.
If the white line is less than 0 there is a low volume of purchases or high sales for the price that there is, it is likely that the price will go down.
PD: Ignore the chart drawings, the indicator script is only represented at the bottom
Smart Relative Strength Can Remove False SignalsRelative strength is one of the most useful indicators in the market, highlighting when stocks and sectors are outperforming or underperforming a broader index.
Traditional RS compares the percentage change of one symbol over a given time frame and subtracts the percentage change of the S&P 500 over the same period.
This is handy, but it can produce false signals at times of volatility. For example, when the broader market is crashing, certain sectors may “outperform” simply by falling less than the S&P 500.
Smart Relative Strength addresses this shortcoming by requiring that the symbol’s absolute AND relative returns both be positive. Otherwise a zero is returned.
This was useful last week on the Dow Jones Transportation Average . Using simple relative strength, it had its best one-week performance against the S&P 500 since October 2008. This was obviously a false signal because October 2008 was a time that everything else was crashing.
Smart Relative Strength showed that, excluding periods of overall decline, DJT had its best week since January 2008.
Note: This chart uses a 1-period interval, while the code defaults to 21 periods.
Dow Factor RSI Fractals with Risk Detector
This script is only the fact that the fractals are set according to my Dow Factor RSI .
Bar color and background change where risk factor is high.
You can turn it off or on from the menu.
I'm not licensing because "fractal support and resistances" are not my own codes.
The rest are my own products.
For more information about the Dow Factor RSI:
For more information on the DVOG Risk Detector:
For information about Dependent Variable Odd Generator :
To see the script in a storm theme with Quadruple Exponential Moving Averages:
Best wishes.
Storm Trading System This script is inspired by the following :
Fractal Dow RSI Support and Resistance ;
Moving Average Clouds ;
Let's start.
This command is based on a fun description of where we are.
Technical analysis methods are likened to a storm.
Clouds as moving average,risk factor as lightning,
fractals were taken as green and red rain.
In this system:
4 Exponential Moving Averages, ( EMA15, EMA30 , EMA45 , EMA60 ),
interpretation of my own work, Dow Factor RSI, as Fractal Support and Resistance,
interpretation of my own work , DVOG Risk Factor : with changeable background and bar color.
Fractal support resistance level codes do not belong to me.
So I'm not putting a license.
But the other codes are my labor.
Consider the risk factor not as a stop, but as a region of high attention.
It is a warning before hard movements.
And watch out for turbulence in the clouds :)
The regions above and below the clouds are major trend zones, which may take a long time.
Guide the fractals in these areas.
It allows you to comment on this and tons of similar things.
And you see where you are in the big trade from a different perspective.
Repaint issue :
Firstly our source is close . Repaint will only cause the following issue and solution:
There may be a time difference between countries as the dow factor depends on the indexes.
Do not use a low graph time frame in stocks.
Function : Multiple Correlation
This script was written to calculate the correlation coefficient (Adjusted R-Squared) for one dependent and two independent variables.(3-way)
Pearson correlation method was used with exponential moving averages as the correlation calculation method.
Use your source ( i use "close" generally ) as the dependent variable.
Inspired by this article : www.real-statistics.com
The Adjusted R-Squared coefficient is used as output, but the R-Squared coefficient is also available in the code.
Adjusted R-Squared is often used for multiple correlations.
It also gives better results in large samples.
Here is the article about the difference of the two coefficients : www.investopedia.com
I wrote this function to increase the efficiency of my Dow Factor I used before.
When my research is over, I will apply the 3-factor correlation to my scripts.
I hope that I will achieve more efficient indicators and oscillators and even strategies.
In this command, I gave a few variable values and plotted them as an example.
I hope this function is useful in your work.
Finally, you can use periods as mutable variables.
The function is recovered from integer loads.
Best regards. Noldo
Dow Factor Stoch RSIThe indicator was generated by adding the Dow Factor to the Stochastic Relative Strength Index.( Stoch RSI )
The Dow factor is the effect of the correlation coefficient, which determines the relationship between volume and price, on the existing indicators.
With these codes we are able to integrate them numerically into the indicators.
For more information on the Dow factor, please see my indicator:
This code is open source under the MIT license. ( github.com )
My dow factor updates will continue.We adapted the indicators and saw successful results, now it is time to examine and develop the factor itself.
Stay tuned , best regards.
REAL STRATEGY : Dow_Factor_MFI/RSI_DVOG_StrategyI'm actually one of those who think it's more important to extract clues from indicators than strategy, but I wanted to test the data about the probability and dow factor I've shared for a long time.
Usually, Bitcoin is used as an eye stain for strategy success, since the graph has increased significantly from the beginning.
To prevent this, I used a commission and in the last lines of document I shared Bitmex's Bitcoin and Ethereum 1W test results.
I don't think there's a factor to repaint. ( Warn me if u see or observe )
I considered Bitcoin because I found working with liquid parities much more realistic.
Ethereum and Bitmex have been featured as a spot and may soon find a place at the CME , so I've evaluated the Ethereum .
But since the Ethereum Bitmex was also spot new, I deleted results that were less than 10 closed trades.
Since the Dow Theory also looks at the harmony in the indices, just try it in the Cryptocurrency market.
Use as indicator in other markets. Support with channels, trend lines with big periods and other supportive indicators.
And my personal suggestion : Use this script and indicator TF : 4H and above.
Specifications :
Commission. ( % 0.125 )
Switchable Methods ( Relative Strength Index / Money Flow Index )
Alarms. (Buy / Sell )
Position closure when horizontal market rates weighs.
Progressive gradual buy/sell alarms.
Clean code layout that will not cause repaint. (Caution : source = close )
Switchable barcolor option (I / 0 )
*****Test results :*****
drive.google.com
Summary:
It was a realistic test.
It has achieved great success in some markets, but as I mentioned earlier, use it only to gain insight into the price movements of cryptos.
Use as indicator in other markets.
This code is open source under the MIT license. If you have any improvements or corrections to suggest, please send me a pull request via the github repository : github.com
Stay tuned ! Noldo.
Dow Factor Relative Strength IndexThis script was written to create a new, rapid relative strength index inspired by the Dow Theory.
More info about Dow Theory : www.investopedia.com
According to the Dow Theory, volume should confirm market trends.
The correlation coefficient between prices and volume is negative in weakening trends and negative trends , positive in strengthening or positive trends.a factor was formed based on the correlation coefficient between volume and prices.
This factor was added to the relative strength index.
Period 5 is selected because the volume is very volatile and can be slow.
You can use the period you want, but I recommend the period as a minimum of 5.
It is suitable for all instruments and timeframes and thanks to its design, it provides control over gradual buying and selling points.
I haven't fully tested it, it's open to updates. For now, just use it to create ideas.
If I find it necessary,
I'll update after the tests.
If you have suggestions on these issues,
Leave your comments in the comment window.
This code is open source under the MIT license. If you have any improvements or corrections to suggest, please send me a pull request via the github repository github.com
Stay tuned , best regards.
Dependent Variable Odd Generator For Machine Learning TechniquesCAUTION : Not suitable for strategy, open to development.
If can we separate the stagnant market from other markets, can we be so much more accurate?
This project was written to research it. It is just the tiny part of the begining.
And this is a very necessary but very small side function in the main function. Lets start :
Hi users, I had this idea in my mind for a long time but I had a hard time finding the parameters that would make the market stagnant. This idea is my first original command system. Although it is very difficult to make sense of the stagnant market, I think that this command system can achieve realistic proportions. With 's money flow index, I opened the track to determine the level. On the other hand, the prices were also using a money flow index, and it forced me to make the limitations between the levels in a logical way. But the good thing is that since the bollinger bandwidth uses a larger period, we are able to print normal values at extreme buy and sell values.
In terms of price, we can define excessive purchase and sale values as the period is smaller. I have repeatedly looked at the limit values that determine the bull, bear, and bollinger bandwidth (mfi), and I think this is the right one. Then I have included these values in the probability set.
The bull and bear market did not form the intersection of the cluster, and because there are connected events, the stagnant market, which is the intersection, will be added to the other markets with the same venn diagram logic and the sum of the probability set will be 1. is equal to. I hope that we can renew the number generators in the very important parameters of machine learning such as Markov Process with generators dependent on dependent variables, which bring us closer to reality. This function is open to development and can be made of various ideas on machine learning. Best wishes.
This code is open source under the MIT license. If you have any improvements or corrections to suggest, please send me a pull request via the github repository github.com
Tabajara by André MachadoAmigos da comunidade TradingView que me pediram o Setup Tabajara, segue ele aqui para uso livre e educacional!
Na verdade é um Setup de Finanças Comportamentais, ou o que chamo de Setup Ansiolítico!!!
O meu Trading System é 100% discricionário e 100% baseado em AT clássica, Teoria de Dow pura, ou o que chamam de Price Action. Simplesmente uso as MMA20 e MMA200 para me mostrar a tendência, evitando assim operar contra. E tb usando o conceito matemático de "regressão à média" e operando as reversões nelas. Enfim, muito básico mesmo. Por isso o nome Tabajara, porque não tem nada de novo! O jogo de cores é só para gerenciar mesmo a ansiedade e forçar a disciplina e a paciência!
E aproveito para agradecer ao Filipe Ramos, da TradingView Brasil, por ter criado o setup Tabajara a meu pedido!