Hurst scanner with 200sma filter

drkellog

New member
VIP
Can anyone take my code and adjust it into a scanner please?
I only take trades when the hurst is triggered and it is ABOVE the 200sma for longs. For shorts its just the opposite.
This study can make you a lot of money when used properly. Never go long if a stock is below the 200sma. And never go short if a stock is above the 200sma. This works well on 5min to 1hr charts. Some symbols require you tweak the settings a little. I did not create this study I just edited it to my specifications. Thank you.


here is the study..................

Code:
declare lower;

input price = hl2;
input length = 10;
input InnerValue = 1.6;
input OuterValue = 2.6;
input ExtremeValue = 4.2;

def displacement = (-length / 2) + 1;
def dPrice = price[displacement];

rec CMA = if !IsNaN(dPrice) then Average(dPrice, AbsValue(length)) else CMA[1] + (CMA[1] - CMA[2]);

#Rev 2: improved FlowPrice for better extremes
#def OscValue = if close > close[1] then high else if close < close[1] then low else (high + low)/2;
def OscValue =
if high >= high[1] and low <= low[1]
then
if close >= close[1] # high >= high[2]
then high
else low
else
if high > high[1]
then high
else
if low < low[1]
then low
else
if close > close[1]
then high
else
if close < close[1]
then low
else (high + low) / 2;

plot HurstOsc = (100 * OscValue / CMA) - 100;

HurstOsc.SetDefaultColor(GetColor(1));
HurstOsc.SetLineWeight(2);

plot CenterLine = 0;
plot UpperExtremeBand = ExtremeValue;
plot LowerExtremeBand = - ExtremeValue;
plot UpperOuterBand = OuterValue;
plot LowerOuterBand = - OuterValue;
plot UpperInnerBand = InnerValue;
plot LowerInnerBand = - InnerValue;

CenterLine.SetDefaultColor(GetColor(7));
CenterLine.SetLineWeight(1);

UpperExtremeBand.SetDefaultColor(GetColor(4));
UpperExtremeBand.SetLineWeight(1);
LowerExtremeBand.SetDefaultColor(GetColor(4));
LowerExtremeBand.SetLineWeight(1);
UpperExtremeBand.hide();
LowerExtremeBand.hide();

UpperOuterBand.SetDefaultColor(GetColor(5));
UpperOuterBand.SetLineWeight(1);
LowerOuterBand.SetDefaultColor(GetColor(6));
LowerOuterBand.SetLineWeight(1);

UpperInnerBand.SetDefaultColor(GetColor(5));
UpperInnerBand.SetLineWeight(1);
UpperInnerBand.SetStyle(Curve.SHORT_DASH);
LowerInnerBand.SetDefaultColor(GetColor(6));
LowerInnerBand.SetLineWeight(1);
LowerInnerBand.SetStyle(Curve.SHORT_DASH);

# Turn AddClouds off by putting a #-sign at the first position of the lines
AddCloud(UpperOuterBand, UpperInnerBand, color.red);
AddCloud(LowerInnerBand, LowerOuterBand, color.green);
Alert(HurstOsc <= -2.6, "DK LOOK!!!!!!", Alert.BAR, Sound.RING);

# --- script end ----
 
Last edited by a moderator:

BenTen

Administrative
Staff
VIP
Scanning for stocks above the 200 SMA is easy. You stated, "I only take trades when the hurst is triggered." Define that condition so we can help you add it to your scanner.
 

BenTen

Administrative
Staff
VIP
Your first condition:

3zBHGPr.png


Your second condition:

iOgrgf9.png


Now your scanner should look something like this:

6P8R4Aj.png


Make sure to change the length of the SMA to 200 when setting up the condition.
 

BenTen

Administrative
Staff
VIP
@drkellog I didn't actually save it as a scanner because I don't use it. If you follow the instructions provided, you should be able to set it up. If you run into any issues while doing so, please post it here and we'll help.
 

poststreet

Member
VIP
dr kellog could you give us an example? thanks i scrolled through about 100 sp stocks on a five minute chart, with the hurst indi, could not find an instance when the hurst went below -2.6
 

drkellog

New member
VIP
dr kellog could you give us an example? thanks i scrolled through about 100 sp stocks on a five minute chart, with the hurst indi, could not find an instance when the hurst went below -2.6
Look at $TSLA on September 24, 2020 at 8:35am. Note: must be 5 min chart. Also, just because it is below the -2.6 that is not your entry. It is only a trigger. Once you have a trigger you must use price action for your entry after you have your trigger. Say the following 5 min candle that takes out the previous 5 min candle high. Always backtest before trying new trading strategies. Every stock behaves differently. Be familiar with the stock you are trading.
 

Similar threads

Top