FileWrite() 2 stamps MODE_WRITE|MODE_CSV (datetime + Bool) for Long/Short from EA 1 and then FileRead() MODE_READ|MODE_CSV in EA 2. Repeat in opposite direction.
It sounds like you know how to work with files already so you will probably make it.
It is really easy if you don´t confuse BINARY files with text files as I did and spent many days troubleshooting for nothing.
Please get back if it sounds confusing or if you would like some clarification.
Best wishes
/ McKeen
Please get back if it sounds confusing or if you would like some clarification.
The concept is very easy to get but since I don't have access to any examples of this used in a similar manner, I would really appreciate it if you could use this in a few lines of code as an example. Thanks!
The concept is very easy to get but since I don't have access to any examples of this used in a similar manner, I would really appreciate it if you could use this in a few lines of code as an example. Thanks!
//+------------------------------------------------------------------+
//| do_pliku.mq4 |
//| crn |
//| |
//+------------------------------------------------------------------+
#property copyright "crn"
#property link "gaa1@poczta.fm"
int start()
{
//----
int plik=FileOpen(Period()+Symbol()+"dane_wskaznik.csv",FILE_CSV|FILE_WRITE,' ');
if(plik>0)
{
//for (int l = Bars; l>=0; l--)
for (int l = 0; l<=Bars-1; l++)
{
//int l=0;
double wskaznik=iCustom(0,0,"Mongol",21,3,0,0,l); //Indicator, Price or somthing
if(wskaznik == 2147483647 || 0){wskaznik = -1;}
FileWrite(plik,Time[l],wskaznik,Period() );
//Print(l);
}
FileClose(plik);
plik=0;
//Print(wskaznik);
}
return(0);
}
//+------------------------------------------------------------------+
My scripts for save price/indicator as CSV file.
I hope it will be helpfull
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
EA1
if (sellcriterion)
save the current time in a file in the tester/files directory
if (buycriterion)
save the current time in a different file in the tester/files directory
EA2
has to check the times from the files one by one and if the time is right place orders accordingly
Any help in the form of guidance, tips, code, examples,etc. is really appreciated.
PS:I am currently testing my EA live and so far so good.