Pairs trading using hedge ratio. Firstly, it calculates hedge ration using OLS linear regression. Then it calculates spread and z-score of spread. if spread in specific range (which it's possible to change in settings) it makes Long/Short orders. The very basic script.
This is combination of multiple indicators and strategies. Mainly useful for indexes and to time the entry and exits of indexes. No stoploss used - makes it less desirable for leveraged trades or trading individual stocks. Let us rewind and look back at some of the indicators/strategies published earlier. 1. Moving Average Candles - this is one of my favourite...
This idea came up while discussing about strategies with one of the trading enthusiast from tradingview community. Strategy basically uses existing script of Vix Fix by Chris Moody: VixFix is a great indicator for finding the market bottoms. But, sometimes it generates signal too early. But, we can apply linear regression on vix fix to find vix fix top to make...
Following the introduction of the Moving Regression Prediction Bands indicator (see link below), I'd like to propose how to utilize it in a simple band breakout strategy : Go long after the candle closes above the upper band . The lower band (alternatively, the lower band minus the 14-period ATR or the central line ) will serve as a support line . ...
For my first foray into pine script I took the code from the generic "Consecutive up/down" and flipped the logic. I added a linear regression filter to try and stay with the overall trend. ATR added for visual, I eventually want to use it as part of the money management. Rules to open trade or close the opposite: IF the linear regression slope is >=0 AND the...
To be clear I'm using the code from Richard Santos for the functional polynomial regression. I really loved his script idea (given that I'm into linear regression myself). I took his code and made a strategy which applies to bitcoin on the 5 minute chart (but you could adjust this for any asset), and you could make this work on anytime frame by adjusting the...
script serves as an example how we can close trades at end of day. can be session controlled or the time controlled. the session should be adjusted to be earlier than the candle time.
Pair trade for crypto with inputs: * length of correlation and moving average * trade pair * spread threshold to enter long / short * spread threshold to exit long / short
Pair trade with inputs: * length of correlation and moving average * trade pair * spread threshold to enter long / short * spread threshold to exit long / short
This script takes advantage of the Pearson's R attribute of the data set you provide. Pearson's R attempts to find how correlated data is with a potential pattern. If the number is negative the correlation is upwards . If it's positive the correlation is downwards . Pearson's R can only be a number between -1 and 1. It should be impossible to ever...
Thanks to HPotter for the code I based this strategy on. Center of Gravity calculation is based here on a linear regression function using the least squares method. We use this to calculate a channel consisting of 2 lines, green and red on the chart This strategy employs a dynamic stop loss function that measures stop loss placement based on recent ATR. How...
SniperTrading permite detectar los momentos exactos de compra y venta obteniendo un buen rendimiento. Como aplicarlo: * Realice una compra cuando el indicador de COMPRA aparezca en la pantalla. * Realice una venta cuando el indicador de VENTA aparezca en la pantalla.
A Strategy with Backtest and Trailing Stop for Long/Short Credits: Study by RafaelZioni - Thanks buddy!