I know this is an old thread, but rather than post a new one, I'll toss my ideas around here.
One idea I had for getting a simple economy running, would shift prices depending on both how many of an item are in the fort, and how many are needed by the population. I'm sort of at a loss for how to explain it so here's the equation that slipped through my head applied in an instance of weapons.
EX1:
Your fortress has 6 well crafted aluminum spears, 20 total population (10 military, 10 civilians), 3 military dwarves with spear skill, 5 unarmed military dwarves, 8 unarmed civilians, and 4 others. The 3 speardwarfs have the highest need for the spears as it corresponds to the skill they prefer, the 5 unarmed military dwarfs also have a relatively high need for the spears no matter what their skill preferences are (at least they'd have a weapon), the 8 unarmed civilians don't really have much use for the spears, and the 4 others have no interest in them at all.
So I set the modifiers as follows along with their variables for the equation.
3 speardwarfs == A*2
5 unarmed military == B*1.5
8 unarmed civilians == C*1.25
4 others == D*0.6
base value of item == E == 1440
Total population == F == 20
[A*(2 * E)] + [B*(1.5 * E)] + [C*(1.25 * E)] + [D*(0.6 * E)] == Y / F == Finished price
[3*(2 * 1440)] + [5*(1.5 * 1440)] + [8*(1.25 * 1440)] + [4*(0.6 * 1440)] == 37296 / 20 = 1864.8 price per unit
Of course the values would probably have to be tweaked around some in order to properly balance it for the entire trade system, but for starters it gets the job done. The price of the spears goes up because there is more need/want for them than there is supply.
ALSO!!!! >>>>>
I'm aware that this is not ACTUAL supply and demand, but it functions well enough (i think) to accomplish what needs to be done in this aspect.
This seems to work especially well with items dwarfs equip to their person (Weapons, armor, clothing, picks, axes). But I could also see this working with trade as well (caravans) by assigning values for how easy certain items are to get in certain civilizations.
For instance say your modifier values ranged from 1 - 5 (horrible values really, but for examples sake) each civilization could be ranked as to how easy (or hard) it is to produce certain items, the higher the value, the harder it is to get the item. So something that only elves produced would be marked 1, and every other civilization would be marked 5. using the equation above, this would set the price QUITE high for anyone other than elves.
ANYWAYS!! ENOUGH RAMBLING!!
tl;dr all in all, this is basically a glorified (weighted) percentage equation, but it seems decently equipped from what I can tell, correct me if I'm wrong. I'd love to hear your thoughts!