Hello,
Can anybody help me program an EA (I don't need the code source) that will do the following:
If I manually open 1 lot BUY EURUSD at 1.0000 and I specify X distance to be 200 points (0.00200):
- Scenario 1, Main position is profitable; The EA should open a pending order in the same direction, BUY LIMIT, when the price reaches 1.00200. The new created pending order should have the main position entry price, which is 1.0000 So at the end, the pending order should open at 1.00200, BUY LIMIT at 1.00000
- Scenario 2, Main position is losing; The EA should open a pending order in the same direction, BUY STOP, when the price reaches 0.99800. The new created pending order should have the main position entry price, which is 1.0000 So at the end, the pending order should open at 0.99800, BUY STOP at 1.00000
Here is what I am thinking:
EXAMPLE:
My setup is the following: (I will not be using break even, nor trailing stop to make it simple)
Here is what I expect from the new EA I need developed:
- Monitoring time in milliseconds = 5 ms
- X Distance = 100 points
- Y time (in seconds) = 120 seconds
- MY SL = 200
- My TP = 50
- Break Even = 0 (for all its values)
- Tailing stop = 0 (for all its values)
- Magic number = 4557
- 00s An external EA just opened 1x EURUSD lot - SELL - at 1.000
- 30 seconds later, the price reaches 1.00080, and the external EA closes the main position
- 40 seconds later, the price reaches 1.00100, the new EA should open a new 1x lot - SELL STOP at 1.0000 with SL = 200, TP= 50
- 50 seconds later, the prices reaches 1.0000, the pending order becomes a position
- 60 seconds later, the price reaches 0.00950, the position (newly created position from pending order) closes BY TP=50
- 60.005 seconds later, the new EA should open a new 1x lot - SELL LIMIT at 1.0000 with SL = 200, TP= 50
- 70 seconds later, the prices reaches 1.0000, the pending order becomes a position.
- 80 seconds later, the price reaches 1.00200, the second new position (newly created position from pending order) closes BY SL=200
- 80.005 seconds later, the new EA should open a new 1x lot - SELL STOP at 1.0000 with SL = 200, TP= 50
- 90 seconds later, the price reaches 1.0000, the pending order becomes a position.
- 120 seconds later, the price is at 1.00100, The Y time has been reached, and the new EA should kill and close the position.