Formally there is no dress code, but when you visit Old Delhi/ Shahjahanabad there is an informal code which people follow, especially if you are a woman, going on a shopping trip. You can wear anything as long as it is not revealing if you want to avoid extra attention or strangers staring at you.
A friend wanted to buy a few traditional sarees and jewellery from Old Delhi markets. I told her that if you want good bargains you should dress as an 'insider'. So, she dressed in a shalwar- kurta. We went saree hunting and got good bargains. She wanted to buy some more stuff and came back again after a few days. This time she dressed in a short top and low rise jeans. She told me that last time from metro station to the market she had paid fifteen rupees and now no rickshaw was willing to go for less than thirty rupees,i.e. almost the double.
I told her that in Rome do as the Romans do, I gave her a big shawl to cover herself up. And then we went shopping again.
In traditional markets of Chandni Chowk, Jama Masjid etc. people still see their women covered up. If you go for shopping dressed in modern attire they automatically assume that you have enough money to buy modern cloths so, you can also pay more for goods. And somehow your character also comes in question, that somebody who wears revealing clothes cannot be a nice person/ has a loose moral character.
This theory goes completely reverse when you go for shopping in malls, or to South Delhi markets like GK, South Extension, etc. Here, the sales man/woman will not pay attention to you unless you are dressed properly (not like a jhola wala/ behanji in a oversized cotton suit). Your clothes should say that you can buy or have the capacity to buy expensive goods. Here, the less you wear the better, counts. It is amazing to observe how these time eras exist in a same city. Delhi is going through a period of transition in every arena, every field. It is interesting to note the clash of old and new ideas, the clash of generations. So, the best advice is to just blend in with the crowd, and do not stick out like a sore thumb. But do, and dress with whatever you are comfortable with. The diversity makes it more interesting, less boring. Democracy gives us the right to be who we are, no apologies. (Only, you should be willing to pay extra for goods!)