Trending MACD crossover

petech

Member
Say I'm scanning for MACD crossovers going upwards. Is there a way to scan for two consecutive upwards crossovers? Ignoring the downward crossover in between. So the second upwards (negative to positive) would have a higher value than the previous upwards crossover. All the while ignoring the price action. I did a search on this site, but I didn't see any results that was what I'm looking.
 
Solution
Im currently looking for something similar in terms of an indicator. Im trying to find out how to place arrows for a higher crossover then the previous crossover. I have something similar on tradingview but cant find anything like it on thinkscript.

Have you had any luck with locating something like this? Thanks.

See if this is what you wanted

Capture.jpg
Ruby:
input fastLength = 12;
input slowLength = 26;
input MACDLength = 9;
input averageType = AverageType.EXPONENTIAL;
input crossingType = {default "Positive to Negative", "Negative to Positive"};

def d = MACD(fastLength, slowLength, MACDLength, averageType).Diff;
def v = MACD(fastLength, slowLength, MACDLength, averageType).value;
def a = MACD(fastLength, slowLength...
Say I'm scanning for MACD crossovers going upwards. Is there a way to scan for two consecutive upwards crossovers? Ignoring the downward crossover in between. So the second upwards (negative to positive) would have a higher value than the previous upwards crossover. All the while ignoring the price action. I did a search on this site, but I didn't see any results that was what I'm looking.
Im currently looking for something similar in terms of an indicator. Im trying to find out how to place arrows for a higher crossover then the previous crossover. I have something similar on tradingview but cant find anything like it on thinkscript.

Have you had any luck with locating something like this? Thanks.
 
Im currently looking for something similar in terms of an indicator. Im trying to find out how to place arrows for a higher crossover then the previous crossover. I have something similar on tradingview but cant find anything like it on thinkscript.

Have you had any luck with locating something like this? Thanks.

See if this is what you wanted

Capture.jpg
Ruby:
input fastLength = 12;
input slowLength = 26;
input MACDLength = 9;
input averageType = AverageType.EXPONENTIAL;
input crossingType = {default "Positive to Negative", "Negative to Positive"};

def d = MACD(fastLength, slowLength, MACDLength, averageType).Diff;
def v = MACD(fastLength, slowLength, MACDLength, averageType).value;
def a = MACD(fastLength, slowLength, MACDLength, averageType).Avg;

def signal  = if Crosses(v, a, crossingType == crossingType."Negative to Positive")
              then a else signal[1];
def signal1 = if signal != signal[1]
              then signal[1] else signal1[1];

plot x = if signal[1] < signal1[1] and signal > signal1 then signal else Double.NaN;
x.SetPaintingStrategy(PaintingStrategy.ARROW_UP);

input debug = yes;
AddChartBubble(debug == yes and signal > signal1 and x == signal,
               signal,
               signal + "\n " + signal1,
               if signal > signal1 then Color.GREEN else Color.YELLOW, no);
AddLabel(debug, signal1 + " " + signal, color.yellow);
 
Solution

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