- i need EA for open pending order
- Features of the mql5 language, subtleties and tricks
- Questions from a "dummy"
Sorry I didn't get it.
No Slaves here, learn to code or pay someone. We're not going to code it FOR you. We are willing to HELP you.
Hello,
I have a similar challenge and wish to get help. I have created an expert advisor program(USD Transactions) but it has an error(s). I wish to have a program that looks up transaction from the list of market and pending orders, if the transaction does not exist in this list, the program looks up the elements of the order from a file(Transaction.csv) in the terminal and opens the order.I am using a user defined code to link both lists (magic number). I am not an experienced programmer and I believe I have reached the best of my abilities. The error message is;
‘Transaction.csv’-variable not defined
Find attached the file Transaction.csv
Find below the entire MetaEditor program language;
//+------------------------------------------------------------------+
//| USD Transactions.mq4 |
//| Fon Ngando |
//| |
//+------------------------------------------------------------------+
#property copyright "Fon Ngando"
#property link ""
//--- input parameters
extern int ExtParam1;
//+------------------------------------------------------------------+
//| expert initialization function |
//+------------------------------------------------------------------+
int init()
{
//----
//----
return(0);
}
//+------------------------------------------------------------------+
//| expert deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
//----
//----
return(0);
}
//+------------------------------------------------------------------+
//| expert start function |
//+------------------------------------------------------------------+
int start()
{
int i=0; // Orders counter
int k;
string File_Name;
double Transaction_Array[][0];
int j=Transaction_Array[i][6]
string File_Name=Transaction.csv; // Name of the file
int Handle=FileOpen(File_Name,FILE_CSV|FILE_READ,";");// File opening,
Transaction_Array[4736][9] // array declaration
for(i=0; i<=4735; i++) // For market and pending orders
{
if(OrderSelect(i,SELECT_BY_POS)==true) //If there is the next one
&& (OrderSymbol()=="USDJPY"),0, //.. and our currency pair
Ordersend("USDJPY",k, Transaction_Array[i][5], Transaction_Array[i][1],1, Transaction_Array[i][2],
Transaction_Array[i][3],,i,, );
Transaction_Array[i][1]=OrderOpenPrice(); // Order open price
Transaction_Array[i][2]=OrderStopLoss(); // SL price
Transaction_Array[i][3]=OrderTakeProfit(); // TP price
Transaction_Array[i][4]=OrderTicket(); // Order number
Transaction_Array[i][5]=OrderLots(); // Amount of lots
Transaction_Array[i][6]=j; // determining Order type
If(j=0&&j=Ask,k=j,if(j=0&&j<Ask,k=2,if(j=0&&j>Ask,k=4,if(j=1&&j=Bid,k=j,if(j=1&&j<Bid,k=5,if(j=1&&j>Bid,k=3))))));
Transaction_Array[][7]=OrderMagicNumber(); // Magic number
Transaction_Array [i][8]=0; // Comment
}
//----
return(0);
}
- Don't hijack other peoples posts, open your own.
- ‘Transaction.csv’-variable not defined
string File_Name="Transaction.csv"; // Name of the file
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use