dasilvja: It seemed to work except that it skips some of the crossovers. Plus there are some lines drawn in where I don't see any crossovers. Any thoughts?
double signalLineLast = iMACD(NULL,0,12,26,9,PRICE_CLOSE,1,i+1); if(MACD>signalLine && MACDLast<signalLine )
Why don't you compare last to last?
William Roeder:
Omg... I didn't even realize it was like that! I'm such a goof. Thanks. It works now. lol
Why don't you compare last to last?
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
I'm just learning to code. I'm just trying to write a script right now. I want to draw a blue vertical line whenever the MACD line crosses up over the signal line and draw a red vertical line when it crosses down. It seemed to work except that it skips some of the crossovers. Plus there are some lines drawn in where I don't see any crossovers. Any thoughts?