Ok, let's say I'm trading a spread of two stocks, X & Y, The spread is calculated as a ratio (Spread = X / Y). I use rolling stats to calculate the mean, standard deviation and hence the z-score of the spread, as such, I take the usual entry/exit signals of entering trades when the z-score exceeds 2 the then closing them on return to zero. There are, of course, the usual ways of sizing the legs. (dollar neutral for example). What I want to do is size the legs according to a z-score stop loss. Let's say that I'm going to define a z-score that exceeds 4 as my disaster stop. Given the amount of my account (in dollars) I want to lose if the stop is hit, how do I size the legs on entry of the trade? (Let's assume the mean and standard deviation remain constant).
Update: In the meantime I've been pondering this, this only thing I can think of is to hold one leg constant and work backward. This can be done for each leg in turn. But I'd still be interested in other ideas.