Bingo!! I think the file-naming was the entire issue. Everything seems to work as expected now, as far as I can tell.
I also learned that I need to put the if(is(INITRUN)) checks higher up in my script. I had them below some other functions and they were not working. I've now located them just below the BarPeriod= line.
So the main issue was that the same form of selecting asset() must be used in both the loadStats() saveStats() and run() functions, otherwise Zorro expects a different naming convention. For this example, I've used:
while(asset(loop("EURUSD")))
(even though there is only 1 asset, this is a prototype that will eventually have multiple assets)
and here is the final code I've located just below my BarPeriod= line:
static int numOpenLastCheck; //track changes in trade open/closes
if(is(INITRUN)) numOpenLastCheck=0;
if(is(INITRUN)) loadStats("dt-e9-htc-30min.ini"); //load most recent stats that were saved to disk
if(NumOpenTotal != numOpenLastCheck)
{
saveStats("dt-e9-htc-30min.ini"); //save stats to disk upon trade count changes
numOpenLastCheck = NumOpenTotal;
}
Login MT4...
Broker: IBFX, Inc. connected at UTC 12.02. 16:50
Loading EURUSD prices.. 4500 min
Read trade stats from disk
Trade: dt-e9-htc-30min EURUSD 12.02.2014
[EURUSD::L3306] continuing
Read dt-e9-htc-30min.fac dt-e9-htc-30min.par
Saved trade stats to disk
Asset=EURUSD; direction=1; OptimalF=0.451000;
Margin=211.950000; Lots=0
[Wed 12.02. 16:50] 964 +0 -6 \
THANKS! I'm demoing this now, I want to see it behave correctly over several live trades.