Hi,
in order to investigate this I recommend to print the value of the 2 sma right before entering the trade.
On top of this I guess you have to set Stop and Trail before entering the trade if you want set them in the proper way. HtH
Ciao