Addendum: The control statements in the TMF were not sufficient. They have been imporved and myID and myDate are no longer dropped (or accidentally rewritten) and I am able to fully track individual trades now. Errors are bound to happen at 3 in the morning smirk

This allowed me to find the issue causing the trade closures (at least in the most recent script). I had forgotten to set hedge = 2. All trades now close as expected. This was revealed by setting verbose = 7 which reports trades being 'reverse' as the reason for closure.

This also allowed me to see that trades I thought were opening at incorrect prices were merely opening some time after they are placed. I did not realise that plot() only marks the start point of trades from when they are opened not when they are placed.

So all problems fixed. Now onto bigger things such as making the strategy run on multiple timeframes. Time to get acquainted with 'algo' functions laugh

Thanks for all your help on this JCL. This little exercise has been more than informative and I think I'm now familiar enough with lite-C/Zorro that you should be hearing from me (as OP) a bit less often tongue

Cheers,
BobbyT

Last edited by BobbyT; 07/13/17 18:33.