In the three and a half years leading up to the Lok Sabha election results in 2014, the BSE Sensex rose by 12.2%. It's a number underwhelming to investors who have got used to the bumper returns in the stock market over the past year. The Indian markets behave like Modi fans, and in the three and half years since the BJP victory in the Lok Sabha elections and Narendra Modi's election as Prime Minister, the Sensex has risen nearly 50%, a marked shift from how it did in the years preceding.
Part of the reason here is the recovery of the global economy over 2017. According to the NYT, only six countries are expected to be in recession in 2018, the smallest number ever recorded. This is helping corporate profits rise, and driving share prices up.
Nevertheless, the markets have increasingly seen the health of the economy as linked to the BJP's majority in the Parliament. Markets fell immediately following BJP's loss in the Bihar state elections, and rose after its wins in UP, Gujarat, and Maharashtra in October 2014. Despite the speedbumps of demonetization, and what many see as erratic GST implementation (the government's tax revenues have fallen sharply since GST rollout), the overall faith rests with the BJP government.
The fact that the current government is "coalition free" also helps. One of the big challenges for markets under the UPA government was differing messages and policy preferences from various quarters, and little message discipline. This would often frustrate and even alarm investors. In terms of the economy at least, the BJP government at the Centre has shown marked message discipline. And the absence of significant regulatory and industry scams in the meantime has helped it consolidate its reputation as "market friendly".