9, 50, 100, 200 EMA On The Daily Chart Price Interaction

crscrs85

Member
Can someone write me a scan that looks for the high/low of bars on a one minute chart coming within .03 of a daily 9, 50, 100, and 200 EMA; and have it scan pre/post market as well as regular trading hours?

I built this using the wiz. I dont know what to change the "crosses" to so that it comes within .03 cents and I dont know how to make sure its using daily EMA's and 1minute bars.

Thanks


high crosses MovAvgExponential()."AvgExp" within 2 bars or
low crosses MovAvgExponential()."AvgExp" within 2 bars or

high crosses MovAvgExponential("length" = 50)."AvgExp" within 2 bars or
low crosses MovAvgExponential("length" = 50)."AvgExp" within 2 bars or

high crosses MovAvgExponential("length" = 100)."AvgExp" within 2 bars or
low crosses MovAvgExponential("length" = 100)."AvgExp" within 2 bars or

high crosses MovAvgExponential("length" = 200)."AvgExp" within 2 bars or
low crosses MovAvgExponential("length" = 200)."AvgExp" within 2 bars

The ToS platform only allows one timeframe per filter.
You scan for daily crosses
and then filter on crosses that occur on the minute chart.

but the ToS platform does not provide the ability to scan: "daily EMA's and 1minute bars."

My worry was the scan wouldnt pick up on the cross until the bar closed, therefore i wanted to indicate 1 minute bars. What should I change "crosses" to?
 
Last edited by a moderator:
Solution
Can someone write me a scan that looks for the high/low of bars on a one minute chart coming within .03 of a daily 9, 50, 100, and 200 EMA; and have it scan pre/post market as well as regular trading hours?

I built this using the wiz. I dont know what to change the "crosses" to so that it comes within .03 cents and I dont know how to make sure its using daily EMA's and 1minute bars.

Thanks


high crosses MovAvgExponential()."AvgExp" within 2 bars or
low crosses MovAvgExponential()."AvgExp" within 2 bars or

high crosses MovAvgExponential("length" = 50)."AvgExp" within 2 bars or
low crosses MovAvgExponential("length" = 50)."AvgExp" within 2 bars or

high crosses MovAvgExponential("length" = 100)."AvgExp" within 2 bars or
low...
Can someone write me a scan that looks for the high/low of bars on a one minute chart coming within .03 of a daily 9, 50, 100, and 200 EMA; and have it scan pre/post market as well as regular trading hours?

I built this using the wiz. I dont know what to change the "crosses" to so that it comes within .03 cents and I dont know how to make sure its using daily EMA's and 1minute bars.

Thanks


high crosses MovAvgExponential()."AvgExp" within 2 bars or
low crosses MovAvgExponential()."AvgExp" within 2 bars or

high crosses MovAvgExponential("length" = 50)."AvgExp" within 2 bars or
low crosses MovAvgExponential("length" = 50)."AvgExp" within 2 bars or

high crosses MovAvgExponential("length" = 100)."AvgExp" within 2 bars or
low crosses MovAvgExponential("length" = 100)."AvgExp" within 2 bars or

high crosses MovAvgExponential("length" = 200)."AvgExp" within 2 bars or
low crosses MovAvgExponential("length" = 200)."AvgExp" within 2 bars
The ToS platform only allows one timeframe per filter.
You scan for daily crosses
and then filter on crosses that occur on the minute chart.

but the ToS platform does not provide the ability to scan: "daily EMA's and 1minute bars."

Thats fine. My worry was the scan wouldnt pick up on the cross until the bar closed, therefore i wanted to indicate 1 minute bars. What should I change "crosses" to?
You are correct. The scan will not pick up the cross until after the bar has closed.
As previously stated, you cannot "indicate 1 minute bars" on a daily timeframe.
 
Last edited:
Solution
The ToS platform only allows one timeframe per filter.
You scan for daily crosses
and then filter on crosses that occur on the minute chart.

but the ToS platform does not provide the ability to scan: "daily EMA's and 1minute bars."


You are correct. The scan will not pick up the cross until after the bar has closed.
As previously stated, you cannot "indicate 1 minute bars" on a daily timeframe.
No I bet there is a way to do it
 
