Switching to MT4 will probably not help. All included scripts are only guaranteed to work when unmodified. When you modify parameters, like the bar period, you usually must also adapt other parameters, like the stop and TP distances. Or alternatively, set StopFactor = 0 to prevent that MT5 opens and closes a trade immediately, which is likely the problem reason here. Generally, whenever you change something, think about possible side effects.

If you cannot fix it this way, the problem might have a different reason. Then someone else has to look into it. Send us a bug report with all required data, especially the experts log and journal, and your MT5 broker name and version number.