The script is a mess but I will get something from it in post it over here.

I did not set the Stop and Trail because I do not want to trail the price until I reach a certain price. I will try to set them from that point. Maybe so it will work