code for trade engine

semi-working