Write orders in csv file - page 2

 

Hello Traders,

I'm looking for alittle advice.

I have an EA that processes a text file produced by another program (not an EA) with information like this: "11/16/2016 Enter Trade EURCHF_.COMP/EURUSD_.COMP - Long EURUSD_.COM at 0.70916, Short EURCHF_.COMP at 82.55000 Layer 1",EURUSD_.COMP,EURCHF_.COMP,90.0700,1.1058,L,1,OANDA(market orders are used exclusively)

and the EA processes the entry order well but I have problems with the exit it reads an exit text file like this: "12/16/2016 Exit Trade AUDCHF.COMP @ 1.10300/EURUSD.COMP @ 1.11604",AUDCHF.COMP,EURUSD.COMP,1.10300,1.11604,N,1,OANDA(market order)

But the EA is dumb it doesn't know if there is an Entry for AUDCHF.COMP /EURUSD.COMP  but will look for those symbols and exit them regardless of if such a trade with two symbols exist. I would like some feedback on what are the pluses and minus of the ways to solve this problem (I'm not a programmer LOL). I'd like to make the EA upon startup or restart of MT4 "know what trades it has processed" (inventory) and ignore exit orders if there is no trade that it recognizes as its "own". Would writing the trades to a text file and reading that text file upon startup work? do I need a MySQL database linked to the EA? I might have up to 30 trades in my inventory. the MT4 is left running for days, would computer memory be an issue with one vs another option?  If this post is in the wrong place sorry. thanks in advance

 

Your EA should assign a magic number when it opens a trade, then it will know to only check trades with the same magic number.

When it is checking to close trades, it should look for the pair, ie "AUDCHF", not "AUD" and "CHF".

As you are not a programmer, then it is probably best to contact the person who coded your EA or post a job in the Freelance section.

 
Keith Watford:

Your EA should assign a magic number when it opens a trade, then it will know to only check trades with the same magic number.

When it is checking to close trades, it should look for the pair, ie "AUDCHF", not "AUD" and "CHF".

As you are not a programmer, then it is probably best to contact the person who coded your EA or post a job in the Freelance section.

thanks for the advice feed back
Reason: