Here is a sample algorithm. It posts a loss of around 100K between 18th July and 21st July 2015. When I look at the transactions there are no transactions for 21st July on some stocks. When I look at daily positions for 21st July 2015, some positions from 18th July have disappeared. Please look into it.