1 Min Hook 1 Min Squeeze

gochristian1

New member
I have this 1 min hook and 1 min squeeze I created to add to my watchlist but can't seem to know what I can use this for? what would you make of it and how would you use it. It counts on my watchlist so I want to deterimine the best way to use this counter.

1 Min Squeeze:
def lookback = 250;

def ResultUpperBand =
BollingerBands(CLOSE,0,lookback,-0.5,0.5,AverageType.SIMPLE).UpperBand;

def ResultLowerBand =
BollingerBands(CLOSE,0,lookback,-0.5,0.5,AverageType.SIMPLE).LowerBand;

def KCupper =
KeltnerChannels(0,1.5,250,CLOSE,AverageType.SIMPLE,AverageType.SIMPLE).Upper_Band;
def KClower =
KeltnerChannels(0,1.5,250,CLOSE,AverageType.SIMPLE,AverageType.SIMPLE).Lower_Band;

def top=if ResultUpperBAnd[0]<KCupper[0] then KCupper[0] else close;
def bottom=if ResultLowerBAnd[0]>KClower[0] then KClower[0] else close;

AddLabel(YES,if top<>bottom then Round(1,0) else Round(0,0),Color.WHITE);

1 Min Hook:
def lookback = 250;

plot ResultUpperBand = BollingerBands(CLOSE,0,lookback,-0.5,0.5,AverageType.SIMPLE).UpperBAnd;
ResultUpperBand.AssignValueColor(Color.YELLOW);

plot ResultLowerBand = BollingerBands(CLOSE,0,lookback,-0.5,0.5,AverageType.SIMPLE).LowerBand;
ResultLowerBand.AssignValueColor(Color.CYAN);

def HookUp = fold i = 0 to 480 with # was 40
Hup=-1
while Hup==-1 do
if GetValue(close,i,0)>=GetValue(ResultUpperBand,i,0) then -1 else i;
#AddLabel(YES,HookUp,color.GREEN);

def HookDn = fold j = 0 to 480 with # was 40
Hdn=-1
while Hdn==-1 do
if GetValue(close,j,0)<GetValue(ResultUpperBand,j,0) then -1 else j;
#AddLabel(YES,HookDn,color.RED);

AddLabel(YES,
If HookUp>0 then If HookUp<=9 then "0"+HookUp else ""+HookUp else If HookDn>0 then
If HookDn<=9 then "-0"+HookDn else "-"+HookDn else "0",
If HookUp>0 then color.GREEN else If HookDn>0 then color.RED else color.BLACK);

#Alert(HookUp==1,"Long",Alert.TICK,Sound.Chimes);
#Alert(HookDn==-1,"Short",Alert.TICK,Sound.Ding);


#def Result = 1;
#AddLabel(YES,If close>=ResultUpperBand then "><<>>>" else "Short",
#If Result>=0 then Color.GREEN else Color.RED);
#AddLabel(YES,If Result>=0 then "><><<>>" else "Short",
#If Result>=0 then Color.GREEN else Color.RED);


#AssignBackGroundColor(
#if result>=1.0 then Color.Dark_Green else
#if result<=-1.0 then Color.Dark_Red else Color.Black
#);


#def lrc = LinearRegCurve(0,8,CLOSE);

#def HookUp = fold i = 0 to 40 with
#Hup=0
#while Hup==0 do
#if GetValue(lrc,i+2,0)<GetValue(lrc,i+3,0) and GetValue(lrc,i+1,0)>GetValue(lrc,i+2,0) then i else 0;

#def HookDn = fold j = 0 to 40 with
#Hdn=0
#while Hdn==0 do
#if GetValue(lrc,j+2,0)>GetValue(lrc,j+3,0) and GetValue(lrc,j+1,0)<GetValue(lrc,j+2,0) then j else 0;
#AddLabel(yes, HookUp+"/"+Hookdn);


#def NextHigh = fold i = 0 to 40 with price = Double.NaN while IsNaN(price) do if getValue(high, -i, -99) > 40 then getValue(high, -i, -99) else Double.NaN;

#AddLabel(yes, NextHigh);


#plot result=hookup-hookdn;
#AddLabel(yes, if result>0 then "hkUP" else if result<0 then "hkDN" else " ", if result>0 then Color.GREEN else if result<0 then Color.RED else Color.BLACK);


# empty place holder in the column


#AddLabel(yes, if result > 0 then "HkUp" else "HkDn", if result > 0 then Color.GREEN else Color.RED );
 
I have this 1 min hook and 1 min squeeze I created to add to my watchlist but can't seem to know what I can use this for? what would you make of it and how would you use it. It counts on my watchlist so I want to deterimine the best way to use this counter.

