Porting the AlgoTrader (Java) code to Erlang