"Candle State" Bar Type Identification :: TheStrat For ThinkOrSwim

I am running Heikin Ashi candles. Should I be using candle trend?
Okay, that's your problem. I changed my chart to Heikin Ashi and the candle at 12:50 changed its shape. Not sure why but it did. If you use regular candles your chart should appear as mine does. Interesting.
 
Okay, that's your problem. I changed my chart to Heikin Ashi and the candle at 12:50 changed its shape. Not sure why but it did. If you use regular candles your chart should appear as mine does. Interesting.
I really appreciate your help. I am used to using Heikin Ashi so didn't think about that when I switched to using TheStrat. When I change to regular candles I get what you have. Seems the HA candles tend to drag out the reds and greens a little longer. Doesn't help much with TheStrat. Thanks much...
 
@Mandalorianknight63 @Pelonsax When I run this script I am getting 2's that should be 1's and 3's that should be 2's. Tried a few different versions of scripts to label the candles 1, 2, or3 for TheStrat and getting this same false reporting. This occurred several times in todays AAPL charting (9/8/2020) for 1 minute and 5 minute charts. Any ideas on what is causing this anomaly. Thanks, Walk.
This isn't my thread bro. This is: https://usethinkscript.com/threads/rob-smiths-the-strat-indicator-for-thinkorswim.3312/
 
I am running Heikin Ashi candles. Should I be using candle trend?
Heiken-Ashi candles.... I can see where the label wouldn't match up. Heiken-Ashi will show averages and general trends. The numbers here are based on high/low for that traditional candle, not the average of 2 days candles like Heiken-Ashi will show you. Heiken-Ashi values are all calculated. Heiken-Ashi could look like a 2 down but the traditional candle might be a 1 or a 3, easily.
 
@OBW Thank you for this Scrip, This is great! Is it possible to custom color the numbers that appear below candles? IE; 1 yellow, 2 blue, 3 white or something like that... Thanks again!
 
@Mandalorianknight63
Code:
# +------------------------------------------------------------+
# |         Example code to print values below candles         |
# |                        Robert Payne                        |
# |               https://funwiththinkscript.com               |
# +------------------------------------------------------------+
def insideBar = high < high[1] and low > low[1];
def outsideBar = high > high[1] and low < low[1];
plot barType = if insideBar then 1 else if outsideBar then 3 else double.NaN;
barType.SetPaintingStrategy(PaintingStrategy.VALUES_BELOW);
Hello, jeez and here I took all the time learning these so that I could recognize them. Ha! @MerryDay can you confirm this script is the latest one. Thank you!
 
Hello, jeez and here I took all the time learning these so that I could recognize them. Ha! @MerryDay can you confirm this script is the latest one. Thank you!
If you are asking has the definition of inside bar and outside bar changed since the early 1900's, the answer would be no :)
If you are asking how members identify inside and out bars on charts, this is just one of many many scripts. There is not just one "updated" version. These four threads contain most of the flavors available on the forum:
https://usethinkscript.com/tags/inside/
 
Hello everyone, love this community and scroll through the website countless times throughout the day. Thanks to everyone who makes this possible. I was wondering if its possible to have an indicator plot only during regular trading hours. I use the strat but find the numbers kind of distracting in the premarket so if someone could help me where the indicator will plot the numbers ONLY during regular trading hours that would be so fantastic. Thank you.
Code:
# +------------------------------------------------------------+
# |         Example code to print values below candles         |
# |                        Robert Payne                        |
# |               https://funwiththinkscript.com               |
# +------------------------------------------------------------+
def H = high;
def L = low;
def C = close;
def O = open;


def insideBar =  (H < H[1] and L > L[1]) or (H == H[1] and L > L[1]) or (H < H[1] and L == L[1]) or (H == H[1] and L == L[1]);
def outsideBar = H  > H[1] and L <  L[1];
plot barType1 = if insideBar then 1 else double.nan;
barType1.SetPaintingStrategy(PaintingStrategy.VALUES_ABOVE);

plot barType2 = if outsideBar then 3 else double.nan;

