Yes, I think you are right, but it doesn't matter for my case because I still don't think Zorro really uses those values beyond printing it to the Zorro window and making it available in the Balance variable.

I found the variables that I was mostly looking for:
g->w.vWin and g->w.vLoss keep a tally of closed profits/losses and the difference between them is drawn as the equity in the chart and to the Zorro status section during the session. I have to modify those based on the result of the trade I'm cancelling/entering
g->w.numWin and g->w.numLoss are the number of won/lost trades, also a running tally. For some reason all trades are added to the losers upon cancelTrade, so I had to correct that manually.

Those are at least the important metrics but there are many more to take care off.

I think this is something Zorro should support natively. Is this really such a crazy use case? I don't see why trades should be split up into multiples if it's not necessary. Especially because many brokers (like IB) charge minimum order fees or flat fees, thereby increasing the overall commission if the order is split up. It's probably not too hard to implement in Zorro as an alternative order type that is activated by some flag. The normal trade logic can be left untouched, just adding it as an alternative.

Last edited by MegaTanker; 06/16/22 20:03.