It was suggested to me to put out some ideas for high level gear. Since levels 18-20 have 530,000 gp, 685,000 gp and 880,000 gp respectively, and we each get some major free stuff from our legacy items, you might not be sure what to spend your cash on. Well, first off, I'd suggest having at least 5k in diamonds on you. When you die, I'm not going to pay out of my own cash to raise you from the dead. Other than that, here are my suggestions, and feel free to offer your own.
Make sure you have the "Big Six" covered and maxed out. The Big Six are a stat boosting item for your primary attribute, cloak of resistance, ring of protection, amulet of natural armor, weapon and armor. Since one of these items will basically be free for you, you have no excuse to not have the others maxed out.
After this, consider getting a set of tomes/manuals for your primary stat. By this time you can probably afford a +4 tome/manual, but make sure it takes you to an even numbered stat (obviously). They cost 27500 gp per plus.
If you don't already have something providing you a miss chance, get a Cloak of Displacement, Minor. It's 24k (36K if adding it to your Cloak of Resistance) which is totally worth it for that 20% miss chance.
If you already have all this, then a consider picking up an item that offers a save or AC boost from an unconventional source, such as luck, sacred or insight. AC bonuses (that aren't deflection) cost [AC bonus]^2 x 2500. The save bonuses (that aren't resistance) cost [save bonus]^2 x 2000. Both of these bonuses cap at +5.
Still looking for things to buy? Well, boosting CON is always a good idea. Failed fort saves suck and hit points are always nice.
Have a skill you just want to dominate at, or a weak one that you need to shore up? Skill bonus items max out at a +10, but they are cheap: [skill bonus]^2 x 100. Yes, one hundred. You can get a +10 to a skill for just 10k.
You're still looking for things? Are you ever in melee? Buy a level 3 and level 4 pearl of power. Level 3 will let me (or Clay, if he's so inclined) give you a +4 enhancement bonus on your armor (replacing the +1 it likely has). The level 4 pearl lets us give you a +4 enhancement bonus on your weapon (again, replacing the +1 it probably has). These cost 9k and 16k respectively.
Still looking to waste coin? Are you bringing your cohort with you this level? Because he/she is going to need gear too. Save and stat boosts are a must, and armor is highly recommended. If they use natural attacks, you probably want to get them an Amulet of Mighty Fists and give them an elemental damage or (if you know the enemies we'll be fighting ahead of time) an amulet of bane against that type would serve you well.
Seriously? You have all this stuff and still haven't spent all your money? Well, make sure you can fly. Boots of Flying are probably your best bet for this.
I've always been a fan of animated shields too, so if you want to eke out a little more AC (up to +7 more points), you can get one of these suckers. If you're already using a shield (Mark), this will let you grab a little more damage because you can two-hand your weapon and still use the shield like normal. You do still take the ACP of the shield (and ASF if you're Jay) but it might be worth it.
Are you paying for your own armor? Get some sort of Fortification on it, at least Light. At this level, critical hits suck, not because they deal extra damage, but because they start imposing conditions. With light fortification, you've got a 25% chance of negating that condition (and the bonus damage). If you aren't paying for your own armor, consider getting this on your animated shield as well.
A ring of evasion and a ring of freedom of movement are solid purchases as well, if you have the money. Also get something with deathward in it. That wail of the banshee from the Crown Wraiths sucks, and avoiding it once per day is wonderful.
Grabbing some elemental resistance (I suggest Fire for facing the dragons at least) isn't a stupid idea. You can get 12k gets you Resist 10. Want more than that? For 224k you can get resist fire 20, fast healing 5, and +2 CMD.
If you have a backup weapon, consider spending a little money on it. Make it a +2 or +3 equivalent, at least. Do you have a strength score higher than 11? Buy a composite longbow. We don't have to do it often, but we just might have to switch to ranged weapons for certain enemies. Make it at least a +1 with elemental damage.
WARNING: Some items that are expensive are really traps.
Don't buy any item that offers a save. At this level, saves from items are going to be too low to really do anything. You'll basically be hoping your opponent will be rolling a 1, and it will basically just be wasting your standard action to use it when you could have done something useful.
SR items are a trap. The highest SR item available gives your SR 25. At level 18, a decent caster has a +25 or more to their check against spell resistance, so they basically can't fail. Just don't do it.
Don't buy a stat boost item solely to boost a save. If you have a low wisdom to begin with, a poor base will save from your class, and no class features that are based off wisdom, then don't buy a headband of wisdom to boost your saves. It's just too expensive for what you get. Buy an unconventional save item instead. The minor exception is a CON boosting item, but that's because hit points and stabilization rolls are sort of critical anyway, so the boost to Fort is mostly a perk.
Don't buy healing potions. In combat (when you'd want to use them) it basically takes a full round action to draw and quaff one, and (at most) you're gaining back 29 hit points. It's better to either use that full round action to withdraw and let someone cast heal on you, or to stay in there and just kill them faster. Potions of things like energy resistance or remove disease might be useful, but really, just don't bother with potions. If you are worried about healing, buy a wand for one of us and we'll take care of you.
--------
My final advice is basically to shore up critical weaknesses first (at this level, at least), then further capitalize on your focused strengths and finally fill in gaps last. Don't try to take over someone else's role by magic items. Just make sure your gear makes you better at what you are supposed to do (which includes not dying). If you find yourself unable to decide what to get and you think your major strengths and weaknesses are covered, then grab a few of those weird Wondrous Items that do something really random, like a cube of force or an instant fortress or something. Items that inspire creativity in their use are always fun.