Can anyone write a code that scans for the high/low of candles on a one-minute chart coming within .03 cents of daily moving averages with a input that allows using both EMA or/and SMA and has a input for MA length?
 
Can someone write me a scan that looks for the high/low of bars on a one minute chart coming within .03 of a daily 9, 50, 100, and 200 EMA; and have it scan pre/post market as well as regular trading hours?

I built this using the wiz. I dont know what to change the "crosses" to so that it comes within .03 cents and I dont know how to make sure its using daily EMA's and 1minute bars.

Thanks


high crosses MovAvgExponential()."AvgExp" within 2 bars or
low crosses MovAvgExponential()."AvgExp" within 2 bars or

high crosses MovAvgExponential("length" = 50)."AvgExp" within 2 bars or
low crosses MovAvgExponential("length" = 50)."AvgExp" within 2 bars or

high crosses MovAvgExponential("length" = 100)."AvgExp" within 2 bars or
low crosses MovAvgExponential("length" = 100)."AvgExp" within 2 bars or

high crosses MovAvgExponential("length" = 200)."AvgExp" within 2 bars or
low crosses MovAvgExponential("length" = 200)."AvgExp" within 2 bars



My worry was the scan wouldnt pick up on the cross until the bar closed, therefore i wanted to indicate 1 minute bars. What should I change "crosses" to?

i can't help with scanning for 1 data time on a different chart time,
but here are 2 formulas for checking if price is 'near' an average. tolerance is some dollar amount.

check if candle closed within a range , average +- a tolerance.
def b = if (close > (average - tolerance) and close < (average + tolerance) then 1 else 0;

check if any part of the candle is within a range,
def b = if (high > (average - tolerance) and low < (average + tolerance) then 1 else 0;

---------------------

here is a study for testing various 'near' parameters
https://usethinkscript.com/threads/check-if-price-is-near-an-average.14499/

---------------------

other studies, is price near a signal?
https://usethinkscript.com/threads/scan-for-price-touching-moving-average-in-thinkorswim.1214/
https://usethinkscript.com/threads/scan-for-stock-trading-near-high-low-within-a-price-range.12037/

slightly different, are x averages close together?
https://usethinkscript.com/threads/find-when-2-to-5-averages-are-close-together-within-x.14187/
 
i can't help with scanning for 1 data time on a different chart time,
but here are 2 formulas for checking if price is 'near' an average. tolerance is some dollar amount.

check if candle closed within a range , average +- a tolerance.
def b = if (close > (average - tolerance) and close < (average + tolerance) then 1 else 0;

check if any part of the candle is within a range,
def b = if (high > (average - tolerance) and low < (average + tolerance) then 1 else 0;

---------------------

here is a study for testing various 'near' parameters
https://usethinkscript.com/threads/check-if-price-is-near-an-average.14499/

---------------------

other studies, is price near a signal?
https://usethinkscript.com/threads/scan-for-price-touching-moving-average-in-thinkorswim.1214/
https://usethinkscript.com/threads/scan-for-stock-trading-near-high-low-within-a-price-range.12037/

slightly different, are x averages close together?
https://usethinkscript.com/threads/find-when-2-to-5-averages-are-close-together-within-x.
https://usethinkscript.com/threads/find-when-2-to-5-averages-are-close-together-within-x.14187/
Thanks, ill take a look at them.
I came across these as well but will need some time to play around with it to make sure it works proper. Basically the end game is to be notified immediately in real time when price gets close to daily Exp. moving averages. I dont care if its taking data off the 1 minute chart or not. I only specified 1 minute chart because i was under the assumption the data wouldnt count as a positive scan until the candle closed.

input length = 200;

input tolerance = .03;

def ema200 = expAverage(close, length);

def priceDiff = AbsValue(close - ema200);

def nearEMA = if priceDiff <= tolerance then 1 else 0;

plot scan = nearEma;

input length = 200;

def ema200 = ExpAverage(close, length);

def highCross = if high > ema200 and high[1] <= ema200[1] then 1 else 0;

def lowcross = if low < ema200 and low[1] >= ema200[1] then 1 else 0;

plot scan = highcross or lowcross;
 
Last edited:

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
453 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