With your asset list I still get similar results. They are not exactly identical since your script sums up the margin one bar later.

I'm using the latest beta version, but I don't think that this affects the margin. Have you changed something else in your installation?