Hi there! I'm new to Zorro, but old to programming!

I'm working through the tutorials and thought I'd tweak Workshop4, here's the code (i just replaced the '300' values in the tutorial with 'Lookback' because that looked like the right thing to do:

[img]https://www.dropbox.com/s/3m3urvr2rij6bag/code1.PNG?dl=0[/img]

This produces the same output as the original tutorial:

[img]https://www.dropbox.com/s/y1mp7aqq7d4yj83/Out1.PNG?dl=0[/img]

BUT if I change the LookBack to 298 (instead of 300), the Equity almost doubles by the end of the series:

[img]https://www.dropbox.com/s/vdcr93dq8e8yoc7/Out2.PNG?dl=0[/img]


I'm a long way from understanding what's going on - I'll get there eventually - but my question is; How can this simple code be so sensitive to a small change like that?

Looking forward to finding out a lot more!
Kind regards
-Mat


[b][/b]

Attached Files Out2.PNGOut1.PNGcode1.PNG