jshumaker:
The output file dates are integers
Dates will show up as integers unless you convert them to strings.
As per the documentation:
The datetime type is intended for storing the date and time as the number of seconds elapsed since January 01, 1970. This type occupies 8 bytes of memory.Look at TimeToString() for MQL5 or TimeToStr() for MQL4.
jshumaker: but I do not get the right values. The output file dates are integers
-
macd_buff[i]=iMACD("GBPUSD",PERIOD_D1,12,26,9,PRICE_CLOSE,MODE_MAIN,i);
Why did you post your MT4 question in the Root / MT5 EA section instead of the MQL4 section, (bottom of the Root page?)
General rules and best pratices of the Forum. - General - MQL5 programming forum
Next time post in the correct place. The moderators will likely move this thread there soon. - TimeToString
FileWrite(file_handle,date_buff[i]); FileWrite(file_handle,macd_buff[i]);
You want to create a CSV file, rows of data with two columns. You are currently creating a one column file. Use one FileWrite.
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 am trying to get a simple script to write the values of the technical indicators to a text file but I do not get the right values. The output file dates are integers