Strength Comparison @joshuuuexample:
if you want to find the stronger/weaker pair between eurusd and gbpusd, what you can do is check the eurgbp charts. if eurgbp is bullish, that means, that longs longs on eurusd are better than on gbpusd.
Unfortunately, there is no such thing to compare for example usoil with ukoil, or us100 with us500.
That's where this indicator comes in handy. You can choose whatever two symbols you want, that are supported by tradingview and you will get a chart, which shows symbol1/symbol2.
Now you can use normal market structure, or the ema option, to find out the stronger symbol.
This can also help predicting the so called SMT Divergences, taught by ICT.
⚠️ Open Source ⚠️
Coders and TV users are authorized to copy this code base, but a paid distribution is prohibited. A mention to the original author is expected, and appreciated.
⚠️ Terms and Conditions ⚠️
This financial tool is for educational purposes only and not financial advice. Users assume responsibility for decisions made based on the tool's information. Past performance doesn't guarantee future results. By using this tool, users agree to these terms.
PAIR
Pair ViewerPair-Trading is a recognized and widely used trading method, this indicator is a tool that allows via several display interfaces (2 at the moment) to see relative performance ratios of two assets.
The inputs are pretty simple to understand but here is the list of them :
- Ticker #1 : The first Asset's ticker // numerator of the ratio
- Ticker #2 : The second Asset's ticker // denominator of the ratio
- View as : Display Method
- Up Color : Color of positive candle (when close > open)
- Down Color : Color of negative candle (when close < open)
Of course, this indicator only shows stuff at the chart, it does NOT provide any investment advice.
trading YM based on pair tradingThis is inspired by some online free webinars. Didn't pay for the strategy/ course. I just figured it out myself. So there might be problem with this strategy.
Theory: It is based on something called cointegrated. Cointegration means the difference between 2 securities are stable in long term. When the difference is bigger / smaller than normal, then there is space to make profit. You can use some tests to check if they are cointegration. I don't think YM and NQ are strictly cointegrated. I used other platform to test the cointegration. They are not cointegrated. There are multiple ways to do pair trading. I use "Y = A - B * (A /B)" to do this. The back test on tradingview can only trade one security. This is not pair trading in this backtest. But only do long and short based on the theory of pair trading. The max drawdown is huge. You should be careful before doing anything with this strategy.
Welcome to give some advice on improvement.
Cross Pair [NeoButane]Creates candlesticks of a cross pair of any symbol you want. Ideally both pairs would be denominated in the same currency.
The candlesticks are plotted, a close value is available to use for applying indicators on, and a label shows what is being used.
Options to configure are choosing the symbols, displaying the ticker without the exchange name, and removing wicks. If the exchange prefix is 'BATS', 'FRED', or 'TVC', it is automatically removed.
Symbols PairDraws the ratio between two input symbols.
You might find patterns in the ratio.
# Open Source
The code is open source @ github.com and uses the commonpine library github.com
Volume ExternalShows the volume of a specified exchange and pair. They should be entered in the format EXCHANGE:PAIR, e.g. BINANCE:ETHUSDT.
You can add multiple indicators of this to do volume analysis of multiple pairs on the same chart.
SpreadTrade - CorrelationCorrelation Based Pair Trading Strategy (Trading the spread)
There are three popular styles of Pair trading:
* Distance based pair trading
* Correlation based pair trading
* Cointegration based pair trading
The correlation based strategy is to short the outperforming instrument and go long on the underperforming one
whenever the temporary correlation weakens which means one instrument going up and another going down.
Here, instead of two different instruments two timeframes of the same instrument are used, lower and higher.
In order to calculate the trade size, we would need to calculate hedge_ratio,
which is simply the ratio of the closing price of the instrument in the current tf to the higher tf.
So whenever we want to go short on spread we’ll short 1 unit of current tf and go long on hedge ratio times units of higher tf.
In order to generate trading signals, we need to define our trading logic.
So, we’ll go long on the spread when the hedge ratio goes below its p rolling mean by mult times of its
rolling standard deviation and vice versa.
Note that both p and mult can be changed as per your selection of instruments.
See: analyticsprofile.com
NOTE:
There is a minor problem to it in Pinescript. After a while the signal line goes horizontal and the two bounds, upper and lower, converge unless you update the time frame.
Kepp me in the know if you find a solution to this problem)
Pair Strength: Updated Version of the one by GlazI updated this version used for Forex with Stock&Index related instruments. Enjoy.
StatArbPair trading is employed by professional traders to outperform the market. This script is a complete trading strategy where you can set your own parameters and the system will generate ready to trade signals. All you have to do is just execute profitable trades based on your own parameters.