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.
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 .
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...
SniperTrading permite detectar los momentos exactos de compra y venta obteniendo un buen rendimiento.
* Realice una compra cuando el indicador de COMPRA aparezca en la pantalla.
* Realice una venta cuando el indicador de VENTA aparezca en la pantalla.
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...
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...
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.