Hurst scanner with 200sma filter

drkellog

Member
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 member
Staff
VIP
Lifetime
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 member
Staff
VIP
Lifetime
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 member
Staff
VIP
Lifetime
@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.
 
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

Member
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

The Market Trading Game Changer

Join 2,500+ subscribers inside the useThinkScript VIP Membership Club
  • Exclusive indicators
  • Proven strategies & setups
  • Private Discord community
  • ‘Buy The Dip’ signal alerts
  • Exclusive members-only content
  • Add-ons and resources
  • 1 full year of unlimited support

Frequently Asked Questions

What is useThinkScript?

useThinkScript is the #1 community of stock market investors using indicators and other tools to power their trading strategies. Traders of all skill levels use our forums to learn about scripting and indicators, help each other, and discover new ways to gain an edge in the markets.

How do I get started?

We get it. Our forum can be intimidating, if not overwhelming. With thousands of topics, tens of thousands of posts, our community has created an incredibly deep knowledge base for stock traders. No one can ever exhaust every resource provided on our site.

If you are new, or just looking for guidance, here are some helpful links to get you started.

What are the benefits of VIP Membership?
VIP members get exclusive access to these proven and tested premium indicators: Buy the Dip, Advanced Market Moves 2.0, Take Profit, and Volatility Trading Range. In addition, VIP members get access to over 50 VIP-only custom indicators, add-ons, and strategies, private VIP-only forums, private Discord channel to discuss trades and strategies in real-time, customer support, trade alerts, and much more. Learn all about VIP membership here.
How can I access the premium indicators?
To access the premium indicators, which are plug and play ready, sign up for VIP membership here.
Top