@MoreFunn those scans cannot be modified but have a look at the counter studies in post#3; perhaps one of them can help you?
Hi MerryDay,
I got the study below from this forum but I can't find who created it. I like it because it only shows the 8, 9 and 13 values. I have been trying to get labels to show when the above values occur but I can't figure it out. Could you provide some guidance?
Thank you in advance!!!
DeMark Buy Sell Alerts"
# seqcnt_00
def na = double.nan;
def t1 = SequenceCounter()."Buy Formation";
def t2 = SequenceCounter()."Sell Formation";
def t3 = SequenceCounter()."Buy Array";
def t4 = SequenceCounter()."Sell Array";
def t5 = SequenceCounter()."Perfect Buy";
def t6 = SequenceCounter()."Perfect Sell";
def t7 = SequenceCounter()."Perfect Array Buy";
def t8 = SequenceCounter()."Perfect Array Sell";
input show_test_labels = no;
addlabel(show_test_labels , "seq1 " + t1, color.cyan);
addlabel(show_test_labels , "seq2 " + t2, color.cyan);
addlabel(show_test_labels , "seq3 " + t3, color.cyan);
addlabel(show_test_labels , "seq4 " + t4, color.cyan);
addlabel(show_test_labels , "seq5 " + t5, color.cyan);
addlabel(show_test_labels , "seq6 " + t6, color.cyan);
addlabel(show_test_labels , "seq7 " + t7, color.cyan);
addlabel(show_test_labels , "seq8 " + t8, color.cyan);
# t1 - lower white
# t2 - upper white
# t3 - lower red
# t4 - uper red
# keep 8, 9, and 13 , ignore other numbers
plot u1 = if t1 == 8 or t1 == 9 or t1 == 13 then t1 else na;
plot u2 = if t2 == 8 or t2 == 9 or t2 == 13 then t2 else na;
plot u3 = if t3 == 8 or t3 == 9 or t3 == 13 then t3 else na;
plot u4 = if t4 == 8 or t4 == 9 or t4 == 13 then t4 else na;
u1.SetPaintingStrategy(PaintingStrategy.VALUES_below);
u1.SetDefaultColor(Color.white);
u1.hidebubble();
u2.SetPaintingStrategy(PaintingStrategy.VALUES_above);
u2.SetDefaultColor(Color.white);
u2.hidebubble();
u3.SetPaintingStrategy(PaintingStrategy.VALUES_below);
u3.SetDefaultColor(Color.red);
u3.hidebubble();
u4.SetPaintingStrategy(PaintingStrategy.VALUES_above);
u4.SetDefaultColor(Color.red);
u4.hidebubble();
# LABELS
# Array
def BuyArray_13 = SequenceCounter()."Buy Array";
def SellArray_13 = SequenceCounter()."Sell Array";
def BuyArray = BuyArray_13 == 13;
def SellArray = SellArray_13 == 13;
AddLabel(BuyArray or SellArray, "DM.Array:13", If BuyArray then Color.DARK_GREEN else if SellArray then Color.RED else Color.Gray);
Alert(BuyArray, "BUY Array =13",Alert.BAR,Sound.Chimes);
Alert(SellArray, "SELL Array=13",Alert.BAR,Sound.Ding);
# Formation
def BuyFormation_9 = SequenceCounter()."Buy Formation";
def SellFormation_9 = SequenceCounter()."Sell Formation";
def BuyFormation = BuyFormation_9 == 9;
def SellFormation = SellFormation_9 == 9;
AddLabel(BuyFormation or SellFormation, "DM.Formation:9", If BuyFormation then Color.LIGHT_GREEN else if SellFormation then Color.MAGENTA else Color.Gray);
Alert(BuyFormation,"BUY Formation =9",Alert.BAR,Sound.Chimes);
Alert(SellFormation,"SELL Formation =9",Alert.BAR,Sound.Ding);
# Create a label that displays when a 9 or 13 is generated, with color coding
AddLabel(yes, if BuyArray then "DM:A.13" else if SellArray then "DM:A.13" else if BuyFormation then "DM:F.9" else if SellFormation then "DM:F.9" else "",
if BuyArray then Color.DARK_GREEN else if BuyFormation then Color.LIGHT_GREEN else if SellArray then Color.RED else if SellFormation then Color.MAGENTA else Color.GRAY);
# Create a label that displays when a 9 or 13 is generated, with color coding
AddLabel(yes, if BuyArray or BuyFormation then "9 or 13 BUY" else if SellArray or SellFormation then "9 or 13 SELL" else "",
if BuyArray then Color.LIGHT_GREEN else if BuyFormation then Color.GREEN else if SellArray then Color.PINK else if SellFormation then Color.MAGENTA else Color.GRAY);
# SequenceCounter
#
https://tlc.thinkorswim.com/center/reference/Tech-Indicators/studies-library/R-S/SequenceCounter
# plots
# Buy Formation Consists of "formation period" consecutive bars with: Close < Close[4 bars ago].
# Sell Formation Consists of "formation period" consecutive bars with: Close > Close[4 bars ago].
# Buy Array Displays "array period" bars satisfying the condition: Close <= Low[2 bars ago]
# Sell Array Displays "array period" bars satisfying the condition: Close >= High[2 bars ago]
# Perfect Buy Buy signals for Formation patterns meeting perfection criteria.
# Perfect Sell Sell signals for Formation patterns meeting perfection criteria.
# Perfect Array Buy Buy signals for Array patterns meeting perfection criteria.
# Perfect Array Sell Sell signals for Array patterns meeting perfection criteria.
#