Trabajo finalizado
![](https://c.mql5.com/i/avatar/avatar_na2.png)
Tarea técnica
I need 7 inputs in the EA:
1. Time
2. Increments
3. Buffer
4. TP
5. SL
6. Number of orders
7. Pairs (I trade 4 pairs exclusively but sometimes less. I need to be able to specify which pair)
At specified 'time', open buy and sell stops using the open price at the specified time.
Formulaes for BUY stop orders are:
Open price (at specified time) + (Increment*trade number) + Buffer = (Buy stop price)
SL: (Buy stop price from above) - SL
TP: (Buy stop price from above) + TP
Formulaes for SELL stop orders are little different:
Open price (at specified time) - (Increment*trade number) = (Sell stop price)
SL: (Sell stop price from above) + SL + Buffer
TP: (Sell stop price from above) - TP - Buffer
Lastly, I need all pending orders from previous day closed at (specified) time before the day's orders are placed.
EXAMPLE:
So, If I put in
1. 05:00
2. 50 (pips)
3. 10 (pips)
4. 100 (pips)
5. 100 (pips)
6. 5 (orders)
7. Eurusd, Gbpusd
Then at 05:00 server time for Eurusd and Gbpusd, 5 buy/sell stop orders are placed but with the formula I gave you.
If price for Eurusd at 05:00 was 1.55500 then:
First buy stop order would be:
1.55500 + (50*1) + (10) = 1.56100
Second buy stop order would be:
1.55500 + (50*2) + (10) = 1.56600
Third buy stop order would be:
1.55500 + (50*3) + (10) = 1.57100
and so on...
Can you see the pattern?
Now, SL for above orders
First buy stop order SL would be:
1.56100 - (100) = 1.55100
Second buy stop order SL would be:
1.56600 - (100) = 1.55600
Third buy stop order SL would be:
1.57100 - (100) = 1.56100
Can you see the pattern? Very simple
NOW, TP for above orders
First buy stop order TP would be:
1.56100 + (100) = 1.57100
Second buy stop order TP would be:
1.56600 + (100) = 1.57600
Third buy stop order TP would be:
1.57100 + (100) = 1.58100
I am sure you see the pattern and what I am trying to do.
Sell stop formulas are little bit different but just follow the formula.
Here is the formula again:
Formulaes for BUY stop orders are:
Open price (at specified time) + (Increment*trade number) + Buffer = (Buy stop price)
SL: (Buy stop price from above) - SL
TP: (Buy stop price from above) + TP
Formulaes for SELL stop orders are little different:
Open price (at specified time) - (Increment*trade number) = (Sell stop price)
SL: (Sell stop price from above) + SL + Buffer
TP: (Sell stop price from above) - TP - Buffer
Yes I need 'Pairs" input because I don't want to open multiple MT4. I
trade eurusd and gbpusd 90% of time. But I would like the function to
choose the pairs of possible.
Also, please don't forget, any PENDING orders made previous day must be
deleted at TIME FIRST then new order for the day goes in. So everyday
new orders at TIME.