barType2.SetPaintingStrategy(PaintingStrategy.VALUES_BELOW);
 
Hello everyone, love this community and scroll through the website countless times throughout the day. Thanks to everyone who makes this possible. I was wondering if its possible to have an indicator plot only during regular trading hours. I use the strat but find the numbers kind of distracting in the premarket so if someone could help me where the indicator will plot the numbers ONLY during regular trading hours that would be so fantastic. Thank you.
Code:
# +------------------------------------------------------------+
# |         Example code to print values below candles         |
# |                        Robert Payne                        |
# |               https://funwiththinkscript.com               |
# +------------------------------------------------------------+
def H = high;
def L = low;
def C = close;
def O = open;


def insideBar =  (H < H[1] and L > L[1]) or (H == H[1] and L > L[1]) or (H < H[1] and L == L[1]) or (H == H[1] and L == L[1]);
def outsideBar = H  > H[1] and L <  L[1];
plot barType1 = if insideBar then 1 else double.nan;
barType1.SetPaintingStrategy(PaintingStrategy.VALUES_ABOVE);

plot barType2 = if outsideBar then 3 else double.nan;

barType2.SetPaintingStrategy(PaintingStrategy.VALUES_BELOW);

This should help

Ruby:
# +------------------------------------------------------------+
# |         Example code to print values below candles         |
# |                        Robert Payne                        |
# |               https://funwiththinkscript.com               |
# +------------------------------------------------------------+
def H = high;
def L = low;
def C = close;
def O = open;
input start = 0930;
input end   = 1600;

def rth = secondsfromTime(start) >= 0 and secondstillTime(end)>0;

def insideBar =  (H < H[1] and L > L[1]) or (H == H[1] and L > L[1]) or (H < H[1] and L == L[1]) or (H == H[1] and L == L[1]);
def outsideBar = H  > H[1] and L <  L[1];
plot barType1 = if rth and insideBar then 1 else double.nan;
barType1.SetPaintingStrategy(PaintingStrategy.VALUES_ABOVE);

plot barType2 = if rth and outsideBar then 3 else double.nan;

barType2.SetPaintingStrategy(PaintingStrategy.VALUES_BELOW);
 
This is my version of TheStrat. Very powerful indicator. Enjoy.

Python:
# ########################################
# The Strat
# Created by @rewardiaz
# Shows inside, directional, and outside bars
# ########################################

# Global inputs
input useAlerts = yes;
input alertType = Alert.BAR;
input buySound = Sound.DING;
input sellSound = Sound.DING;
input Show_Strat_Numbers = yes;
input Last_Bars = 10;
input Show_Twos = no;

# Basic conditions
def na = Double.NaN;
def o = open;
def c = close;
def l = low;
def h = high;
def en = (!IsNaN(c) and IsNaN(c[-Last_Bars]));
def IsUp = c > o;
def IsDown = c < o;

# Chart coloring
DefineGlobalColor("rising", CreateColor(0, 165, 0));
DefineGlobalColor("bear", CreateColor(225, 0, 0));
DefineGlobalColor("neutral", Color.dark_orange);

# ########################################
# Bar type identification for TheStrat
def highPrev = h[1];
def lowPrev = l[1];

# Inside Bar: Current high < previous high and current low > previous low
def isInside = (h <= highPrev and l >= lowPrev);

# Directional Bar Up: Current high > previous high and current low > previous low
def isDirectionalUp = h > highPrev and l > lowPrev;

# Directional Bar Down: Current high < previous high and current low < previous low
def isDirectionalDown = h < highPrev and l < lowPrev;

# Outside Bar: Current high > previous high and current low < previous low
def isOutside = h > highPrev and l < lowPrev;

# Simplified Candle Type Encoding (1=Inside, 2=Up, -2=Down, 3=Outside)
def currentCandleType =
    if isInside then 1
    else if isOutside then 3
    else if isDirectionalUp then 2
    else if isDirectionalDown then -2
    else 0;

# ########################################
# Pattern Detection (Bullish and Bearish Reversal Patterns)

