It uses only daily close price for backtesting.
Try lower timeframe and adjust settings.
The lengthMA=input(30) for daily chart, will be 30*24=720 for H1 chart.
It will allow you to backtest strategy using hourly close (not only daily).

- backtest doen't recalculate on every tick so historical performance for intrabar trades are biased
- if you want to try use daily candle -> midnight signal
- it is best to have trailing stop in ercent of the current price : 1.3% correspond to ~ 5$

Hi, TO is the trailing stop price (specified in ticks). From the documentation : "The offset in ticks to determine initial price of the trailing stop order: X ticks lower than 'trail_price' or 'trail_points' to exit long position; X ticks higher than 'trail_price' or 'trail_points' to exit short position. The default value is 'NaN'. "