Use an expert advisor or a script working in endless loop.
Ok, thanx. I tried configuring it also as a script and also as an expert advisor, but it still didn't work.
The code:
//+------------------------------------------------------------------+ //| Tomba.mq4 | //| Copyright © 2006, MetaQuotes Software Corp. | //| https://www.metaquotes.net/ | //+------------------------------------------------------------------+ #property copyright "bla" #property link "http://www.bla.net" extern double Lots = 1; extern double EnterPrice = 10; extern double StopLoss = 20; extern double Limit = 30; extern string FileName = "data.txt"; int start() { ObjectsDeleteAll(); int handle; handle=FileOpen(FileName,FILE_CSV|FILE_READ,';'); if(handle<1) { Print("File not found, the last error is ", GetLastError()); return(false); } string sDate=FileReadString(handle); // Date string sTime=FileReadString(handle); // Time string sExpiration=FileReadString(handle); // Expiration Time string sCurrency=FileReadString(handle); // Currency string sDescription=FileReadString(handle); // Description string sImpact=FileReadString(handle); // Impact datetime Exp = StrToTime(sExpiration); datetime newTime = StrToTime(sTime) int i = 0; while (i == 0) { if (newTime == TimeCurrent) { double BuyP = Ask+EnterPrice*Point; double SellP = Bid+EnterPrice*Point; OrderSend(sCurrency,OP_BUY,Lots,BuyP,3,BuyP-StopLoss*Point,BuyP+Limit*Point,"Tomba Buys!",16384,Exp,Green); OrderSend(sCurrency,OP_SELL,Lots,SellP,3,SellP+StopLoss*Point,SellP-Limit*Point,"Tomba Sells!",16385,Exp,Red); i = 0 } } return(0); } //+------------------------------------------------------------------+Anyone got any idea how to help me?
Much obliged,
Tomba.
mqldev:
1-
datetime newTime = StrToTime(sTime) <-- missing semicolon!
2-
Open a pending orders you have to use:
OP_BUYLIMIT
OP_SELLLIMIT
OP_BUYSTOP
OP_SELLSTOP
I'm still checking the code :)
1-
datetime newTime = StrToTime(sTime) <-- missing semicolon!
2-
Open a pending orders you have to use:
OP_BUYLIMIT
OP_SELLLIMIT
OP_BUYSTOP
OP_SELLSTOP
I'm still checking the code :)
Thanx alot! i'll try to figure it out in the meanwhile.
If you'll have a solution i'll be happy to know:)
Tomba.
I also forgot "()" on TimeCurrent:P
Tomba wrote:
Thanx alot! i'll try to figure it out in the meanwhile.
If you'll have a solution i'll be happy to know:)
Tomba.
Visit mqldev.com and tell me what do you want!
mqldev:
1-
datetime newTime = StrToTime(sTime) <-- missing semicolon!
2-
Open a pending orders you have to use:
OP_BUYLIMIT
OP_SELLLIMIT
OP_BUYSTOP
OP_SELLSTOP
I'm still checking the code :)
1-
datetime newTime = StrToTime(sTime) <-- missing semicolon!
2-
Open a pending orders you have to use:
OP_BUYLIMIT
OP_SELLLIMIT
OP_BUYSTOP
OP_SELLSTOP
I'm still checking the code :)
Thanx alot! i'll try to figure it out in the meanwhile.
If you'll have a solution i'll be happy to know:)
Tomba.
did it, thanx.
lookin for a response from ya there.
Tomba.
lookin for a response from ya there.
Tomba.
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
I'm not sure if this should be a script or an indicator, and i'm not sure on how to write the exact code either.
I have a script which i made this far (only from little experience in vb):
I thank in advance to everyone who might help!
Tomba.