# 2-1-2 Continuation
def is212BullishContinuation = IsUp[3] && currentCandleType[2] == 2 and currentCandleType[1] == 1 and currentCandleType == 2;
def is212BearishContinuation = IsDown[3] && currentCandleType[2] == -2 and currentCandleType[1] == 1 and currentCandleType == -2;

# 2-1-2 Reversal
def is212BullishReversal = IsDown[3] && currentCandleType[2] == 2 and currentCandleType[1] == 1 and currentCandleType == 2;
def is212BearishReversal = IsUp[3] && currentCandleType[2] == -2 and currentCandleType[1] == 1 and currentCandleType == -2;

# 2-2 Continuation (Ensure it's exclusive from 2-1-2)
def is22BullishPattern = currentCandleType[1] == 2 and currentCandleType == 2;
def is22BearishPattern = currentCandleType[1] == -2 and currentCandleType == -2;

# 2-2 Reversals
def is22BullishReversal = IsDown[2] && currentCandleType[1] == -2 && currentCandleType == 2;
def is22BearishReversal = IsUp[2] && currentCandleType[1] == 2 && currentCandleType == -2;

# 1-3
def is13BullishReversal = currentCandleType[1] == 1 and currentCandleType == 3 && IsUp;
def is13BearishReversal = currentCandleType[1] == 1 and currentCandleType == 3 && IsDown;

# 3-1-2 Bullish / Bearish Reversal
def is312BullishPattern = IsDown[2] && currentCandleType[2] == 3 and currentCandleType[1] == 1 and currentCandleType == 2;
def is312BearishPattern = IsUp[2] && currentCandleType[2] == 3 and currentCandleType[1] == 1 and currentCandleType == -2;

# 2-1-1 Continuation (Directional, Inside, Inside)
def is211BullishContinuation = currentCandleType[2] == 2 and currentCandleType[1] == 1 and currentCandleType == 1;
def is211BearishContinuation = currentCandleType[2] == -2 and currentCandleType[1] == 1 and currentCandleType == 1;

# 2-1-1 Reversal (Directional followed by inside then opposite directional)
def is211BullishReversal = IsDown[3] && currentCandleType[2] == -2 and currentCandleType[1] == 1 and currentCandleType == 1;
def is211BearishReversal = IsUp[3] && currentCandleType[2] == 2 and currentCandleType[1] == 1 and currentCandleType == -2;

# 3-1-1 Reversal (Outside, Inside, then opposite directional)
def is311BullishReversal = IsDown[2] && currentCandleType[2] == 3 and currentCandleType[1] == 1 and currentCandleType == 2;
def is311BearishReversal = IsUp[2] && currentCandleType[2] == 3 and currentCandleType[1] == 1 and currentCandleType == -2;

# 3-2-1 Reversal (Outside, Directional, Inside)
def is321BullishReversal = IsUp[2] && currentCandleType[2] == 3 and currentCandleType[1] == 2 and currentCandleType == 1;
def is321BearishReversal = IsUp[2] && currentCandleType[2] == 3 and currentCandleType[1] == -2 and currentCandleType == 1;

# 1-2-1 Reversal (Inside, Directional, Inside)
def is121BullishReversal = currentCandleType[2] == 1 and currentCandleType[1] == 2 and currentCandleType == 1;
def is121BearishReversal = currentCandleType[2] == 1 and currentCandleType[1] == -2 and currentCandleType == 1;

# Match for other patterns (1-2-2, 3-2-2)
def is122BullishPattern = currentCandleType[2] == 1 and currentCandleType[1] == 2 and currentCandleType == 2;
def is122BearishPattern = currentCandleType[2] == 1 and currentCandleType[1] == -2 and currentCandleType == -2;
def is322BullishPattern = IsDown[2] && currentCandleType[2] == 3 and currentCandleType[1] == 2 and currentCandleType == 2;
def is322BearishPattern = IsUp[2] && currentCandleType[2] == 3 and currentCandleType[1] == -2 and currentCandleType == -2;

