capilta: above iBarShift return Shift number on candle as 30. then i get CCI value of shift 30. but as you see i didn't get accurate value of CCI at '2014.09.16 23:19:53', because
int iBarBegin = iBarShift(NULL, 0, '2014.09.16 23:19:53', true); double data = iCCI(NULL,PERIOD_M15,per2,PRICE_CLOSE,iBarBegin) ;
- You are mixing apples and oranges. IBarShift is giving you the shift for the current chart, but then you ask for the CCI from the M15. Won't work unless your chart happens to be M15.
- The third argument for iBarShift is a datetime. You are passing it a character. (Does that even compile?)
- What happens if there is not a bar for that date? You get a -1. Drop the true or check What are Function return values ? How do I use them ? - MQL4 forum and Common Errors in MQL4 Programs and How to Avoid Them - MQL4 Articles

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
Dear,
I want to get accurate CCI value on dateandtime. Example what was the CCI value in EURUSD '2014.09.16 23:19:53'. i write the code below:
above iBarShift return Shift number on candle as 30. then i get CCI value of shift 30. but as you see i didn't get accurate value of CCI at '2014.09.16 23:19:53', because i got only close price of that of CCI value.
if there any way to get accurate CCI value on that accurate time.
Thanks