Actually, yeah... in part.I've found the surest way to not get a sequel is to go in expecting one is already in the bag. That kind of presumptuousness is very off-putting.
Like Batman, Superman, Spiderman, and Transformers?
Batman Begins only got the sequel because it wasn't "built in" to the idea. The little "Joker reveal" at the end was interesting but didn't really require a sequel... it just pointed out that the movie was the start of the Batman mythos we all know.
Superman Returns DID presume a sequel, on the other hand (Lois and Supe's illegitimate super-brat being central to that) and honestly, that part turned audiences off. The presumption of a sequel has proven totally unfounded. Yes, another movie MAY be coming, eventually, but it's going to be totally unrelated to the last one.
Spiderman allowed for a sequel but didn't require one either... while Spiderman II effectively established the plot of the next movie (or rather, one of the many tangential plots, as it turned out!)... and that led to a disappointing third installment.
And as far as "Transformers" goes... is there going to be another one? If so... it'll get the "let's go watch things blow up real good" crowd but the novelty factor will be gone and it won't make much money... if it even happens (is it happening???).
The movies that give you the best continuations are the ones that set up a believable WORLD... one that the audience cares about... aka "continuity" or yes, even "canon," and then allows for extended stories set within that continuity. The ones that turn out badly are the ones that go in assuming "trilogy" and try to set things up along that path.
Examples of really bad versions of that would be the Matrix flicks (never should've had a sequel!), any of the Uwe Boll films ("Bloodrayne" as a trilogy, for instance) and so forth.
Assuming sequels is inevitably disastrous. Make a good movie... on its own... but set it in a world that fits with stuff that came before and allows for stuff to come after which can also fit.
"Canon" is central to sequels, in other words... not "setup."