In that scenario, you are investing in RuneScape gold a venture that should not have anything to have to do with the number of cballs are needed to kill. This is like thinking that mining ore, then banking it, and then the smithing process is training two abilities at the same time with more efficiency - unless doing both of them together is saving more time and cost than doing them separately (e.g. when there's a furnace along the way to the bank, it saves you the time of needing to go into a furnace after having banked) It is best to be treated as two distinct occasions.
Since the advent of the grand exchange, goods can be exchanged for cash easily, and could effectively be considered the same thing. For instance, suppose that (hypothetically) you need 100k cannonballs for slaying and can afford 200k, at 250gp each. If you purchase 25000k 100k cannonballs that rise to 300gp each, then you effectively have 30000k, which you can exchange for cash or use. Likewise, if the cannonballs instead fall to 200gp each, you will effectively have 20000k, which you could exchange for cash or use.
Doubling the investment doubles the return, whether it be positive or negative. If you think that prices for cannonballs will rise, then invest as much as you'd like into them. the more you invest can be, the better the potential profit on whatever you don't get to use. If you end up buying more cannonballs that you'll need in the event that they increase, you'll be required to purchase the remainder at a higher cost.
Basically, if you think that the price of cannonballs will increase and you want to invest in them, do so regardless of the quantity you think you will need in order to kill. If you're unsure about whether they will or buy OSRS gold will not rise, then keep your money in cash and purchase cannonballs when you need them instead of having a stash of.