# ########################################
# Alerts based on detected patterns
def ActionPatterns =
    if is211BullishContinuation then 1 else
    if is211BearishContinuation then -1 else
    if is211BullishReversal then 2 else
    if is211BearishReversal then -2 else
    if is322BullishPattern then 4 else
    if is322BearishPattern then -4 else
    if is122BullishPattern then 5 else
    if is122BearishPattern then -5 else
    if is212BullishContinuation then 11 else
    if is212BearishContinuation then -11 else
    if is312BullishPattern then 10 else
    if is312BearishPattern then -10 else
    if is311BullishReversal then 12 else
    if is311BearishReversal then -12 else
    if is321BullishReversal then 13 else
    if is321BearishReversal then -13 else
    if is121BullishReversal then 14 else
    if is121BearishReversal then -14 else
    if is13BullishReversal then 15 else
    if is13BearishReversal then -15 else
    if is22BullishReversal then 16 else
    if is22BearishReversal then -16 else
    if is212BullishReversal then 17 else
    if is212BearishReversal then -17 else
0;

# Consolidated alert for both bullish and bearish patterns
Alert(useAlerts and ActionPatterns != 0, "Pattern Detected", alertType, if ActionPatterns > 0 then buySound else sellSound);

# ########################################
# Plot labels for the patterns

AddLabel(is211BullishContinuation, "2-1-1 Bullish Continuation", GlobalColor("rising"));
AddLabel(is211BearishContinuation, "2-1-1 Bearish Continuation", GlobalColor("bear"));
AddLabel(is211BullishReversal, "2-1-1 Bullish Reversal", GlobalColor("rising"));
AddLabel(is211BearishReversal, "2-1-1 Bearish Reversal", GlobalColor("bear"));
AddLabel(is212BullishContinuation, "2-1-2 Bullish Continuation", GlobalColor("rising"));
AddLabel(is212BearishContinuation, "2-1-2 Bearish Continuation", GlobalColor("bear"));
AddLabel(is212BullishReversal, "2-1-2 Bullish Reversal", GlobalColor("rising"));
AddLabel(is212BearishReversal, "2-1-2 Bearish Reversal", GlobalColor("bear"));
AddLabel(is312BullishPattern, "3-1-2 Bullish", GlobalColor("rising"));
AddLabel(is312BearishPattern, "3-1-2 Bearish", GlobalColor("bear"));
AddLabel(is311BullishReversal, "3-1-1 Bullish Reversal", GlobalColor("rising"));
AddLabel(is311BearishReversal, "3-1-1 Bearish Reversal", GlobalColor("bear"));
AddLabel(is321BullishReversal, "3-2-1 Bullish Reversal", GlobalColor("rising"));
AddLabel(is321BearishReversal, "3-2-1 Bearish Reversal", GlobalColor("bear"));
AddLabel(is121BullishReversal, "1-2-1 Bullish Reversal", GlobalColor("rising"));
AddLabel(is121BearishReversal, "1-2-1 Bearish Reversal", GlobalColor("bear"));
AddLabel(is322BullishPattern, "3-2-2 Bullish Reversal", GlobalColor("rising"));
AddLabel(is322BearishPattern, "3-2-2 Bearish Reversal", GlobalColor("bear"));
AddLabel(is122BullishPattern, "1-2-2 Bullish Reversal", GlobalColor("rising"));
AddLabel(is122BearishPattern, "1-2-2 Bearish Reversal", GlobalColor("bear"));
AddLabel(is13BullishReversal, "1-3 Bullish Reversal", GlobalColor("rising"));
AddLabel(is13BearishReversal, "1-3 Bearish Reversal", GlobalColor("bear"));
AddLabel(is22BullishReversal, "2-2 Bullish Reversal", GlobalColor("rising"));
AddLabel(is22BearishReversal, "2-2 Bearish Reversal", GlobalColor("bear"));
AddLabel(is22BullishPattern, "2-2 Bullish Continuation", GlobalColor("rising"));
AddLabel(is22BearishPattern, "2-2 Bearish Continuation", GlobalColor("bear"));

