I am not clear as to what Home Office trick was in Mr. Amir's reply. Also don't also see what does Mr. Malik means by visa sticker having expiry date. I think that is totally irrelevant.
To answer the original question, you need to complete the required period of residence before applying for ILR. However, you can apply 28 days before that date. For example, if the required period was 5 years then you can apply for ILR after 4 years 11 months and 2 days. However, when you apply, the stay must be legal i.e. your current Leave to Remain must not have expired.
So in your case, since you came only 20 days after getting visa, you could still apply a week before expiry of your current Leave and be within 28 days time limit. But make sure that you complete the ILR application form correctly and attach all necessary documents. Also you could consider applying in person so you would know the application status and if necessary, you would have time to apply for extention of stay if ILR application is not successful. To apply in person, you need to take appointment well in advance.