its much more simple then that guys...
The league you're in is representing the goal of the attackers.
low-medals (less then 1200) , you find yourself in a league of resource hunters, which will attack if resources are easy to concur, they don't care about medals at all.
high-medals (1200 and up), you'll find the medal hunters, these guys will attack for a sleazy medal, but also for medals with resources.
depending on how your base is constructed, you will not be attacked.
The longest period that nobody attacked me is 11 days, I had reached maxed-out medieval, and already had nothing to spent my food on, so an successful attack would mean 200K food or even more, cause my farm where piling out also.
At the moment I'm waiting for the last hours of gunpowder upgrade, and I'm still not attacked, while I'm completely filled, an attack would give a loot of 300-350 k on food and gold, and a huge number of trade goods.
Still i'm not attacked, so why ?.... well I've lowered my medals to < 600, only resource hunters, but they probably think it is all in my market and mill, cause they are piling out. Walls around them and all defense building around that wall, and walls around those buildings (donut construction), somehow, it scares looters off, and I do not get attacks.
To be honest, I'll only attack when there is a good change of getting a lot of loot, with either a small amount of raiders, or with a complete run over of a village.
So I'm a resource hunter, which is good for me, but not for the villages that have their resources badly protected. I dont care about a medal, so I have done raids with loot over 300K, and left the village without peace treaty, so they could be attacked straight away...again and again....
2-3 weeks ago I was above the 1200 medals, and got attacked multiple times a day, also a lot of resource hunters, which tried to get into the market/mill area, and if they did. left me with a victory and no peace treaty.
To prevent that, I've lowered my medals, and voila, attacks disappeared like snow in the sun. The lower the medals, the less attacks.
So if you trying to go up the medal ladder, you would surely have a base design that protects your town center, but then you will have less defense on resources, with a high medal count, you will be flooded by attackers, cause if there is a medal to be gained, with loot on the side, all medal hunters will go for that combination.