Black Dog System Indicator for ThinkorSwim - Strategy

@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==========================================
Besides what you just updated the previous, code says 5 min only any reason behind that 15 and 20 min are much better read
 

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

No idea why author said 5 min. only. Original should work on any chart 20 minutes or less. Possibly the author thought the combination of 5 minutes and 20 minutes were best for using the study
 
The link that @tenacity11 works just fine. You'll need to have the RAR utility to open that file that comprises a bundle of MQ4 scripts, Word document, etc, etc
 
Definitely can work for 30mins.
Just need to go into the script and change the agg period. Starting to get the hang on this. 😂
 
;) also meddled around the sides, found constants then added my own agg period. thanks @tomsk as always. if you're anywhere around the city of crazy rich asian lemme know, got you a beer in your name.
 

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

87k+ Posts
260 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