1) In live algorithm, it would be very useful to (for as long as it's running) get as many of the same rolling stats you get in a back test as possible/reasonable, for instance win rate and average profit. Main reasoning being that one aim of live testing is to verify whether the actual characteristics of the algo converge towards the backtest over time.

2) Unity-style coroutines using IEnumerator (Unity as in the most popular game engine). Main reason is those make it very easy to write code that waits for stuff in a linear method without callbacks (an alternative would be C# async, but AFAIK there are no guarantees on the thread of execution in that case and synchronization with other threads become necessary). I find myself wishing for that as currently handling order events in algo code that's being called on other events, e.g. OnData, is a pain. Example of what I would like to do:

//very simple example illustrating how control flow becomes linear IEnumerator HandleEntry(OrderTicket ticket) { //main loop for (;;) { yield return WaitForOrderEvent(ticket); if (ticket.Status == OrderStatus.PartiallyFilled) { if (StoplossTriggered()) { ticket.Cancel(); break; } } else if (ticket.Status.IsClosed()) { OnEntry(ticket.Status); yield break; } } //wait for order cancellation (stoploss) yield return WaitForOrderClosed(ticket); OrderTicket stoplossTicket = CreateStoplossOrder(); yield return Coroutine.Start(HandleStoploss, stoplossTicket); }

Or does anyone else have a better suggestion on how to already do this?

Author