Waddah Attar Explosion Indicator for ThinkorSwim

Thank you.
Can you please explain your line to me?
its literally just a translation of the line you pasted. I had to look up what functions were being referenced, but basically
"nz(rma(tr(true),100)) * 3.7"
nz is a default function tradingview uses to avoid errors (not necessary)
rma is tradingviews function for wilders smoothing average.
tr(true) is just their fuction for ATR

So basically you have a 100-period wilders smoothed average of the average true range and that result is multiplied by 3.7
 
@rad14733 I'd never even heard of this indicator, I was just bored last night so I looked at that code haha Any decent results with it and on what time frames does it tend to do best?
 
I'd never even heard of this indicator, I was just bored last night so I looked at that code haha Any decent results with it and on what time frames does it tend to do best?
I've been using WAE for quite some time... I had made some changes when I added it to my Renko Bar Based Trading System for Thinkorswim but have since reverted back to the original configuration because my modified version only performed well for long trades and call options and just wasn't effective for short trades and put options...

I mainly use short timeframes because I primarily do scalping and day trades but I'm sure it would work well for most timeframes...
 
Would it be possible to replace the MACD Histogram with the DMI_Oscillator? I tried to combine the code but I couldn't get the histogram to only chart "up" on the graph like has been done to the MACD Histogram for the WEA here. I have found the DMI to be more accurate so I think it could be a great improvement
 
Would it be possible to replace the MACD Histogram with the DMI_Oscillator? I tried to combine the code but I couldn't get the histogram to only chart "up" on the graph like has been done to the MACD Histogram for the WEA here. I have found the DMI to be more accurate so I think it could be a great improvement

Give it a try... Some indicators play better together than others... Otherwise run them independently... Only you can decide which indicators work best for you...
 
From the author .

"Here is a new indicator which I programed, it gives an explosion signal depending on two indicators (Bollinger & MACD). With this indicator you can discover when the price explosion starts and when it ends

The indicator is designed to work with H1 frame only. How to use the indicator:

1) The yellow line is used to recognize when the explosion starts and when it ends. the explosion starts when the yellow line is low as long as the yellow line is high the explosion is still running on the price explosion ends when the yellow line is back low inside the dots zone the yellow line job is identifying the explosion starts and ends.
2) The green histogram: has three uses: first, gives a signal when price explose upward (bullish move) second, gives the buying signal, when the green histo rises above the yellow line. third, gives the exist signal, when the a green histo slip back into the yellow line
3)The green histogram: has three uses:
  • first, gives a signal when price explose downward (bearish move)
  • second, gives the sell signal, when the red histo rises above the yellow line
  • third, gives the exist signal, when the red histo slip back into the yellow line
I hope that you will like the indicator. I added some properties so the indicator would be more sensitive and can be used with all pairs:

  • sensitive property
  • DeadZonePip property which represents for the pips move inside the dead zone (the zone between the dots line)
  • BandPeriod property which represent the sensitive of the yellow line
  • BandDivision property helpful value for the explosion (for yellow line)
  • showlong property to show or hide the green histo
  • showshort property to show or hide the red histo
  • showexplosion property to show or hide the yellow line
  • showdeadzone property to show or hide the dead zone (dots zone)

Explanation for the Price Explosion indicator:

The indicator depends on two things to show the data and the lines in chart

1) The deference between the upper and lower band of the Bollinger band which tight when the price fluctuates (narrow move) when the difference between the bands expand, the explosion process starts and the yellow line curve upward till the explosion ends and price fluctuate again
2) The difference between the present value of the macd and the last value with one tick for the same candle this deference is represented in the green and the red histogram.

END"
Thanks for the Indicator and the explanation , like the name .
 
the variables t2 & e2 are not used? I don't know why they are not being used.

True... I've checked other platforms versions and they don't use them either...

I am still searching for additional information on those unused variables but figured I'd share THIS article on Waddah Attar Explosion use... Come to find out, I've been using it correctly all along... It works very similar to the TTM_Squeeze which has been gaining popularity as of late... The page linked gives what I currently consider to be the best explanation of the indicator I have read to date...
 
Last edited by a moderator:
@Rojo Grande That's essentially what I just coming to post... Finally got alerts working in my TOS... Glad you figured it out... ;) (y)

Edited to add: You might want to add checking xLine as well so you only get alerted when out of the dead-zone... You use of e1 instead of ex is fine as it checks the e1 variable instead of the plot... Both work but using the variable makes adapting to a Watchlist or Scanner simpler...

Ruby:
Alert(tUp crosses above ex and ex > xLine, "tUp Alert", Alert.BAR, Sound.Ding);
Alert(tDn crosses above ex and ex > xLine, "tDn Alert", Alert.BAR, Sound.Ding);
 
