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