1 Min Squeeze:
def lookback = 250;

def ResultUpperBand =
BollingerBands(CLOSE,0,lookback,-0.5,0.5,AverageType.SIMPLE).UpperBand;

def ResultLowerBand =
BollingerBands(CLOSE,0,lookback,-0.5,0.5,AverageType.SIMPLE).LowerBand;

def KCupper =
KeltnerChannels(0,1.5,250,CLOSE,AverageType.SIMPLE,AverageType.SIMPLE).Upper_Band;
def KClower =
KeltnerChannels(0,1.5,250,CLOSE,AverageType.SIMPLE,AverageType.SIMPLE).Lower_Band;

def top=if ResultUpperBAnd[0]<KCupper[0] then KCupper[0] else close;
def bottom=if ResultLowerBAnd[0]>KClower[0] then KClower[0] else close;

AddLabel(YES,if top<>bottom then Round(1,0) else Round(0,0),Color.WHITE);

1 Min Hook:
def lookback = 250;

plot ResultUpperBand = BollingerBands(CLOSE,0,lookback,-0.5,0.5,AverageType.SIMPLE).UpperBAnd;
ResultUpperBand.AssignValueColor(Color.YELLOW);

plot ResultLowerBand = BollingerBands(CLOSE,0,lookback,-0.5,0.5,AverageType.SIMPLE).LowerBand;
ResultLowerBand.AssignValueColor(Color.CYAN);

def HookUp = fold i = 0 to 480 with # was 40
Hup=-1
while Hup==-1 do
if GetValue(close,i,0)>=GetValue(ResultUpperBand,i,0) then -1 else i;
#AddLabel(YES,HookUp,color.GREEN);

def HookDn = fold j = 0 to 480 with # was 40
Hdn=-1
while Hdn==-1 do
if GetValue(close,j,0)<GetValue(ResultUpperBand,j,0) then -1 else j;
#AddLabel(YES,HookDn,color.RED);

AddLabel(YES,
If HookUp>0 then If HookUp<=9 then "0"+HookUp else ""+HookUp else If HookDn>0 then
If HookDn<=9 then "-0"+HookDn else "-"+HookDn else "0",
If HookUp>0 then color.GREEN else If HookDn>0 then color.RED else color.BLACK);

#Alert(HookUp==1,"Long",Alert.TICK,Sound.Chimes);
#Alert(HookDn==-1,"Short",Alert.TICK,Sound.Ding);


#def Result = 1;
#AddLabel(YES,If close>=ResultUpperBand then "><<>>>" else "Short",
#If Result>=0 then Color.GREEN else Color.RED);
#AddLabel(YES,If Result>=0 then "><><<>>" else "Short",
#If Result>=0 then Color.GREEN else Color.RED);


#AssignBackGroundColor(
#if result>=1.0 then Color.Dark_Green else
#if result<=-1.0 then Color.Dark_Red else Color.Black
#);


#def lrc = LinearRegCurve(0,8,CLOSE);

#def HookUp = fold i = 0 to 40 with
#Hup=0
#while Hup==0 do
#if GetValue(lrc,i+2,0)<GetValue(lrc,i+3,0) and GetValue(lrc,i+1,0)>GetValue(lrc,i+2,0) then i else 0;

#def HookDn = fold j = 0 to 40 with
#Hdn=0
#while Hdn==0 do
#if GetValue(lrc,j+2,0)>GetValue(lrc,j+3,0) and GetValue(lrc,j+1,0)<GetValue(lrc,j+2,0) then j else 0;
#AddLabel(yes, HookUp+"/"+Hookdn);


#def NextHigh = fold i = 0 to 40 with price = Double.NaN while IsNaN(price) do if getValue(high, -i, -99) > 40 then getValue(high, -i, -99) else Double.NaN;

#AddLabel(yes, NextHigh);


#plot result=hookup-hookdn;
#AddLabel(yes, if result>0 then "hkUP" else if result<0 then "hkDN" else " ", if result>0 then Color.GREEN else if result<0 then Color.RED else Color.BLACK);


# empty place holder in the column


#AddLabel(yes, if result > 0 then "HkUp" else "HkDn", if result > 0 then Color.GREEN else Color.RED );


...what to use it for? nobody here can answer that.
why would you make something, if you don't have a purpose for it?

if you have a question on HOW to program something, post it.

the hook study counts back to when close was above or below an upper bollinger band.
 

Join useThinkScript to post your question to a community of 21,000+ developers and traders.

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

87k+ Posts
306 Online
Create Post

Similar threads

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.
Back
Top