Bollinger Band/Stochastic Momentum Index or RSI scan


New member
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?

# 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;


Well-known member
I'm sure you could work something up to see if it gives the results you desire... You have the vision so try bringing it to reality... That's how we all learn whether our ideas are worthwhile or not... Well, other than those who always expect others to do all of there coding for them rather than learning to help themselves... You've got your blueprint there so give it a go... We'll help you along...


Well-known member
ok thanks
you can indivitually add each study using the wizard and customize it to your liking, the study you posted is just 2 studies in 1 scan. you can manually do this via the wizard as you desire and just add or remove whatever studies and settings you want. look on youtube on tutorrial on how to use the wizard.
here is a thorough video

Similar threads