- Number of lines in a file?
- how to prevent multiple trades in one bar?
- Portfolio management with MT4
Something like that
int daywrite; int start() { if(daywrite==Day())return(0); daywrite=Day(); string cur="EURUSD"; int hand=FileOpen("EURUSD.txt",FILE_READ|FILE_WRITE); FileSeek(hand, 0, SEEK_END); FileWrite(hand,iOpen(cur,PERIOD_D1,1),iHigh(cur,PERIOD_D1,1),iLow(cur,PERIOD_D1,1),iClose(cur,PERIOD_D1,1)); FileClose(hand); }
Yes, thanks, but is it possible to run automatically for all 50 pairs?
Yes. I am putting something together at the moment in the form of a script. I have a .txt file with a list of 70 instruments that I am interested in - the script reads these and loads them in to an array, which is then used in a loop to write to a .csv file. This will allow me to review all of the instruments on one Excel worksheet.
You might find Komposter's code useful to get you started - it helped me!
Yes. I am putting something together at the moment in the form of a script. I have a .txt file with a list of 70 instruments that I am interested in - the script reads these and loads them in to an array, which is then used in a loop to write to a .csv file. This will allow me to review all of the instruments on one Excel worksheet.
You might find Komposter's code useful to get you started - it helped me!
But do you intend to automatically download the data from MT4?
Yes, thanks, but is it possible to run automatically for all 50 pairs?
Again, I don't know, you want it in one file or 50?
Again, I don't know, you want it in one file or 50?
50, but that is inconsequential. I haven't figured out a way to get the OHLC data from MT4 by calling the symbol or somesuch. Something like MarketInfo() could work, but that function only returns current data, I need to be able to get the DOHLC for the most recent n bars.
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use