added trend.py and probe_ma_direction function