Тестер стратегий
Strategy tester
Order processing
We have improved the order processing approach.
We used to execute the orders at the interpolated prices if any of the interpolation methods were chosen. That lead to pretty huge difference between the order and the execution prices. To solve this, we execute the orders at the price of the order now, except the cases when there is a market gap (market opens with a gap after the break). In these cases the LIMIT orders are filled better, but STOP orders without MAX.SLIPPAGE setting are filled at the first price. If the STOP orders have the MAX.SLIPPAGE setting, and the execution price is outside the limit, the orders are resubmitted as LIMIT type orders.
The logic is described below:
- the orders, which have BID side of trigger are compared to interpolated prices of the BID candles. ASK side to the ASK candles.
- if the oder (It does not matter what type the order is) is triggered by CLOSE, HIGH or LOW price tick, we fill it at the ORDER PRICE adjusted by last known spread if necessary (in case of opposite side trigger).
- if the order is triggered by OPEN price tick, we fill it by the OPEN price tick corresponding to the necessary side. The exclusion is a STOP order with a MAX.SLIPPAGE set. If the OPEN price tick is outside the STOP LIMIT, the order is changed to a LIMIT order.
4 ticks OHLC
4 ticks OHLC - this method is the most reliable interpolation method from many available.
It interpolates each candle into 4 price ticks - the Open, High, Low and Close. The order of the HIgh and Low prices depends on the distance from the Open price. If the High is closer to Open price, the High is processed as second price after the opening price.