If I don’t specify a number of contracts in my code will it use the value I specified when I make the code live?
We need to specify the number of Contracts IN our code unless you are using, for example, Buy at Market and then the minimum position size would be used.
But it can all go wrong, I had a strategy very recently with only Buy 1 contract and Sell (exit Long) instruction, but I was horrified when I checked over my breakfast a week or so ago to see that this same strategy was trading with 9 x Contracts Short!!
Fortunately it was on Demo so no harm done. I never did figure out what had gone wrong!!
The figure that we enter in the max pos size when we start an Algo is just that … the maximum number of Contracts that can be traded on that particular strategy.
Hope this helps to answer your question
If you trade a certain number of contracts and enter a different number in autotrading, the lowest one will be used.
If no number of contracts is specified, then the one set in autotrading is used.