Investors can take comfort knowing the market usually has its best periods following midterm elections.