Three general tips for fixing those problems:

- Use plot commands to paint all indicators. Check if the indicator draws the same line as in your platform - SAR for instance has tons of parameters and thus is probably set up differently in your platform. In this case you can not see in your platform when a trade should be opened. Same goes for rekursive indicators such as EMA that depend on the UnstablePeriod setting.

- If you don't trust your code, check the .log file. Use printf() commands to print relevant variables and signals in the log so that you can see if all trades are triggered at the right moment. "#" prints also in the message window.

- If the strategy performance strongly depends on tiny indicator differences such as the length of the EMA unstable period, throw away the strategy and look for a better one.