improve my trade marker algorithm