Hi,

I'm using the +BALANCED train option and I'm wondering what Zorro Trader is doing exactly to balance the data. I've read in the documentation that its used to "enforce the same number of positive and negative target values by replication" and "trades used for training should result in about 50% wins and 50% losses, and negative and positive Objective values should be equally distributed", but I'm unsure how it picks which of the objective values to replicate.

The selection does not seem to be random, and the same target values get duplicated no matter how many samples exist.

Does anyone have any insight into what the Zorro +BALANCED option is doing under the hood?

The example I'm using is from the Financial Hacker example:

adviseLong(SIGNALS+BALANCED,0,
change(1),change(2),change(3),change(4),
range(1),range(2),range(3),range(4));