@tjlizwelicha It's tough to debug without having the actual code that you are working with... Have you looked at the bottom where the errors are listed...??? From what little of the code I'm seeing, there doesn't appear to be closing quotes around your color names... Every line from line 92, which as the first line we can see, only has opening quotes but no closing quotes... Beyond that it's hard to say without posting your actual code here... Use the
</> icon to encapsulate your script code...
I hope this helps. If not just tell me what I need to do. LOL
On page 1 of Rob Smith's The Strat Indicators
This is the code for the Strat Intraday Label Reverse
Code:
# -----------------------------------
# S T R A T L A B E L S w/REVERSALS
# A STUDY BY RAMON DV AKA PELONSAX
# -----------------------------------
declare upper;
#------------------------------------
# ASSIGN COLORS
#------------------------------------
DefineGlobalColor("3U”, CreateColor(002, 092, 000));
DefineGlobalColor("2U”, CreateColor(002, 255, 000));
DefineGlobalColor("1U”, CreateColor(000, 255, 121));
DefineGlobalColor("3D”, CreateColor(138, 000, 020));
DefineGlobalColor("2D”, CreateColor(255, 000, 030));
DefineGlobalColor("1D”, CreateColor(255, 166, 161));
# -----------------------------------
# Minute Label
# -----------------------------------
def min = AggregationPeriod.MIN;
def Vminute = GetAggregationPeriod() <= AggregationPeriod.MIN;
def minuteO;
def minuteC;
def minuteH;
Also on Page 1 of Rob Smith's The Strat Indicator under Actionable Signals
#-------------------------------------------------------------
#
# S T R A T R E V E R S A L S
#
# A N D
#
# A C T I O N A B L E S I G N A L S
#
# R E M I X
#
# A study by Ramon DV. aka Pelonsax
#
# Version 1.0 8/01/20
#
# Lost track of what version this is. 4-1-21
# Fixed Kickage issue, and measured move componenent
#
#-------------------------------------------------------------
declare upper;
#------------------------------------
# INPUTS
#------------------------------------
input Show_Strat_Numbers = yes;
input Show_Twos = yes;
input Show_Legend = yes;
input Alert_Actionable_Signals = yes;
input Alert_Reversals = yes;
input Paint_Candles = yes;
#------------------------------------
# DEFINE SCENARIOS
#------------------------------------
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];
def insidebarup = insidebar and O < C;
def twoup = H > H[1] and L >= L[1];
def outsidebarup = outsidebar and O < C;
def insidebardown = insidebar and O > C;
def twodown = H <= H[1] and L < L[1];
def outsidebardown = outsidebar and O > C;
#------------------------------------
# DEFINE REVERSALS (Basic four plus RevStrat)
#------------------------------------
# Bullish
def TwoOneTwoBull = twoup and insidebar[1] and twodown[2];
def TwoTwoBull = twoup and twodown[1];
def ThreeBull = outsidebarup and (twodown[1] or insidebar[1] or outsidebardown[1]);
def ThreeOneTwoBull = twoup and insidebar[1] and outsidebardown[2];
def RevStratBull = (twoup and twodown[1] and insidebar[2]) or (outsidebarup and insidebar[1]);
def BullRev = TwoOneTwoBull or TwoTwoBull or ThreeBull or ThreeOneTwoBull or RevStratBull;
# Bearish
def TwoOneTwoBear = twodown and insidebar[1] and twoup[2];
def TwoTwoBear = twodown and twoup[1];
def ThreeBear = outsidebardown and (twoup[1] or insidebar[1] or outsidebarup[1]);
def ThreeOneTwoBear = twodown and insidebar[1] and outsidebarup[2];
def RevStratBear = (twodown and twoup[1] and insidebar[2]) or (outsidebardown and insidebar[1]);
def BearRev = TwoOneTwoBear or TwoTwoBear or ThreeBear or ThreeOneTwoBear or RevStratBear;
#------------------------------------
# STRAT NUMBERS
#------------------------------------
plot barType = if Show_Strat_Numbers and insidebar then 1 else if Show_Strat_Numbers and outsidebar then 3 else if !insidebar and !outsidebar and Show_Twos then 2 else Double.NaN;
barType.SetPaintingStrategy(PaintingStrategy.VALUES_BELOW);
#------------------------------------
# CANDLE COLORS
#------------------------------------
DefineGlobalColor("3U”, CreateColor(002, 092, 000));
DefineGlobalColor("2U”, CreateColor(002, 255, 000));
DefineGlobalColor("1U”, CreateColor(000, 255, 121));
DefineGlobalColor("3D”, CreateColor(138, 000, 020));
DefineGlobalColor("2D”, CreateColor(255, 000, 030));
DefineGlobalColor("1D”, CreateColor(255, 166, 161));
AssignPriceColor(if Paint_Candles and BullRev then Color.CYAN else if Paint_Candles and BearRev then Color.MAGENTA else if
Paint_Candles and
!BullRev and
!BearRev and
twoup then GlobalColor("2U”) else if
Paint_Candles and
!BullRev and
!BearRev and
twodown then GlobalColor("2D”) else if
Paint_Candles and
!BullRev and
!BearRev and
outsidebarup then GlobalColor("3U”) else if
Paint_Candles and
!BullRev and
!BearRev and
insidebarup then GlobalColor("1U”) else if
Paint_Candles and
!BullRev and
!BearRev and
outsidebardown then GlobalColor("3D”) else if
Paint_Candles and
!BullRev and
!BearRev and
insidebardown then GlobalColor("1D”) else if
Paint_Candles and
!BullRev and
!BearRev and
!insidebarup and
!insidebardown and
insidebar then Color.WHITE else if
Paint_Candles and
!BullRev and
!BearRev and
!outsidebardown and
!outsidebarup and
outsidebar then Color.WHITE else Color.CURRENT);
#------------------------------------
# COLOR LEGEND
#------------------------------------
# Red Green
AddLabel(if Show_Legend then yes else no, "Color Coding: ", Color.LIGHT_GRAY);
AddLabel(if Show_Legend then yes else no, “Two Up”, GlobalColor("2U”));
AddLabel(if Show_Legend then yes else no, “Inside Bar Up”, GlobalColor("1U”));
AddLabel(if Show_Legend then yes else no, “Outside Bar Up”, GlobalColor("3U”));
AddLabel(if Show_Legend then yes else no, “Two Down”, GlobalColor("2D”));
AddLabel(if Show_Legend then yes else no, “Inside Bar down”, GlobalColor("1D”));
AddLabel(if Show_Legend then yes else no, “Outside Bar Down”, GlobalColor("3D”));
AddLabel(if Show_Legend then yes else no, “Reversal Up”, Color.CYAN);
AddLabel(if Show_Legend then yes else no, “Reversal Down”, Color.MAGENTA);
# HAMMER
input Hammer_length = 30;
input Hammer_trendSetup = 3;
input Hammer_bodyFactor = 0.3;
input Hammer_shadowFactor = 2.0;
Assert(Hammer_bodyFactor >= 0, "'body factor' must not be negative: " + Hammer_bodyFactor);
Assert(Hammer_shadowFactor >= 0, "'shadow factor' must not be negative: " + Hammer_shadowFactor);
def Hammer_BodyHeight = BodyHeight();
def Hammer_AverageBodyHeight = Average(Hammer_BodyHeight, Hammer_length);
def Hammer_ErrMargin = 0.25 * Hammer_AverageBodyHeight;
def Hammer_IsShort = Hammer_BodyHeight <= Hammer_bodyFactor * Hammer_AverageBodyHeight;
def Hammer = IsDescending(C, Hammer_trendSetup)[1] and
Hammer_IsShort and
H - Max(O, C) <= Hammer_ErrMargin and
Min(O, C) - L > Hammer_shadowFactor * Hammer_BodyHeight;
# SHOOTER
input Star_length = 30;
input Star_trendSetup = 3;
input Star_bodyFactor = 0.3;
input Star_shadowFactor = 2.0;
Assert(Star_bodyFactor >= 0, "'body factor' must not be negative: " + Star_bodyFactor);
Assert(Star_shadowFactor >= 0, "'shadow factor' must not be negative: " + Star_shadowFactor);
def Star_BodyHeight = BodyHeight();
def Star_AverageBodyHeight = Average(Star_BodyHeight, Star_length);
def Star_ErrMargin = 0.25 * Star_AverageBodyHeight;
def Star_IsShort = Star_BodyHeight <= Star_bodyFactor * Star_AverageBodyHeight;
def ShootingStar = IsAscending(C, Star_trendSetup)[1] and
Star_IsShort and
Min(O, C) - L <= Star_ErrMargin and
H - Max(O, C) > Star_shadowFactor * Star_BodyHeight;
# -------------------------
# ACTIONABLE SIGNALS
# -------------------------
def InsideUp = insidebar[1] and C crosses above H[1] and C > H[1];
def InsideDown = insidebar[1] and C crosses below L[1] and C < L[1];
def KickingBull = O >= H[1] and C > O and C[1] < O[1];
def KickingBear = O <= L[1] and C < O and C[1] > O[1];
def HammerRev = Hammer[1] and C crosses above H[1] and C > H[1];
def ShooterRev = ShootingStar[1] and C crosses below L[1] and C < L[1];
def MomoStar = IsDescending(C, Star_trendSetup)[2] and
Star_IsShort[1] and
Min(O[1], C[1]) - L[1] <= Star_ErrMargin and
H[1] - Max(O[1], C[1]) > Star_shadowFactor * Star_BodyHeight and
C crosses below L[1] and C < L[1];
def MomoHammer = IsAscending(C, Hammer_trendSetup)[2] and
Hammer_IsShort[1] and
H[1] - Max(O[1], C[1]) <= Hammer_ErrMargin and
Min(O[1], C[1]) - L[1] > Hammer_shadowFactor * Hammer_BodyHeight and
C crosses above H[1] and C > H[1];
input RangeAVG = AverageType.SIMPLE;
input RangeLength = 13;
input MeasuredMove_Sensitivity = 50;
def MMS = MeasuredMove_Sensitivity / 100;
def ATR = MovingAverage(RangeAVG, TrueRange(H, C, L), RangeLength);
def topH = (ATR[1] / 2) + L[1];
def Now = L >= topH;
def MeasuredUp = (TrueRange(H[2], C[2], L[2]) > (MMS * ATR)) and topH and Now and insidebar[1] and C crosses above H[1];
def MeasuredDown = (TrueRange(H[2], C[2], L[2]) > (MMS * ATR)) and topH and Now and insidebar[1] and C crosses below L[1];
def ActionableUp = InsideUp or KickingBull or RevStratBull or HammerRev or MomoHammer or MeasuredUp;
def ActionableDown = InsideDown or KickingBear or RevStratBear or ShooterRev or MomoStar or MeasuredDown;
# -------------------------
# SIGNAL ALERTS
# -------------------------
AddLabel(ActionableUp or ActionableDown, ("ACTIONABLE: " + if InsideUp then ”Inside Up” else if KickingBull then ”Kicking Bull” else if RevStratBull then “Rev Strat Bull” else if HammerRev then ”Hammer Rev” else if MomoHammer then ”Momentum Hammer” else if MeasuredUp then “Measured Move Up” else if InsideDown then “Inside Down” else if KickingBear then “Kicking Bear” else if RevStratBear then “Rev Strat Bear” else if ShooterRev then "Shooter Rev" else if MomoStar then "Momentum Star" else if MeasuredDown then " Measured Move Down" else ""), if ActionableUp then Color.CYAN else if ActionableDown then Color.MAGENTA else Color.BLACK);
Alert(Alert_Actionable_Signals and (ActionableUp or Actionabledown), ("ACTIONABLE: " + if InsideUp then ”Inside Up” else if KickingBull then ”Kicking Bull” else if RevStratBull then “Rev Strat Bull” else if HammerRev then ”Hammer Rev” else if MomoHammer then ”Momentum Hammer” else if MeasuredUp then “Measured Move Up” else if InsideDown then “Inside Down” else if KickingBear then “Kicking Bear” else if RevStratBear then “Rev Strat Bear” else if ShooterRev then "Shooter Rev" else if MomoStar then "Momentum Star" else if MeasuredDown then " Measured Move Down" else ""), Alert.BAR, Sound.ring);
Alert(Alert_Reversals and BullRev, ("Bull Reversal: " + if TwoOneTwoBull then "2D-1-2U" else if TwoTwoBull then "2D-2U" else if ThreeBull then "3U" else if ThreeOneTwoBull then "3-1-2U" else if RevStratBull then "Rev Strat Up" else ""), Alert.BAR, Sound.Bell);
Alert(Alert_Reversals and BearRev, ("Bear Reversal: " + if TwoOneTwoBear then "2U-1-2D" else if TwoTwoBear then "2U-2D" else if ThreeBear then "3D" else if ThreeOneTwoBear then "3-1-2D" else if RevStratBear then "Rev Strat Down" else ""), Alert.BAR, Sound.Bell);