Job finished
![](https://c.mql5.com/i/avatar/avatar_na2.png)
Specification
Summery:
Enter in trade with three lots, set stop for all three lots at
recommended stop. For first lot set profit to target1, for second lot
set profit to target2 and for third lot set profit to target3. When target1 is hit, close first lot and for rest two lots move stop
to entry point. When target2 is hit move stop of third lot to target1
price.
I need an EA “source code” written in MT5 to run on my windows OS and Meta Trader 5 platform and trade forex pairs.
The information for each orders (pair, entry price, take profit, stop loss) are in a text file on my hard drive, which gets updated by a Perl code at any time. The EA must act on all new information as soon as they are in the file.
details:
EXAMPLE 1:
Subject: Pending Alert
Sender: he@somewhere.com
Date: Tue, 22 Nov 2011 08:16:29 -0700
Message:
Intraday Alert!
Entry order SELL EUR/USD at 1.3520-30 TARGET 1 1.3500, TARGET 2 1.3450, TARGET 3 1.3380.
Some unrelated text
Recommended STOP: 1.3565
Some unrelated text
Some unrelated text
Some unrelated text
------------------------------------------------
User input “lot size = x”
The EA must process the first line like this:
Sell x lots of EUR/USD at any price between 1.3520 and 1.3530 take profit 1.3500, stop loss 1.3565
Sell x lots of EUR/USD at any price between 1.3520 and 1.3530 take profit 1.3450, stop loss 1.3565
Sell x lots of EUR/USD at any price between 1.3520 and 1.3530 take profit 1.3380, stop loss 1.3565
Notice that the sell price and the stops “initially” are the same, but the target prices are different, and the stops change with targets being hit.
The lost size x is to be calculated so that no more than 3% of the equity is risked for all the 3 trades combined, i.e. 3% of equity <= abs(entry - stop loss) * (pip value.of 3x in local currency) or which ever way you want to calculate it.
If Subject: Cancel blah… then the EA must cancel current orders or close previously opened positions for this pair.
If Subject is any thing else, ignore it.
The Date: Tue, 22 Nov 2011 08:16:29 –0700
Is arranged such that old dates are at the top of the file and new dates are at the bottom of the file.