Thanks for answering.
Finally, I found out that trades are completed only when the position of the asset turns 0.
Thanks again.
For code/output blocks: Use ``` (aka backtick or grave accent) in a single line before and after the block. See: http://commonmark.org/help/