If you use any of the Set functions (SetProfitTarget, SetTrailingStop, etc) or have [IntrabarOrderGeneration=True] in your code, it will NEVER be able to achieve backtest=realtime results.
One workaround is to create functions that mimic the SET functions. For instance I created my own...