# Paint strat numbers only if enabled and valid candle type
plot barType =
    if !en then na
    else if !Show_Twos and AbsValue(currentCandleType) == 2 then na
    else if Show_Strat_Numbers and currentCandleType != 0 then AbsValue(currentCandleType)
    else na;
barType.SetPaintingStrategy(PaintingStrategy.VALUES_BELOW);
barType.AssignValueColor(Color.BLACK);
code did not work for tos..
 
code did not work for tos..

You did not provide enough information to say where you went astray.
Common errors are:
  1. You did not turn on the appropriate input in settings.
  2. The colors referenced in the study are not compatible with your chart defaults.
Here is a shared chart link http://tos.mx/!gmIk2hgS MUST follow these instructions for loading shared links.
This version has all the inputs turned on, and the study plots, which as shown in the image, as black numbers; will show as violet in the shared link; which will cater to the many dark-mode users.

eqimd0S.png
 
This is my version of TheStrat. Very powerful indicator. Enjoy.

mQ8GEJp.png


Inside, directional, and outside bars on a stock chart are candlestick patterns used to identify potential trend reversals or continuations.
  • "inside bars" signifying indecision or consolidation
  • "outside bars" indicate a potential breakout or breakdown, often signifying a shift in market momentum.
Traders typically look for these patterns near key support or resistance levels to determine potential entry points, considering the overall market context and direction of the breakout when making trading decisions

It's important to know that this strategy is most effective over longer timeframes. 1 hour and more (Best Day). The purpose of displaying all combinations with alerts is to alert me the direction we are heading in the past hour and take my entries below previous candle LOW or previous candle HIGH.

Example: Image attached.

Screenshot 2024-09-22 213600.png


Python:
# ########################################
# The Strat
# Created by @rewardiaz
# Shows inside, directional, and outside bars
# ########################################

# Global inputs
input useAlerts = yes;
input alertType = Alert.BAR;
input buySound = Sound.DING;
input sellSound = Sound.DING;
input Show_Strat_Numbers = yes;
input Last_Bars = 10;
input Show_Twos = no;

# Basic conditions
def na = Double.NaN;
def o = open;
def c = close;
def l = low;
def h = high;
def en = (!IsNaN(c) and IsNaN(c[-Last_Bars]));
def IsUp = c > o;
def IsDown = c < o;

# Chart coloring
DefineGlobalColor("rising", CreateColor(0, 165, 0));
DefineGlobalColor("bear", CreateColor(225, 0, 0));
DefineGlobalColor("neutral", Color.dark_orange);

# ########################################
# Bar type identification for TheStrat
def highPrev = h[1];
def lowPrev = l[1];

# Inside Bar: Current high < previous high and current low > previous low
def isInside = (h <= highPrev and l >= lowPrev);

# Directional Bar Up: Current high > previous high and current low > previous low
def isDirectionalUp = h > highPrev and l > lowPrev;

# Directional Bar Down: Current high < previous high and current low < previous low
def isDirectionalDown = h < highPrev and l < lowPrev;

# Outside Bar: Current high > previous high and current low < previous low
def isOutside = h > highPrev and l < lowPrev;

# Simplified Candle Type Encoding (1=Inside, 2=Up, -2=Down, 3=Outside)
def currentCandleType =
    if isInside then 1
    else if isOutside then 3
    else if isDirectionalUp then 2
    else if isDirectionalDown then -2
    else 0;

# ########################################
# Pattern Detection (Bullish and Bearish Reversal Patterns)

# 2-1-2 Continuation
def is212BullishContinuation = IsUp[3] && currentCandleType[2] == 2 and currentCandleType[1] == 1 and currentCandleType == 2;
def is212BearishContinuation = IsDown[3] && currentCandleType[2] == -2 and currentCandleType[1] == 1 and currentCandleType == -2;

