Need PI purchase and sale script

replied here, also price based conditions with placing orders not possible in pi