init code for MA trading