Price formation and optimal trading in intraday electricity markets