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()
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.
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
** 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 (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