buy is opened at ask price, sell at bid price, chart is created from bid price, and ask price is offseted from bid price by spread value ... (try set spread = 0)
modify the take profit if the trend is up for buy and down for sale, increase for example 0.2 is like trailing stop but with take profit. thank you for your quickly respond