|
发表于 2011-7-13 20:57:27
|
显示全部楼层
我来帮楼主改改程序吧,(瞎编一下,仅供参考)
void HTFS(int Money,int IQ,int Time) {
stocks;
while (true) {
newStocks = findGoodCompany();
mergeStocks(stocks, newStocks);
foreach (stock in stocks)
{
if (becomeBad(stock)) {
sell(stock, amount);
if (getAmount(stock) == 0) {
stocks.remove(stock);
}
}
else (becomeGood(stock)) {
if (money > 0) {
buy(stock, money);
}
}
}
wait (6 months);
}
} |
|