Perhaps you could elaborate a bit more on what's meant by "using the Twitter API to trade stocks".
You could run the trades on a simulated network or just print out the trades and calculate when/if the bot can beat the market.
1: Much automated trading these days is very high frequency, on the order of milliseconds (https://www.technologyreview.com/s/416805/trading-shares-in-...).