Spread
Back - Front Futures Spread 4hr IndicatorThis puts a normalized back - front spread based on the close price.
Objective Analysis of Spread (VSA)Note: Pardon for a busy chart. It really is irrelevant for this indicator. Just look at the bottom part of the chart for the indicator (SpAn).
This script is meant to add objectivity to the estimation of spread in VSA. This is best used with a similar volume indicator that measures volume in the same fashion, but a simple rule of "higher/lower than the previous 2 bars" for estimation of volume size can be used as well in conjunction with this indicator.
A 30-period (adjustable) SMA difference between the high and the close is used to estimate average spread. This value is used to plot bands of 0.8 and lower (blue) standard deviation for narrow spread, 0.8-1.3 (yellow) for medium spread, 1,3-1.8 (green) for wide spread, 1.8-3 (red) for ultra-wide spread. Anything above 3 (no color) is plain crazy. =)
How to use:
A histogram of each bar spread is plotted as well. See where each histogram bar ends. For example, if it ends in the green area, this bar has a wide spread.
Added indicator:
An ATR (14-period, adjustable) is plotted as a black line for your reference. May be used for stops. Otherwise, it is not necessary for VSA.
Feedback and suggestions for improvement are welcome.
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)
Broker Fixed Spread - Useful For Traditional MarketsAdds two variables on you chart.
Allows you to see broker's spread on a Tradingview Chart.
NOTE: This is made for fixed spreads!
Spread VisualizerRelatively simple indicator to help you visualize your spreads with two white lines on the chart. You can input up to ten symbol-specific presets along with one other that will be applied to all unspecified symbols. "Spread Visualizer" will only be helpful for those trading with fixed spreads. So, if your broker uses variable spreads, do not use this script.
Price SpreadIncludes logarithmic and linear plotting of price spread (high-low).
See comments for more information.
Thanks to @GravitasProblem for the inspiration.
Spreads + MA + Bollinger BandsCryptocurrency adoption is on a constant upward trajectory. The interest for trading 'crypto assets' could not stay anywhere behind. The amateur nature of the market together with huge 'price inefficiencies' is always giving rise to excellent arbitrage opportunities throughout the globe. This code aims to help traders to make money placing safe and profitable trades which will eventually help the community to move towards more efficient price discovery.
The script combines up to three assets to be monitored at the same time. It also allows the trader to plot Simple or Exponential Moving Averages and Bollinger Bands (BB) for each asset he wants to trade.
Instructions:
* International/local -- it allows the trader to switch between international spreads and local (currency) spreads, considering the market he is targeting. The default value is international. Unchecking the field will set the script for local trades.
* Fees -- enables one to add his effective operational cost directly on the chart. This feature might be potentially relevant for traders who engage with fast-moving markets which demands action to be taken right away. The logic for calculations when fees are in place is the following (fee ≠ 0): if (spread > 0), then (spread - fee). If (spread < 0), then (spread + fee). When the spread is too short, the code may plot somewhat weird charts. In this case, it might be interesting to keep fee = 0.
* Standard/ Absolute BB -- it changes from standard Bollinger Bands (default value) to absolute Bollinger Bands. The standard version calculates the bands over the moving average. The absolute version calculates each band in isolation taking absolute values as arguments. Play with the two options (and deviation) to see which is better regarding your market and the instrument of your choice. Uncheck the field to get the absolute version. Feedback on this point is particularly appreciated.
* Expon. Ma -- it switches everything from Simple Moving Averages (SMA) to Exponential Moving Averages (EMA). Default value: SMA.
I hope you guys manage to make money using the script. And if you do, feel free to show your appreciation. Any amount is welcome! Let's take advantage of what crypto enabled us.
Tips : =>
BTC: 33RUY4AXBEL89gEsoqDpXRgvdZWePhLrqc
LTC: M9mBqVhxWNuZuCPEsrRtH3ygxNYnCdMEki
LTC: 36btZsgNxqiPibag6quTEtdX367wXskUnJ (old format)
ETH: 0x1D3E1701F1A0C379e7Fcb60BADBcd14AcE8160c4
DASH: XnKHHcmhZmR2SAqavP1x6FbEBrqTYa4kTk
If you want to use the script, please, let me know leaving a comment below.
Trade wisely and good luck out there.
Relative Spread StrengthRelative Spread Strength indicator script. This indicator was originally developed by Ian Copsey (Stocks & Commodities V. 24:10 (16-23): Forex Focus).
Simple Spread Indicator + EMASimple indicator to see the spread between high and low, great to spot volatile moves. Put an exponential moving average of the spread in there too, adjustable to ones preferences.
EMA Spread OscillatorEMA Spread Oscillator
Quickly see past levels where diff maxed out. Momentum and price can only keep going up for so long. This obviously differs per underlying asset. So that is where this oscillator comes in handy.
Of course you can see on the chart how far apart the moving averages are, but it is easier to spot on an oscillator.
Simple Spread Simple spread between two tickers. Click format to set inputs for tickers. ex: "COINBASE:BTC:USD"
EMA and SMA SpreadI had hard time to find a simple script to show EMA and SMA spread.
Bonus add for PT users :)
Set "buy_value" as you have in PAIRS.properties to show you when your buys will become potential.
Kovach Crypto SpreadThe Kovach Crypto Spread indicator calculates the spread in profit between Bitcoin and the leading Altcoins. The Altcoins are weighted by market cap and this script is update weekly so you constantly have the most relevant Altcoins and their coefficients in the indicator.
Values above zero indicate a net flow from Altcoins to Bitcoin and vice versa. Let's consider how to use this data.
1. If Bitcoin is rallying, and the spread is well above zero, this indicates that Bitcoin is providing more profit than Altcoins. Consider taking some profits from BTC and investing in Altcoins.
2. If Bitcoin is retracing, but the spread is still above zero, it means that Altcoins are getting hit harder than Bitcoin, and you should keep your position in Bitcoin.
3. If Bitcoin is ranging, and the spread is below zero, it means that Altcoins are rallying and Bitcoin is stagnant.
For access to this indicator and more, please visit quantguy.net
Price relation viewer - add percent change of two symbols (BETA)This script is very much beta!
This is a simple script to visualize how two symbols move in relation to each other. For example if the underlying symbol is a 2x Gold ETF (meaning the ticker moves at 2x the spot price of gold---if gold goes up 3% this ticker should go up 6%) and the comparison symbol is an 2x inverse gold ETF (at gold up 3% this should move down 6%). If these ETFs were 100% accurate at tracking the price of gold then this tool would report a value of zero at all times.
Day 1
Ticker - $10
Comparison - $10
Day 2
Ticker - $12
Comp - $11
This tool value - |20%| + -|10%| = 10%
It uses a short simple moving average to smooth things out a bit (see inputs). It is important to keep your axis scale in mind when using this! Two symbols that are always near zero mean they are offsetting each other very well but the value displayed might range from 0 to 0.005, but the graphed area can make it look extreme if autoscaled.
This is a tool with very specific uses : comparing how one digital currency moves in relation to bitcoin's price, comparing how gold moves in relation to silver, etc.
Hawkeye Trend+StopsHawkeye Trend+Stops -- the tool that breathes with market condition
With Trend+Stops you get a true sense of the market trend rather than opinions from the financial media.
This powerful indicator tells you when a trend is commencing, in congestion and where the correct exit is. You’ll have the confidence to stay in a trend, a feat that proves difficult for most novice traders.
Trend+Stops is based on the Hawkeye Volume algorithm of pattern recognition and average true range. Using this tool will stop you from having "opinions" on market direction and allow you to take control of your trading.
Trend+Stops overcomes two of the biggest hurdles to successful trading:
Where the trend is at the given moment (and its momentum)
Where your stop exit should be
The Hawkeye Trend+Stops Indicator
One of the most difficult tasks in trading is to know when the market you are trading is in a trend, and when it is not. It is the correct selection of trades in trending markets that makes the difference between a profitable trade, and one that gets you stopped out with a loss.
The problem is that markets spend more time moving sideways than they do in a trend. Consequently many traders find themselves in a trade they believe is the start of a trend, only to discover that the market moved sideways, with the position being closed out at a loss. This is the single most frustrating part of trading, and it accounts for more traders making overall losses on their account than any other factor -- Hawkeye Trend+Stops
Spread Close & SMA200 & Less EMA200Simple Oscillator showing Price relative to a 200-Day SMA and 200-Day EMA