Suppose I had a simple futures trading system, just buys and sells, no stops, something like a moving average crossover, and I had a list of 30 futures markets I wanted to test it on. It is obvious to me how to test it on a single market and how to test it as a portfolio using code like this.
(In the above code, taken from this forum--thanks, why is position size a negative number?)
What if I wanted to test it over all 30 markets and see the results for each market, to determine the suitability of each market, as well as the aggregated results for all 30 markets, to get a sense of how it works in general? How would I do that?
So SetPositionSize(contracts = 1, spsShares); is an assignment inside a function call. I gather that the function then uses the variable 'contracts'. Correct?
Yes shares/contracts = units - the name does not matter. spsShares is just a constant with numerical value of 4 and it means that you declare position size in units whatever unit is.