Join useThinkScript to post your question to a community of 21,000+ developers and traders.
I wonder if I have the right script. What is the new script in post # 82
Oh yes I see do I add this to the script that Ben originally posted or can I replace that script to add this label. Also I am not seeing a white black dog arrowThat was a modification made following a request from @hashy to display a label that shows the direction of the last BDog arrow? Details in the modification history in the study
Oh yes I see do I add this to the script that Ben originally posted or can I replace that script to add this label. Also I am not seeing a white black dog arrow
This may sound dumb But where do I find the expansion area?@Billions You can either add my modifications to @BenTen originally posted study, or use post #82 which already has that functionality incorporated in. Either approach is fine. For more info, read the change log in that study. Was that not explicit enough? Regarding the White BlackDog arrow, if you load that study on a 5 minute chart of AMZN, you'll see the white arrows. Make sure you have your expansion space increased, I set mine to 22.
Ok that's not it mine is set to 100@Billions Go to Chart Settings > Time Axis. You can see the expansion area setting to the right.
# Black Dogs & SESs---For 5 minute chart ONLY
# NAMED BlackDog_SES_5min
# Originally posted by BenTen
# Modifications by tomsk, 1.17.2020
# V1.0 - 03.29.2019 - BenTen - Initial release of Black Dogs & SESs (5 Minute Aggregation) study
# V1.1 - 01.10.2020 - tomsk - Added state transition engine and label that displays direction of last BDog signal
# V1.2 - 01.17.2020 - tomsk - Adjusted positioning of arrows and updated color schemes for signals
# Here, "Black Dogs" are WHITE for use on a dark background.
input Hprice = high;
input Lprice = low;
input price = close;
input Hlength = 50;
input Llength = 50;
input Hdisplace = 0;
input Ldisplace = 0;
def StateUp = 1;
def StateDn = 2;
# High / Low Band for SES computations
# EMA of HIGHS
plot HAvg = MovAvgExponential(Hprice[-Hdisplace], Hlength);
HAvg.SetLineWeight(5);
HAvg.SetStyle(Curve.FIRM);
HAvg.HideBubble();
HAvg.HideTitle();
HAvg.AssignValueColor(if HAvg > HAvg[1] then Color.YELLOW else if HAvg < HAvg[1] then Color.VIOLET else Color.YELLOW);
# EMA of LOWS
plot LAvg = MovAvgExponential(Lprice[-Ldisplace], LLength);
LAvg.SetLineWeight(5);
LAvg.SetStyle(Curve.FIRM);
LAvg.HideBubble();
LAvg.HideTitle();
LAvg.AssignValueColor(if LAvg > LAvg[1] then Color.YELLOW else if LAvg < LAvg[1] then Color.VIOLET else Color.YELLOW);
# Crosses for SES Arrows
# SES = Standard Entry Signal
# Cross above High Average
plot SESup = if price > HAvg AND price[1] < HAvg then low else Double.NaN;
SESup.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);
SESup.SetLineWeight(3);
SESup.SetDefaultColor(Color.CYAN);
SESup.HideBubble();
SESup.HideTitle();
# Cross below Low Average
Plot SESdn = if price < Lavg AND price[1] > LAvg then high else Double.NaN;
SESdn.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);
SESdn.SetLineWeight(3);
SESdn.SetDefaultColor(color.YELLOW);
SESdn.HideBubble();
SESdn.HideTitle();
# Black Dog Arrows
# Change Aggregation Period to 20 minutes
def agg = AggregationPeriod.TWENTY_MIN;
def data = close(period = agg);
# 2 EMAs of Black Dogs
def BDfastEMA = ExpAverage(data,20);
def BDslowEMA = ExpAverage(data,100);
# Black Dog UP for EMA20 crossing ABOVE EMA100
def UpCross = BDfastEMA > BDslowEMA and BDfastEMA[1] < BDslowEMA;
plot BDup = if UpCross then low else Double.NaN;
BDup.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);
BDup.SetLineWeight(5);
BDup.SetDefaultColor(color.GREEN);
BDup.HideBubble();
BDup.HideTitle();
# Black Dog DN for EMA20 crossing BELOW EMA100
def DnCross = BDfastEMA < BDslowEMA and BDfastEMA[1] > BDslowEMA;
plot BDdn = if DnCross then high else Double.NaN;
BDdn.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);
BDdn.SetLineWeight(5);
BDdn.SetDefaultColor(color.PINK);
BDdn.HideBubble();
BDdn.HideTitle();
# State Transitions
def LastXState = if UpCross then StateUp
else if DnCross then StateDn
else LastXState[1];
AddLabel(1, "Last Cross Direction = " + if LastXState == StateUp then "UP" else if LastXState == StateDn then "DOWN" else "NOP",
if LastXState == StateUp then Color.Green else if LastXState == StateDn then Color.Red else Color.Yellow);
#
# End Black Dogs & SESs---For 5 minute chart ONLY
Great gonna load it up and see if I get a signal. I was seeing the yellow and purple lines and arrows but no white black dog let’s see if this script works better. I will keep you posted Thanks for the update I appreciate it.Since I had some free time earlier today I took a closer look at the WHITE arrows on the original study. I believe part of the confusion was that WHITE arrows were used for BOTH a BDog Cross Up as well as a BDog Cross Down situation. This might be the basis of some of the recent confusion that was caused. I have now updated the code to adjust the positioning of the cross up/down arrows and as well as modified the color schemes for signals.
BDog Cross Up - Green
BDog Cross Down - Pink
Here's version 1.2 of the study
Code:# Black Dogs & SESs---For 5 minute chart ONLY # NAMED BlackDog_SES_5min # Originally posted by BenTen # Modifications by tomsk, 1.17.2020 # V1.0 - 03.29.2019 - BenTen - Initial release of Black Dogs & SESs (5 Minute Aggregation) study # V1.1 - 01.10.2020 - tomsk - Added state transition engine and label that displays direction of last BDog signal # V1.2 - 01.17.2020 - tomsk - Adjusted positioning of arrows and updated color schemes for signals # Here, "Black Dogs" are WHITE for use on a dark background. input Hprice = high; input Lprice = low; input price = close; input Hlength = 50; input Llength = 50; input Hdisplace = 0; input Ldisplace = 0; def StateUp = 1; def StateDn = 2; # High / Low Band for SES computations # EMA of HIGHS plot HAvg = MovAvgExponential(Hprice[-Hdisplace], Hlength); HAvg.SetLineWeight(5); HAvg.SetStyle(Curve.FIRM); HAvg.HideBubble(); HAvg.HideTitle(); HAvg.AssignValueColor(if HAvg > HAvg[1] then Color.YELLOW else if HAvg < HAvg[1] then Color.VIOLET else Color.YELLOW); # EMA of LOWS plot LAvg = MovAvgExponential(Lprice[-Ldisplace], LLength); LAvg.SetLineWeight(5); LAvg.SetStyle(Curve.FIRM); LAvg.HideBubble(); LAvg.HideTitle(); LAvg.AssignValueColor(if LAvg > LAvg[1] then Color.YELLOW else if LAvg < LAvg[1] then Color.VIOLET else Color.YELLOW); # Crosses for SES Arrows # SES = Standard Entry Signal # Cross above High Average plot SESup = if price > HAvg AND price[1] < HAvg then low else Double.NaN; SESup.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP); SESup.SetLineWeight(3); SESup.SetDefaultColor(Color.CYAN); SESup.HideBubble(); SESup.HideTitle(); # Cross below Low Average Plot SESdn = if price < Lavg AND price[1] > LAvg then high else Double.NaN; SESdn.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN); SESdn.SetLineWeight(3); SESdn.SetDefaultColor(color.YELLOW); SESdn.HideBubble(); SESdn.HideTitle(); # Black Dog Arrows # Change Aggregation Period to 20 minutes def agg = AggregationPeriod.TWENTY_MIN; def data = close(period = agg); # 2 EMAs of Black Dogs def BDfastEMA = ExpAverage(data,20); def BDslowEMA = ExpAverage(data,100); # Black Dog UP for EMA20 crossing ABOVE EMA100 def UpCross = BDfastEMA > BDslowEMA and BDfastEMA[1] < BDslowEMA; plot BDup = if UpCross then low else Double.NaN; BDup.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP); BDup.SetLineWeight(5); BDup.SetDefaultColor(color.GREEN); BDup.HideBubble(); BDup.HideTitle(); # Black Dog DN for EMA20 crossing BELOW EMA100 def DnCross = BDfastEMA < BDslowEMA and BDfastEMA[1] > BDslowEMA; plot BDdn = if DnCross then high else Double.NaN; BDdn.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN); BDdn.SetLineWeight(5); BDdn.SetDefaultColor(color.PINK); BDdn.HideBubble(); BDdn.HideTitle(); # State Transitions def LastXState = if UpCross then StateUp else if DnCross then StateDn else LastXState[1]; AddLabel(1, "Last Cross Direction = " + if LastXState == StateUp then "UP" else if LastXState == StateDn then "DOWN" else "NOP", if LastXState == StateUp then Color.Green else if LastXState == StateDn then Color.Red else Color.Yellow); # # End Black Dogs & SESs---For 5 minute chart ONLY
Gotcha will do Thank you@Billions Best way to test is to create a fresh new chart and re-add the indicator. It seems from that screenshot you have multiple indicators that plot arrows. Sometimes other arrows may be in the way of the white arrows.
OR...
The white arrows have been changed to a different color. I think that's what happening here.
Start a new thread and receive assistance from our community.
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.
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.