jshumaker:
When I run the script below my values on the chart do not match the output. I am using NULL for the symbol name parameter of the CopyTime function. According to the documentation I thought that meant the current chart's currency pair would be used but they do not match. I have included the script and last line of the output file along with a screen shot of the only chart I have open showing the values of the last candle.
Your main problem is that you don't read answers in your previous topics.
void OnStart() { int file_handle=FileOpen("m5live.csv",FILE_READ|FILE_WRITE|FILE_CSV); double ma1O[]; double ma1H[]; double ma1L[]; double ma1C[]; datetime date_buff[]; string line; int copied=CopyTime(_Symbol,_Period,D'2018.02.01 01:01:01',D'2019.01.01 01:01:01',date_buff); copied=CopyOpen(_Symbol,_Period,D'2018.02.01 01:01:01',D'2019.01.01 01:01:01',ma1O); copied=CopyHigh(_Symbol,_Period,D'2018.02.01 01:01:01',D'2019.01.01 01:01:01',ma1H); copied=CopyLow(_Symbol,_Period,D'2018.02.01 01:01:01',D'2019.01.01 01:01:01',ma1L); copied=CopyClose(_Symbol,_Period,D'2018.02.01 01:01:01',D'2019.01.01 01:01:01',ma1C); ArraySetAsSeries(date_buff,true); ArraySetAsSeries(ma1O,true); ArraySetAsSeries(ma1H,true); ArraySetAsSeries(ma1O,true); ArraySetAsSeries(ma1C,true); for(int i=0;i<copied;i++) { line=TimeToString(date_buff[i]) +"|"+DoubleToString(ma1O[i]) +"|"+DoubleToString(ma1H[i]) +"|"+DoubleToString(ma1L[i]) +"|"+DoubleToString(ma1C[i]); FileWrite(file_handle,line); } FileClose(file_handle); }

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
When I run the script below my values on the chart do not match the output. I am using NULL for the symbol name parameter of the CopyTime function. According to the documentation I thought that meant the current chart's currency pair would be used but they do not match. I have included the script and last line of the output file along with a screen shot of the only chart I have open showing the values of the last candle.
2018.04.09 10:55|1.27910000|1.28010000|1.27903000|1.27918000