Candle close across EMA and VWAP

ecommbiz

New member
hi, is it possible to create a scanner that scans for candles that cuts across(or touches) 2 exponential moving averages(one faster one slower) and the VWAP and closes either the high of the higher EMAs or VWAP or the low of the lower EMA and VWAP?

So basically the scan only appears when in the same candle, it cuts across or wicks across 2 EMAs and VWAP and closes on the extreme end of them.
 
Last edited:
Solution
hi, is it possible to create a scanner that scans for candles that cuts across(or touches) 2 exponential moving averages(one faster one slower) and the VWAP and closes either the high of the higher EMAs or VWAP or the low of the lower EMA and VWAP?

So basically the scan only appears when in the same candle, it cuts across or wicks across 2 EMAs and VWAP and closes on the extreme end of them.

Here are 2 scan possibilities

Screenshot-2022-12-06-092651.png
Ruby:
input len1 = 8;
input len2 = 21;

plot ema1  = ExpAverage(close, len1);
plot ema2  = ExpAverage(close, len2);
plot vwap  = reference VWAP();

def hh     = max(ema1, max(ema2, vwap));
def ll     = min(ema1, min(ema2, vwap));

plot scanup  = between(ema1, low, high) and between(ema2, low...
hi, is it possible to create a scanner that scans for candles that cuts across(or touches) 2 exponential moving averages(one faster one slower) and the VWAP and closes either the high of the higher EMAs or VWAP or the low of the lower EMA and VWAP?

So basically the scan only appears when in the same candle, it cuts across or wicks across 2 EMAs and VWAP and closes on the extreme end of them.

Here are 2 scan possibilities

Screenshot-2022-12-06-092651.png
Ruby:
input len1 = 8;
input len2 = 21;

plot ema1  = ExpAverage(close, len1);
plot ema2  = ExpAverage(close, len2);
plot vwap  = reference VWAP();

def hh     = max(ema1, max(ema2, vwap));
def ll     = min(ema1, min(ema2, vwap));

plot scanup  = between(ema1, low, high) and between(ema2, low, high) and between(vwap, low, high) and  (absvalue(hh - close) < absvalue(ll - close));
scanup.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);
Ruby:
input len1 = 8;
input len2 = 21;

plot ema1  = ExpAverage(close, len1);
plot ema2  = ExpAverage(close, len2);
plot vwap  = reference VWAP();

def hh     = max(ema1, max(ema2, vwap));
def ll     = min(ema1, min(ema2, vwap));

plot scandn  = between(ema1, low, high) and between(ema2, low, high) and between(vwap, low, high) and  (absvalue(hh - close) > absvalue(ll - close));
scandn.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_down);
 
Solution
i noticed that here are some candles that appear in the scan even though they do not close below both EMAs and VWAP and vice versa. possible to help correct this? thanks alot!

This should help. I misinterpretend close to mean closest to hh or ll, not above or below hh or ll.

Ruby:
input len1 = 8;
input len2 = 21;

plot ema1  = ExpAverage(close, len1);
plot ema2  = ExpAverage(close, len2);
plot vwap  = reference VWAP();

def hh     = max(ema1, max(ema2, vwap));
def ll     = min(ema1, min(ema2, vwap));

plot scanup  = between(ema1, low, high) and between(ema2, low, high) and between(vwap, low, high) and  (absvalue(hh - close) < absvalue(ll - close)) and close > hh;
scanup.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);

Ruby:
input len1 = 8;
input len2 = 21;

plot ema1  = ExpAverage(close, len1);
plot ema2  = ExpAverage(close, len2);
plot vwap  = reference VWAP();

def hh     = max(ema1, max(ema2, vwap));
def ll     = min(ema1, min(ema2, vwap));

plot scandn  = between(ema1, low, high) and between(ema2, low, high) and between(vwap, low, high) and  (absvalue(hh - close) > absvalue(ll - close)) and close < ll;
scandn.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_down);
 
Last edited:
This should help. I misinterpretend close to mean closest to hh or ll, not above or below hh or ll.

Can i request for a modification of the above?
2 EMAs, one faster and one slower and vwap.
If the faster ema is above the slower and vwap, the candle cuts below the faster ema and closes above.
If the faster ema is below the slower and vwap, the candle cuts above the faster ema and closes below.
Rule:The candle should only cut the faster EMA and not the slower ema and vwap.
Can this 2 emas be also available in different timeframe(aggregation period) and one version with vwap and another without vwap.
Thanks!
 

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

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

87k+ Posts
415 Online
Create Post

Similar threads

Similar threads

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