seperate the logic from trader, add position handler