• Memorial Day Sale! Claim the biggest discount of the year with $50 off VIP using code MEM50. Sign up here.

Change "greater than zero line" to "highest value since crossing zero line?


New member
Is there thinkscript code that could change this "greater than zero line" to "highest value since crossing zero line?


Active member
In the stock hacker, thinkscript editor. To be alerted when the macd is at the highest value since crossing zero
That would be a pointless alert as it would go off each new candle beyond zero on MACD until the oscillating factor starts to head downward. Best signal I could suggest would be labeled as such to alert when: MACD > 0 and MACD < MACD[1], which could alert you one candle AFTER the peak essentially


Active member
You can apply that logic to any sequence of "requirements" for a trade, alert, signal, etc. I was just giving an example of the coding logic to at least be alerted one bar late. It is better than not having an alert at all, am I right? So you would have to create that scan requirement, allowing you to see stocks that have just started turned off the peak of the MACD high, or reversed, to be turning out of the valley of the MACD low. I am no coder so I can't set up the needed scanning sequence for you, but if you look at some other people's code in this forum, you may be able to paste together something usable with the pieces I provided you

Similar threads