New Members: Be sure to confirm your email address by clicking on the link that was sent to your email inbox. You will not be able to post messages until you click that link.
macd hist
Best Answer
-
Yes I see with that coding you are checking to see if the MACD is greater than 0 or less than 0. Problem is one or the other will always be true and trigger an alert.
You are really looking for the crossover, so we need to require the MACD to be less than 0 yesterday and then greater than 0 today. And Visa Versa.
The other way is to use the crossover "X" function which does the same thing in one line of code.
and [MACD Hist(12,26,9) X 0.0]
In this case the MACD has to cross above 0, you can also reverse it to get the MACD crossing below 0 (or as it reads the 0 is crossing above MACD.)
and [ 0.0 X MACD Hist(12,26,9)]0
Categories
- All Categories
- 2.3K StockCharts
- 395 SharpCharts
- 146 Other Charting Tools
- 69 Saved Charts and ChartLists
- 1.5K Scanning
- 73 Data Issues
- 177 Other StockCharts Questions
- 218 Technical Analysis
- 155 Using Technical Analysis
- 2 InterMarket and International
- 19 Market and Breadth Indicators
- 42 Market Analysis
- 109 Trading
- 109 Trading Strategies
- 163 S.C.A.N the StockCharts Answer Network forum
- 65 Using this StockCharts Answer Network forum
- 98 s.c.a.n. archives
- 5 Off-Topic
- 6 The Cogitation & Rumination Emporium
- Forum Test Area