Closed fidoandfido closed 13 years ago
Depending on the utility of the liquidating behaviour, I may look at changing the way the value AI prices shares; that is allowing it to make offers that are much much higher than the previous sale price, to allow corrections to occur.
Also might look at increasing the default share count from 100,000 to a few more.
Also added the random AI - this should add some extra movement and help with liquidity.
Seems this has not helped - random ai are a bit too exuberant for my liking - share prices seem to bubble too much.
Okay, so I further tweaked, and now the dominating factor seems to be the liquidations. To fix this, I have changed the AI trading pattern so that now when an AI Trader makes a trade, it has to specify the delta change, rather than just having two options - 5 or 10 percent. This seems to be helping; the 'default' values are currently 2, 5, and 10 percent, but these could change if an AI really wants to buy or sell - for instance if the book value was half the share value, rather than selling off at 10 %, it could make a much larger movement.
Further to this, I am considering another AI that will sell based on previous patterns seen - ie get the last 20 issued trades and trade in reaction to them. But first off, I will monitor the current system to see if prices stabilise sensibly.
Hopefully have this sorted with last commit.
Now have two AIs - one buying and selling based on earnings per share (comparing return on current share price to the global insterest rate) the other is concerned only with the book value of the shares (paying a premium for good earnings). With some minor bugs ironed out hopefully these two AI will create some interesting dynamics, with the random AI trader mixed in for good measure.
Will see how it goes in the morning!
Looks like the AI is now working out pretty well; shares seem to be tracking their book value; companies returning less than the current cash rate are below the line (including companies making losses) and companies making more are considerably higher.
This seems to appropriatish behavour.
Okay, so there sare still some issues that have been identified; possibly corrected...
Have updated and committed new code; current run should indicate if the code is stable or not.
Trading code looked stable(ish) until the trading ceased - at around 5am (ie after about 5 periods). I imagine this is from an exception occuring in the AI thread, crashing the thread hard. This could be from a mathematical error (perhaps a divide by 0 in a company that is insolvent?) This should probably be handled more better.
Further investigation required.
Okay, further investigation indicates that the AI is still trading, possibly even in a good way, but the graphs are not being rendered properly.
Will open new issue for this.
Okay, the Company data looks pretty good, share value is tracking the book value plus or minus a bit depending on the profitability of the company. There are enough fluctuations to make the graphs look interesting and the prices seem to meander a little bit - I am happy enough to close this issue off for the moment.
In time, with better AIs, it would be cool to introduce 'runs' on the stock, but this will be a bit further down the track. For now it is relatively stable, which is a good thing.
Value AI have been buying shares, and seem in no hurry to sell.
As a result, I have introduced code to liquidate AI holdings; the hope is that this will create more fluidity in the market as AI stop constantly going really long on any companies that are doing well.
Will update this issue when I have a change to see if this fix resolves the strange behaviour.