# 2-1-2 Reversal
def is212BullishReversal = IsDown[3] && currentCandleType[2] == 2 and currentCandleType[1] == 1 and currentCandleType == 2;
def is212BearishReversal = IsUp[3] && currentCandleType[2] == -2 and currentCandleType[1] == 1 and currentCandleType == -2;

# 2-2 Continuation (Ensure it's exclusive from 2-1-2)
def is22BullishPattern = currentCandleType[1] == 2 and currentCandleType == 2;
def is22BearishPattern = currentCandleType[1] == -2 and currentCandleType == -2;

# 2-2 Reversals
def is22BullishReversal = IsDown[2] && currentCandleType[1] == -2 && currentCandleType == 2;
def is22BearishReversal = IsUp[2] && currentCandleType[1] == 2 && currentCandleType == -2;

# 1-3
def is13BullishReversal = currentCandleType[1] == 1 and currentCandleType == 3 && IsUp;
def is13BearishReversal = currentCandleType[1] == 1 and currentCandleType == 3 && IsDown;

# 3-1-2 Bullish / Bearish Reversal
def is312BullishPattern = IsDown[2] && currentCandleType[2] == 3 and currentCandleType[1] == 1 and currentCandleType == 2;
def is312BearishPattern = IsUp[2] && currentCandleType[2] == 3 and currentCandleType[1] == 1 and currentCandleType == -2;

# 2-1-1 Continuation (Directional, Inside, Inside)
def is211BullishContinuation = currentCandleType[2] == 2 and currentCandleType[1] == 1 and currentCandleType == 1;
def is211BearishContinuation = currentCandleType[2] == -2 and currentCandleType[1] == 1 and currentCandleType == 1;

# 2-1-1 Reversal (Directional followed by inside then opposite directional)
def is211BullishReversal = IsDown[3] && currentCandleType[2] == -2 and currentCandleType[1] == 1 and currentCandleType == 1;
def is211BearishReversal = IsUp[3] && currentCandleType[2] == 2 and currentCandleType[1] == 1 and currentCandleType == -2;

# 3-1-1 Reversal (Outside, Inside, then opposite directional)
def is311BullishReversal = IsDown[2] && currentCandleType[2] == 3 and currentCandleType[1] == 1 and currentCandleType == 2;
def is311BearishReversal = IsUp[2] && currentCandleType[2] == 3 and currentCandleType[1] == 1 and currentCandleType == -2;

# 3-2-1 Reversal (Outside, Directional, Inside)
def is321BullishReversal = IsUp[2] && currentCandleType[2] == 3 and currentCandleType[1] == 2 and currentCandleType == 1;
def is321BearishReversal = IsUp[2] && currentCandleType[2] == 3 and currentCandleType[1] == -2 and currentCandleType == 1;

# 1-2-1 Reversal (Inside, Directional, Inside)
def is121BullishReversal = currentCandleType[2] == 1 and currentCandleType[1] == 2 and currentCandleType == 1;
def is121BearishReversal = currentCandleType[2] == 1 and currentCandleType[1] == -2 and currentCandleType == 1;

# Match for other patterns (1-2-2, 3-2-2)
def is122BullishPattern = currentCandleType[2] == 1 and currentCandleType[1] == 2 and currentCandleType == 2;
def is122BearishPattern = currentCandleType[2] == 1 and currentCandleType[1] == -2 and currentCandleType == -2;
def is322BullishPattern = IsDown[2] && currentCandleType[2] == 3 and currentCandleType[1] == 2 and currentCandleType == 2;
def is322BearishPattern = IsUp[2] && currentCandleType[2] == 3 and currentCandleType[1] == -2 and currentCandleType == -2;

