Download MetaTrader 5
To add comments, please log in or register
Join MQL5 Cloud Network. Start earning money!
koralu
21
koralu 2015.11.20 12:36 

Hello,

How can be removed the week-end tick data from hist file? All the indicators are really go wrong because of this.

Thank you

ThreadHandle
105
ThreadHandle 2015.11.20 12:58  

skip over it?  if(5 < DayOfWeek() || DayOfWeek()  == 0){ weekend data } else{ Your Code }

 How are you using the history file? exporting and running the data through matlab or such or using strategy tester etc? (im not very familiar with hist data, i just write cvs files for tick data for relevant periods.)

 If you actually want to remove the weekend data from the hist download then export the csv then open it using your language of choice, then increment through data copying it and skipping 2 in every 7 given the date.

 I'd need more information to help you any further.

koralu
21
koralu 2015.11.20 13:18  
I'm not referring to removed it during the EA code execution. As you say it can be easily done by using DayOfWeek() function. What I'm trying to do is to remove it from "../history/symbol1.csv"  file. I'm looking for an automatically method to do that and I assume that a script like PeriodConverter can do that but I don't know how.
ThreadHandle
105
ThreadHandle 2015.11.20 14:19  

Well export it as a csv, im guessing you can code in c++ if your using mql4, Open the csv file in c++, and just make a new array, copy the values into new array by incrementing the file skipping 2 for weekends, then write array to csv?  Infract you could do it in mql easy using the  if(5 < DayOfWeek() || DayOfWeek()  == 0){ weekend data } else{ ArrayOpen[i] = csvarrayopen[i] } then filehandle = FileOpen("whatevercsv.csv", TYPE_CSV); 

FileWrite(filehadle, openarray[i], closearray[i], higharray[i], lowarray[i]) etc etc....should be pretty basic. 

/
To add comments, please log in or register