Replacing closed orders

 
I need an EA that replaces the latest closed order in my account with a pending order of the same price, volume, SL & TP. It should ensure there no duplications of pending orders and should delay placing such a pending order if the current market price doesn't allow the stated SL or TP. Happy to discuss any compensation. email: segwaya@gmail.com
 

Sorry I didn't get it.
 
SEGI11:
I need an ...
No Slaves here, learn to code or pay someone. We're not going to code it FOR you. We are willing to HELP you.
 
WHRoeder:
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);

}

 
  1. Don't hijack other peoples posts, open your own.

  2. ‘Transaction.csv’-variable not defined
    string File_Name="Transaction.csv"; // Name of the file
Reason: