Black Dog System Indicator for ThinkorSwim - Strategy

Join useThinkScript to post your question to a community of 21,000+ developers and traders.

Why create more studies when just changing inputs solves the question. Please try to understand the studies before requesting changes. As Tomski mentioned changing the macdlength to 7 solves it.
The revised one just changed the names from macdlength to blackdoglength.
I am curious what the "input MACDLength = 1;" does ?
 
@BenTen Hi thanks for posting this strategy. I've been messing around with it in equities and futures and it seems like it works better for the markets that are open close to 24 hours. With equities the after hours and premarket trading seems to give false signals and enabling and disabling afterhours through the settings changes the signals, which makes sense. The hour timeframe on equities seems like it gives pretty good SESup and down signals. One other issue is that when I create a scan for signals enabling/disabling EH does the same as above.

I've tried to define the market hours in the script but I'm fairly new to TOS. I'd like to be able to define just the market open hours:

def MarketOpenTime = 0930;
def MarketCloseTime = 1500;

Not sure if I'm doing this right or if there is an easier line of code to put in to disable after hours within the script. Thanks!
 
@MAYissues There is no need to modify the code. Just disable the extended hours from your chart settings and also exclude it from the scanner and it should work.
 
@MAYissues There is no need to modify the code. Just disable the extended hours from your chart settings and also exclude it from the scanner and it should work.

Thanks, I appreciate you getting back to me!

I've tried disabling the extended hours and no luck. When you scan for the BDup in the scanner it will seed with symbols that don't have a BDup on them but if you enable extended hours it will be there. I also have extended hours off and my scanner is still updating with new symbols afterhours.
 
Can someone help my alerts are not working no sound. Can someone add an alert to this study for me
 
Last edited by a moderator:
Can someone help my alerts are not working no sound. Can someone add an alert to this study for me

alert( CrossDn, "BUY", Alert.BAR, Sound.Bell );
alert( CrossUp, "SELL", Alert.BAR, Sound.Chimes );

alert( UpCross, "BUY", Alert.BAR, Sound.Bell );
alert( DnCross, "SELL", Alert.BAR, Sound.Chimes );
 
Anyone know how to color in the space in the channel? i.e. make the area between the two 50's a different color than the normal background? Thanks
 
Today's question (ha ha)... What's the code to have a text box in the top left of the chart that shows the direction of the last BDog arrow? I've discovered AddLabel but am unable to get it to work correctly. As always, thank you.
 
Just add the following 2 lines to the end of the study I posted above - it will give alerts when the arrow prints

Code:
Alert(buySignal, "MACD Buy Signal", Alert.BAR, Sound.Ring);
Alert(sellSignal, "MACD Sell Signal", Alert.BAR, Sound.Bell);

this is awesome. how do i now add these alerts to specific stock on thinkorswim. for example wheen the MACD crossovers on AAPL, how do i set that up
 
@Trading51 This part of the code sets an agg period of 20 minutes. Any chart time frame over 20 minutes will stop the study from working. Several choices.
Erase or comment out this part of the study.
Change Def agg to the an agg period higher then chart time period.
Change this line " def agg = AggregationPeriod.TWENTY_MIN; " to "input agg = AggregationPeriod.TWENTY_MIN;"
That should let you choose an agg in settings.


# 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 = if BDfastEMA > BDslowEma AND BDfastEMA[1] < BDslowEMA then 1 else 0;
Plot BDup = if UpCross then high else double.nan;

BDup.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);
BDup.SetLineWeight(5);
BDup.SetDefaultColor(color.WHITE);
BDup.HideBubble();
BDup.HideTitle();

# Black Dog DN for EMA20 crossing BELOW EMA100-----------
def DnCross = if BDfastEMA < BDslowEma AND BDfastEMA[1] > BDslowEMA then 1 else 0;
Plot BDdn = if DnCross then low else double.nan;

BDdn.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);
BDdn.SetLineWeight(5);
BDdn.SetDefaultColor(color.WHITE);
BDdn.HideBubble();
BDdn.HideTitle();

# END==========================================
 

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

87k+ Posts
340 Online
Create Post

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