仕事が完了した
![](https://c.mql5.com/i/avatar/avatar_na2.png)
![](https://c.mql5.com/i/avatar/avatar_na2.png)
指定
So, initially I am looking for the script/EA to backtest the simple notion as follows:
Starting from a certain TIME, if price moves X pips in one direction, it can continue to do so for another X pips.
However I would ideally like it to run as an EA which would place the orders, execute the trades and close on SL or TP. SO for the purpose of this request I have assumed the latter. If it is too difficult or expensive etc then I might rather have a simple script/EA for backtesting only.
(Possible later additions may include eg a trailing stop, or and OCO for the orders).
I'd like it to work on any major/minor currency pair at least, but preferably anything for which standard charts are available in MT4.
I am specifically looking at the DAILY timeframe at the moment but would prefer it to also work on any LOWER timeframe.
Here are the input parameters, and examples in quotations;
Timezone: "GMT+2"
Start time: "00:01"
BUYSTOP order place above initial price (pips): "20"
BUYSTOP order expires: "23:30"
SELLSTOP order place below initial price (pips): "20"
SELLSTOP order expires: "23:30"
BUY trade TP (pips): "25"
BUY trade SL (pips): "20"
[if left blank = no TP]
SELL trade TP (pips): "25"
SELL trade SL (pips): "20"
[if left blank = no SL]
LOT size: "0.1"
(Account currency "GBP")
(Account size "1000")
So, from the parameters above here is what would happen;
At 1 minute after midnight (i.e. just after a new daily candle has started) the EA would place a BUYSTOP order 20 pips above the current price and a SELLSTOP order 20 pips below the current price.
The STOPLOSS for both trades in this example would be at the opening price at 00:01.
The TAKEPROFIT for each trade is 25 pips beyond the order.
I would like it to draw a short horizontal line on the chart for the entry point, each order, each SL, each TP, and preferably be able to choose colours as input parameters. AND for these to remain on the chart.
A nice but not important extra would be a box on the chart summarising the the CURRENT orders in both pips and prices, and a risk level in both currency and % (hence the parameters above which are in brackets) e.g:
START TIME: 00:01
START PRICE: 1.20201
LOTS: 0.1
EXPIRES: 23:30
BUYSTOP:
ORDER: 1.20401 (20 pips away)
TP: 1.20651 (25 pips)
SL: 1.20201 (20 pips)
RISK: 20GBP, 2%
SELLSTOP:
ORDER: 1.20001 (20 pips away)
TP: 1.19751 (25 pips)
SL: 1.20201 (20 pips)
RISK: 20GBP, 2%