Among other things, politics and elections do have a bearing on the stock market performance but to limited extent. The political system of a country is guides its economic policies. If there is a chance of election of a party that encourages private enterprises that follows a proper regulatory system that envisions long term economic growth and corporate profitability, the markets show a rising trend. On the other hand, it is also possible that the good work of the old government is feared to be derailed by a new political party. In such cases, the markets see a downfall.
Often the media uses terms like business-friendly, socialist, reformer etc. to describe political ideologies or stance. But these tags used by media can be misguiding. In India, the best stock performance was witnessed during the regime of V.P Singh in 1989-1990. The Sensex pulled up by 73% in 11 months under the regime of this socialist PM who readily accepted the recommendations of the Mandal commission.
It must also be noted that the market returns are not affected in a big way whether the government is minority or majority based. Many a times it has been seen that markets performed better when coalition government was elected rather than a majority government which is considered beneficial for the market.
The reason why the impact of politics and elections on the equity market has never been reported to be substantial is because political parties may be die hard adversaries but their thinking of the economic matters and policies is not very different. Most of the time, the policies of the previous parties are carried forward by the new government for the benefit of the nation. Political tweaks have taken place but these have not impacted the direction of reforms. For example, the disinvestment policy started by Congress government was continued by the NDA government.
Overall, elections and politics have just a small impact of the equity market performance and investors must not invest based on anticipated political outcomes. Rather, they should look at the bigger picture. Foreign currency crisis, risk of war between nations etc. and other bigger political scenarios have far more substantial bearing of the performance of Indian equity market.