For those who trade on news... It may take some time, about 15 minutes, to get market's response to news release. So, the question. Is it possible to create an EA which would place orders every 5 minutes and remove orders in 20 minutes of their existence, and place them again when a new candle opens? Can orders be placed when the EA is running? For example, you wake up in the morning, see when news are going to be released, set start and end time, so you don't have to wait for it during the whole day. For example, you can set trailing to 25 points and go about your business.
I selected slightly different way. The EA places BuyStop and SellStop orders in the prescribed time. Distance from orders to current market prices is adjustable. If no order triggers when a new bar is opened, the EA modifies orders. It will move orders, so they will be at a desired distance from the market. Thus, the current timeframe determines frequency of not triggered orders modification. If you want them to be modified every 5 minutes, set the EA to M5. If you want them to be modified every hour, set the EA to H1. When one order triggers, the other one is deleted. A position is closed by stop loss/take profit, or in the prescribed time.
Added the KolBarExtr parameter, which allows to specify the number of bars for the analysis of the distance to place the pending orders.
- Type of time - Accepts the values "Local Time" or "Server Time".
- Time of orders installation - Order placement time.
- Time before deleting orders (min) - Deletes the pending orders after the specified number of minutes.
- Type of orders - Accepts the values "StopOrder" (the "Buy Stop" and "Sell Stop" orders are placed) or "LimitOrder" (the "Buy Limit" and "Sell Limit" orders are placed).
- Type of lot - Accepts the values "Fixed Lot" or "Percent of balance".
- Lot (or percent) - The value depends on the "Type of lot" parameter selected.
- StopLoss (points) - Stop loss in points.
- TakeProfit (points) - Take profit in points.
- Min distance (points) - The distance from the current price to place the order.
- Modify of orders - Enable or disable the automatic modification of the placed orders.
- Use Trailing - Enable or disable the use of trailing stop.
- Type of Trailing - the type of trailing used. "Profit Trailing" - use trailing only when the current price exceeds the position opening price. "Loss Trailing" - always use trailing. "Transfer to breakeven" - transfer the position to breakeven immediately. "At the max/min price of the current bar" - the stop is set to the High or the Low price of the current bar, depending on the opened position.
- TrailingStop (points) - distance from the current price to the stop in points.
- TrailingStep (points) - trailing step
Places orders according to high and low of the stated number of candles.
Places orders if high/low are at the longer distance than specified in the DistanceSet parameter.
If KolBarExtr = 0, orders are placed by the DistanceSet parameter.