I just took a quick look at the btc-e API (https://btc-e.com/api/documentation), and the main functions are there. But I can spot one problem right away: You don't seem to be able to place trades at "market price" using their API. So the bot would have to specify a price, which means that there's big risk that orders will not go through...
Anyone know how to deal with that?
What would happen if the bot would place an order with an extreme price?
E.g. when selling, it could try to sell with the price $1 and btc-e will sell at the highest bid?
And when buying, if the bot specifies $10,000, it will start buying at the lowest price asked?
Can we trust that and not end up buying/selling at crazy rates?
My only thought is to consult the ticker api link: https://btc-e.com/api/2/btc_usd/ticker and place orders at the listed buy or sell amounts when placing a trade. It's still possible to miss a trade at those prices, I suppose, but it's fairly likely to execute and it's not likely to be wildly innaccurate. You could always check open orders at the next sample point and if the previous order is still not executed then cancel, I guess. Not sure that's ideal, exactly, but might be worth testing.