Is there a way to scan for a stock which has parellel EMAs. The EMAs could be 9, 21, 50. When these three EMAs are parellel to each other for some time then there is going to high parabolic move going to happen. This is similar to consolidation in price action.
I'm not sure how exactly parallel you are interested in scanning for. Adding a 'fudge factor' is a bit more involved, but for exactly matching slopes, it can be done this way:
This code lets you specify the lengths for the three averages in bars, as well as the lookback -- the two bars to look at for difference calculation. It...
I'm not sure how exactly parallel you are interested in scanning for. Adding a 'fudge factor' is a bit more involved, but for exactly matching slopes, it can be done this way:
This code lets you specify the lengths for the three averages in bars, as well as the lookback -- the two bars to look at for difference calculation. It defaults to 1 bar (looking at the two most recent bars). If the differences between the SMA for this bar and the last bar are equal for all three moving averages, the lines are parallel.
perhaps that's what you meant, perhaps not.
to do something with a fudge factor, you would need to do something like this:
Code:
input fudge_factor = 0.02; # this is in cents -- adjust as needed for your instrument e.g. 0.00002 for /6E etc...
plot eureka = if (delta1 <= (delta2 + fudge_factor)) or (delta1 >= (delta2 - fudge_factor)) and (delta1 <= (delta3 + fudge_factor)) or (delta1 >= (delta3 - fudge_factor)) then 1 else double.nan;
... I think. I'm just writing code in the text editor, not ThinkOrSwim.
I'm not sure how exactly parallel you are interested in scanning for. Adding a 'fudge factor' is a bit more involved, but for exactly matching slopes, it can be done this way:
This code lets you specify the lengths for the three averages in bars, as well as the lookback -- the two bars to look at for difference calculation. It defaults to 1 bar (looking at the two most recent bars). If the differences between the SMA for this bar and the last bar are equal for all three moving averages, the lines are parallel.
perhaps that's what you meant, perhaps not.
to do something with a fudge factor, you would need to do something like this:
Code:
input fudge_factor = 0.02; # this is in cents -- adjust as needed for your instrument e.g. 0.00002 for /6E etc...
plot eureka = if (delta1 <= (delta2 + fudge_factor)) or (delta1 >= (delta2 - fudge_factor)) and (delta1 <= (delta3 + fudge_factor)) or (delta1 >= (delta3 - fudge_factor)) then 1 else double.nan;
... I think. I'm just writing code in the text editor, not ThinkOrSwim.
Thank you This works for me. Can you help me change this for EMAs? instead of SMAs? Also is there a way to scan for this breakout of this EMA parellal? Thanks in advance.
Thank you This works for me. Can you help me change this for EMAs? instead of SMAs? Also is there a way to scan for this breakout of this EMA parellal? Thanks in advance.
everywhere you see: SimpleMovingAvg
change it to MovAvgExponential
and it'lll be EMAs.
and it is set up as a scan. the plot returns 1 or NaN. just put the code in a custom scanner (directions around here somewhere), set your timeframe, and go. Be aware that this does not tell you whether the moving averages are trending up or down, just that they are in parallel.
everywhere you see: SimpleMovingAvg
change it to MovAvgExponential
and it'lll be EMAs.
and it is set up as a scan. the plot returns 1 or NaN. just put the code in a custom scanner (directions around here somewhere), set your timeframe, and go. Be aware that this does not tell you whether the moving averages are trending up or down, just that they are in parallel.
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.
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.