Wednesday, January 26, 2011

New release: more accurate execution, faster backtests

Well, here comes v2.0.2, the latest version of our platform.

Faster backtests

We've put a lot of efforts into speeding up backtests execution, particularly backtests that use small bars (such as bars that last a minute).
A heavy strategy that was using hundreds of instruments with a mix of Daily and Minute bars went from taking more 7 hours to less than 3. Not bad, though smaller strategies will see a less dramatic speed up.

More accurate execution

We've expanded using quotes (in place of trades) for execution prices. Almost all stocks now have them. This might have an impact on your strategies, so you should consider running them again.

On a similar note, we now support slippage for stop orders.

New callback when a future is rolled

Strategies can now be notified when a future is rolling. This is particularly useful if your strategy attempts to take advantage of the periods when the market shifts from one underlying future contract to another.

Here is a naive example:

@Instruments(futures = { CAC_40 })
@MarketData(rolls = true)
public class HowToBeNotifiedWhenARollOccurs extends AbstractStrategy {
@Override
public void onClose(Bar bar) {
if (getPosition().getQuantity() > 0) {
sell(1);
}
}

@Override
public void onRoll(RollInfo roll) {
closePosition("Roll");
buy(1000);
}
}


Be aware that onRoll(RollInfo) is not called when run on your local machine. This is because all the data that we provide are already rolled. You'll have to run your strategy on our grid to see any effect.

For more on this release

See our release notes.

No comments:

Post a Comment