# ########################################
# Alerts based on detected patterns
def ActionPatterns =
    if is211BullishContinuation then 1 else
    if is211BearishContinuation then -1 else
    if is211BullishReversal then 2 else
    if is211BearishReversal then -2 else
    if is322BullishPattern then 4 else
    if is322BearishPattern then -4 else
    if is122BullishPattern then 5 else
    if is122BearishPattern then -5 else
    if is212BullishContinuation then 11 else
    if is212BearishContinuation then -11 else
    if is312BullishPattern then 10 else
    if is312BearishPattern then -10 else
    if is311BullishReversal then 12 else
    if is311BearishReversal then -12 else
    if is321BullishReversal then 13 else
    if is321BearishReversal then -13 else
    if is121BullishReversal then 14 else
    if is121BearishReversal then -14 else
    if is13BullishReversal then 15 else
    if is13BearishReversal then -15 else
    if is22BullishReversal then 16 else
    if is22BearishReversal then -16 else
    if is212BullishReversal then 17 else
    if is212BearishReversal then -17 else
0;

# Consolidated alert for both bullish and bearish patterns
Alert(useAlerts and ActionPatterns != 0, "Pattern Detected", alertType, if ActionPatterns > 0 then buySound else sellSound);

# ########################################
# Plot labels for the patterns

AddLabel(is211BullishContinuation, "2-1-1 Bullish Continuation", GlobalColor("rising"));
AddLabel(is211BearishContinuation, "2-1-1 Bearish Continuation", GlobalColor("bear"));
AddLabel(is211BullishReversal, "2-1-1 Bullish Reversal", GlobalColor("rising"));
AddLabel(is211BearishReversal, "2-1-1 Bearish Reversal", GlobalColor("bear"));
AddLabel(is212BullishContinuation, "2-1-2 Bullish Continuation", GlobalColor("rising"));
AddLabel(is212BearishContinuation, "2-1-2 Bearish Continuation", GlobalColor("bear"));
AddLabel(is212BullishReversal, "2-1-2 Bullish Reversal", GlobalColor("rising"));
AddLabel(is212BearishReversal, "2-1-2 Bearish Reversal", GlobalColor("bear"));
AddLabel(is312BullishPattern, "3-1-2 Bullish", GlobalColor("rising"));
AddLabel(is312BearishPattern, "3-1-2 Bearish", GlobalColor("bear"));
AddLabel(is311BullishReversal, "3-1-1 Bullish Reversal", GlobalColor("rising"));
AddLabel(is311BearishReversal, "3-1-1 Bearish Reversal", GlobalColor("bear"));
AddLabel(is321BullishReversal, "3-2-1 Bullish Reversal", GlobalColor("rising"));
AddLabel(is321BearishReversal, "3-2-1 Bearish Reversal", GlobalColor("bear"));
AddLabel(is121BullishReversal, "1-2-1 Bullish Reversal", GlobalColor("rising"));
AddLabel(is121BearishReversal, "1-2-1 Bearish Reversal", GlobalColor("bear"));
AddLabel(is322BullishPattern, "3-2-2 Bullish Reversal", GlobalColor("rising"));
AddLabel(is322BearishPattern, "3-2-2 Bearish Reversal", GlobalColor("bear"));
AddLabel(is122BullishPattern, "1-2-2 Bullish Reversal", GlobalColor("rising"));
AddLabel(is122BearishPattern, "1-2-2 Bearish Reversal", GlobalColor("bear"));
AddLabel(is13BullishReversal, "1-3 Bullish Reversal", GlobalColor("rising"));
AddLabel(is13BearishReversal, "1-3 Bearish Reversal", GlobalColor("bear"));
AddLabel(is22BullishReversal, "2-2 Bullish Reversal", GlobalColor("rising"));
AddLabel(is22BearishReversal, "2-2 Bearish Reversal", GlobalColor("bear"));
AddLabel(is22BullishPattern, "2-2 Bullish Continuation", GlobalColor("rising"));
AddLabel(is22BearishPattern, "2-2 Bearish Continuation", GlobalColor("bear"));

# Paint strat numbers only if enabled and valid candle type
plot barType =
    if !en then na
    else if !Show_Twos and AbsValue(currentCandleType) == 2 then na
    else if Show_Strat_Numbers and currentCandleType != 0 then AbsValue(currentCandleType)
    else na;
barType.SetPaintingStrategy(PaintingStrategy.VALUES_BELOW);
barType.AssignValueColor(Color.BLACK);
 
Last edited by a moderator:

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
407 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