Last edited:
How do I put an up arrow, or a green bar on the indicator when the condition is triggered?
Edited to add: You might want to add checking xLine as well so you only get alerted when out of the dead-zone... You use of e1 instead of ex is fine as it checks the e1 variable instead of the plot... Both work but using the variable makes adapting to a Watchlist or Scanner simpler...

Ruby:
Alert(tUp crosses above ex and ex > xLine, "tUp Alert", Alert.BAR, Sound.Ding);
Alert(tDn crosses above ex and ex > xLine, "tDn Alert", Alert.BAR, Sound.Ding);
 
@tome10 Add the following to the bottom of your script.

The code is valid but I don't see any up and down arrows, something must have been wrong, I'll look more into it later.

Code:
plot up = if tUp crosses above ex and ex > xLine then 0 else double.nan;
plot down = if tDn crosses above ex and ex > xLine then 0 else double.nan;
up.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);
down.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);
 
I also coded some arrows last night but the performance of them is poor at best... You are far better off using visual signs in combination with other indicators to determine valid entry and exit signals... This is the second time I have coded arrows in only to subsequently remove them... The code below was originally identical to the logic @BenTen used prior to further experimentation...

Ruby:
plot tUpArrow = if showArrows and trendUp crosses above ex and ex > xLine and ex[1] < ex then Double.NaN else Double.NaN;
tUpArrow.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);
tUpArrow.SetDefaultCOlor(Color.GREEN);
tUpArrow.SetLineWeight(3);

plot tDnArrow = if showArrows and trendDown crosses above ex and ex > xLine and ex[1] < ex then Double.NaN else Double.NaN;
tDnArrow.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);
tDnArrow.SetDefaultCOlor(Color.RED);
tDnArrow.SetLineWeight(3);
 
I am trying to create a scan for when the WAE explosion line changes direction. Usually in a study I add either a "< or >" followed by the same parameter with a [1] added to the end. That is not working for me in creating a scan. Any help appreciated, thank you.
Waddah_Attar_Explosion()."ex" > Waddah_Attar_Explosion()."ex[1]"

So, the [1] goes outside the quotation marks. Thank you.
 
Last edited by a moderator:
@Rojo Grande Without testing I'd say your code is flawed in that it should read: Waddah_Attar_Explosion()."ex" > Waddah_Attar_Explosion()."ex"[1]...

To explain further, whatever is in the quotes is the plot name that TOS looks for and to return results for when processing the Study... Considering how there is no "ex[1]" plot name you wouldn't get results... Placing the [1] index in the proper location allows TOS to process the Study properly and should return any valid results that exist...
 
Last edited by a moderator:
Part of it is to learn to do a little coding, putting arrows where I think they should be is a good start. I don't know much coding at all, I've dabbled in VBA in excel, and that's about it. ;-/.. Speaking of coding, what does the [1,2,3] represent? Three different timeframes?
Code:
def t1 = (calc_macd(close, fastLength, slowLength) - calc_macd(close[1],
fastLength, slowLength)) * sensitivity;

def t2 = (calc_macd(close[2], fastLength, slowLength) -
calc_macd(close[3], fastLength, slowLength)) * sensitivity;

I can't get the arrows to show up. How would you debug this?

How do you scan for the lighter colored lesser bar from the previous one? tUp is Green, tUp weakening is Light-Green, and tDn is Red, tDn weakening is Light-red. So scan for light green, or light red. thanks.

Less than previous bar maybe?
 
How do you scan for the lighter colored lesser bar from the previous one? tUp is Green, tUp weakening is Light-Green, and tDn is Red, tDn weakening is Light-red. So scan for light green, or light red. thanks.

Without modification of the code it is difficult to effectively scan using Waddah_Attar_Explosion... There simply aren't enough plots to give adequate results...
 
The thing that's missing on the WAE for ToS is the ATR period and MA method. It a default setting for MT4. If someone can modify it and add those two things McGinley MA instead of EMA, which is what is the default MA, I believe it'd be much better.

The ATR is there to help me get a more accurate trend. The default setting for the ATR on WAE is 21. I changed it back to 14 since the ATR is good the way it is at 14. Once I see either red or green spikes break the deadzone, yellow line, I follow it until the trend is over. Also, I have the option to choose what moving average to input on the WAE. The only one not there is the McGinley. I really don't tweak the settings other than the ATR and the band length which was a 21. I changed it back to 20. Thus far I've been hitting over 100 pips consistently. Goal is to be able to get 500-1000 pips consistently. I'm looking to find a way to utilize both the McGinley and WAE the same way on ToS. 🤙
 
Last edited by a moderator:

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

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

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