execute Orders from CSV file

 
I want to put an Old LOG.file in the experts/files folder and built an expert advisor that places trades at the same 00:00:00 hour/minute +/- 10seconds from the previous day, week month etc. The purpose of doing this is having "trade automation" based from a previous trading day's activity.
** execute the trades based on the Logfile but obviously without the (2010 month day). Just use the Hour/minute.second 00:00:00

The EA would use
ReadOldLog_Open=FileOpen("20100314.csv", FILE_CSV|FILE_READ, ';');

if(ReadOldLog_Open>0)
{ FileSeek(ReadOldLog_Open, 0, SEEK_SET);
Open_Order_Type=StrToInteger(FileReadString(""));
Open_Open_Time=StrToTime(FileReadString(""));
Open_Order_Symbol=FileReadString("");
// Open_Open_Price=StrToDouble(FileReadString(""));
Stop_Loss=StrToDouble(FileReadString(""));
Take_Profit=StrToDouble(FileReadString(""));
}

if (OrderType(),OrderOpenTime(),OrderSymbol() == ReadOldLOG)//08:50:29 '******': instant order buy 1.00 EURUSD. at 1.3663 sl: 0.0000 tp: 0.0000
place Order
else
Print ("No enters at this second"


is this possible?
has anyone done this before?
I need an example of how to complete this
thanks Programmers


4xquestion@gmail.com
 
I will be adding my code and adding any information that may help me with this project. I have never coded in my life but I can learn;-)
so far, I got the script to find and open the file;-) now I need to learn strings, find out how to pull the info out of the file, and how to use the data to make my trades. hmmm. lots of reading to do!



int start()
{
int Handle;
int Open_Order_Type,
Open_Open_Time,
Open_Order_Symbol,
Open_Open_Price,
Stop_Loss,
Take_Profit;
Handle=FileOpen("tradelog.csv",FILE_CSV|FILE_READ,";");// File opening
if(Handle<0) // File opening fails
{
if(GetLastError()==4103) // If the file does not exist,..
Alert("No file named tradelog");//.. inform trader
else // If any other error occurs..
Alert("Error while opening file ");//..this message
PlaySound("Bzrrr.wav");
// Sound accompaniment
return;
}
if(Handle>0)
{
Print("we have the file and this file is what we need");
return(0); // cool the file is found
}
//Handle=FileOpen("tradelog.csv", FILE_CSV|FILE_READ, ';');
if(Handle>0)
{ FileSeek(Handle, 0, SEEK_SET);// this is cut and paste... What variables do I need to open an order from the TradeLog.csv
Open_Order_Type=StrToInteger(FileReadString(Handle));
Open_Open_Time=StrToTime(FileReadString(Handle));
Open_Order_Symbol=FileReadString(Handle);// I have an error here!
Open_Open_Price=StrToDouble(FileReadString(Handle));
Stop_Loss=StrToDouble(FileReadString(Handle));
Take_Profit=StrToDouble(FileReadString(Handle));
}
FileClose(Handle);
return(0);
 

Hello, Trendme

I´m looking for the exact same solution as you are, I´ve looked trough the whole internet and your code attempt seems like the closest...

if you ever achive to set the order parameters from a .csv file i would be great if you share your results with me...

maybe this links provide some clues on how to string exact info from a txt & csv

https://book.mql4.com/trading/ordersend

https://www.mql5.com/en/forum/117683 <--

i´m newbie but any help is appreciated,, automate from csv!

I ´VE THINKING THAT MAYBE GENERATING THE ENTIRE OPEN ORDER CODE IN A .CSV OR TEXT FILE AND JUST READING IT FROM THE EA.

Reason: