A transaction only will be considered at the open of each four-hour window and, if necessary, executed. This means that there are six four-hour candlestick windows in a daily 24-hour period and, thus, there are only six possible periods of transaction.
To open a trade, evaluation of the pair of EMAs occurs. If 10 EMA > 20 EMA, then a long position is taken. If 20 EMA > 10 EMA, then a short position is taken. At the time of trade entrance, both limit and stop orders are placed 40 and 20 pips away from the entry price, respectively. The transaction is automatically exited when the limit or stop order is hit. Our currency platform is FXCM and these orders are executed with little slippage except in the rare instances of complete market chaos.
There is no transaction on the anticipation of an EMA pair cross. The EMA signal must be firmly in place for trade entrance (see “Order of analysis,” below). Because of this, the model is considered a “lagging” one. The trade entry only occurs firmly after the EMA signal and only at the time of the open of the four-hour candlestick window. The exit of the trade occurs on a pre-set limit or stop-order basis, or change in trend direction.
The model would be more profitable if the transaction took place as close to the actual EMA cross as possible, without the imposed time lag of execution only at the four-hour window. However, our available dataset for backtesting limited us to the use of the four-hour candlestick for trade entrance.
The ambiguity issue
This model was designed to trade on and was historically optimized using four-hour EUR/USD candlestick data. We have found that backtesting the model produced, on some occasions, an ambiguity issue: It is impossible to tell in a transaction which was hit first in the candlestick data — the limit or the stop. In other words, if the candlestick price depth is such that both the limit and the stock were met inside the pricing period, it may not be certain which order was executed first.
But the ambiguity issue does not significantly alter the return profile of the model. For example, in 2007-2013 there were approximately 10,000 model entries and the question of ambiguity arose approximately 50 times. The spreadsheet screenshot in “Which came first?” (below) illustrates the small possibility of the “double count” of both the stop order and the limit order being executed within the same observation period.
There were three methodologies used to test the bounds of historical model returns in light of the ambiguity issue: The most optimistic method is to assume that all limit orders hit before stop orders. The most conservative method is to assume that all stop orders hit before limit orders. Then there’s the method that we settled on, the candlestick method.