Hi Guys,
I'm currently using the below scan which uses Bollinger Bands and Stochastics to find new entries for a mean reversion strategy I currently use.
I don't know where to start and would appreciate it if someone more knowledgeable would be able to assist with a few changes I wanted to make so I can test which one I wanted to use.
If possible can you replace the stochastic elements with RSI (7, 70,40) and/or SMI?
I'm currently using the below scan which uses Bollinger Bands and Stochastics to find new entries for a mean reversion strategy I currently use.
I don't know where to start and would appreciate it if someone more knowledgeable would be able to assist with a few changes I wanted to make so I can test which one I wanted to use.
If possible can you replace the stochastic elements with RSI (7, 70,40) and/or SMI?
Code:
# Candle setup buffer
input trueBuffer = 3;
# General conditions
def averageVolumeCondition = Average(volume, 60) > 150000;
def minimumPriceCondition = close >100;
# StochasticsFull settings
input priceH = high;
input priceL = low;
input priceC = close;
input stochOverbought = 80;
input stochOversold = 20;
input stochKPeriod = 5;
input stochDPeriod = 3;
input stochSlowingPeriod = 3;
input stochAverageType = AverageType.EXPONENTIAL;
# BBands settings
input bbLength = 20;
input bbStandardDeviation = 2;
input bbAverageType = AverageType.EXPONENTIAL;
def FullK = StochasticFull(stochOverbought, stochOversold, stochKPeriod, stochDPeriod, priceH, priceL, priceC, stochSlowingPeriod, stochAverageType).FullK;
def FullD = StochasticFull(stochOverbought, stochOversold, stochKPeriod, stochDPeriod, priceH, priceL, priceC, stochSlowingPeriod, stochAverageType).FullD;
# Indicators Conditions
def isPriceCutBBLowerBand = (priceL is less than BollingerBands("length" = bbLength, "num dev dn" = -bbStandardDeviation, "num dev up" = bbStandardDeviation, "average type" = bbAverageType).LowerBand) is true within trueBuffer bars;
def isStochOversold = (lowest(FullK, trueBuffer) < stochOversold) or (lowest(FullD, trueBuffer) < stochOversold);
def isStochCrossover = (FullK > FullD);
# Oversold based on conditions
plot scan = minimumPriceCondition and averageVolumeCondition and isPriceCutBBLowerBand and isStochOversold and isStochCrossover;