Writing is such a random business - sometimes it all comes together, sometimes it doesn't. Some days are good and thousands of words flow without effort, other times it's a struggle to write a paragraph or two. And then the business of being published seems random too - your manuscript lands in the right place, or it doesn't. Someone you know is scooped up in a fabulous book deal, while you have to carry on struggling. You get published and it seems to do well, but then there's a dodgy cover, the supermarkets don't buy and you're out of favour.
Let's face it, if anyone knew what really worked we'd see an endless stream of profitable books selling exactly their print run and yet books fail left right and centre, while others come from nowhere to glory at the top of the bestseller lists. I think the only thing you can do is hold on to why you're writing in the first place. Although I make my living from writing there are other things I could do (I think) that would probably be more profitable and certainly more secure. I write because I like it! I like telling stories, and there are things I want to say. I like the process of writing a novel, solving problems and making it work as a whole. I like my imaginary characters, I like living in a different world, I like it when I'm searching for a solution and suddenly realise I've already set it up.
You have to hang on to why you're doing it in the first place and not get sidetracked by the business side of writing. Write because it makes you happy, and don't worry about where you'll end up. No one can read the future, so don't bother about it. Keep on with the writing so long as you enjoy it, and try not to be influenced by the market. Never give up, never surrender!