StocksBot information
Welcome to StocksBot!!. As it name suggests, it's a bot made to work with stocks. Which stocks? well there is no limit but it was actually working with more than 5000 USA stocks "simultaneously".
Now you must be wondering, as explained in the 'how it works' page, the architechture of RobotBase is made to work with a single financial instrument. That's true and there are no plans to change that. Nonetheless there are ways to make the robot work with the thousands of instrumens (aka stocks). From the posible solutions, we picked up and implemented the following solution:
- Parameters: First matter to consider is if it worths to have different parameters for each of the thousands of instruments. StockBot works with day size candles. So the amount of candles for a single instrument is considered too small to optimize. If we optimize every instrument separately we will fall in the mistake of over-optimization. So we decided to use the same parameters for all the instruments and optimize them for the group of simulations. This means, we will consider the final simulation for optimizzation, the compound of the thousands of simulations, one per instrument. So the parameters optimization will maximize the profit and winrate for the compound of all instruments. When launchin on real the bot with every instrument, will pick these optimized parameters.
- How to manage all instruments on real time: This is the biggest specific challenge for StockBot.
- One possible solution would be to run one instance of the platform per instrument. This solution is not the most suitable because of many reasons. This will consume a lot of memory, and most important, will need a socket connection for every instance, while only few of them will be used.
- Picked solution is the following: After updating quotes from all or part of the instruments, the bot will be run every instrument in simulation mode (or backtest). After this, the program (that's outside of the bot) will have "x" simulations, each of them with all the "executed" orders. Then, the program will pick all the orders from the last day (today). These orders will be sent to the trading terminal, all with the same client/socket connection. Note that orders picked from the last day may be opening orders or closing orders. Some closings are done automatically if price touches take profit or stop loss level, but some others are closed with a market order.
On the following points, some of the main characteristics are described:
- Strategies: StocksBot is compounded of three strategies, all of them can be activated/deactivated via parameters:
- Volume alert: This order is generated when a high relative volume is detected. The comparision is made dividing the volume of the last day by the average volume of the last 10 days. The operation must be higher than a number set in the parameters. Some other conditions are added like a minimum percentage change or a minimum base volume
- Snake: This strategy makes orders when certain conditions are met. Generally speaking, this happens when a stock has general uptrend, at same time is in a small pullback and also seems like the pullback is getting to its end.
- Historical maximum: This easy strategy makes an order or alert when a stock touches the price of historical maximum. When this happens with a good trading volume and breaks the level, is common the the price to go up with strength.
- Candle size: StocksBot works with day candles. Although, when working on real, can be launched every 10 or 30 minutes to make the orders/alerts as soon as possible
- Instruments: As noted before, StocksBot works with a high number of instruments, as of this year around 5000 to 6000. This number changes with time as new compayies are created and some are unlisted from the markets. Instruments come from the main USA stock exchanges: AMEX, NYSE, Nasdaq etc...
- Other considerations:
- As the number of instruments is very high, one problem we found with this bot is that the number of instruments we find on portfolio after some time running this bot it very high. That is hard to manage. One solution is to put a "hard limit" for every strategy, for example 100 instruments per strategy, with this we will end up with a maximum of 300 instruments in portfolio. Some traders may want to not let the bot automatically enter the orders, as they want to review it before enter. This can be accomplished deactivating the order creation, so the investor can query the alerts saved in database, decide which ones to enter and then enter them manually.
- Financial information: Market Robots has a database with the financial information (that can be retrieved via API) of the instruments. This includes info like: Market capitalization, dividends, analysts consensus, target price, earnings dates, EPS, sales data/evolution, price to book ratio, projected EPS, projected sales, cash per share, cash flow per share, dividend per sahre, EPS, gross margin, net income abailable to common, price to sales ratio, revenues ttm, average volume...
- Market trend: One characteristic of StocksBot is that it only enters "long" positions. This is a downside in comparision to other bots, like IndexBot, mainly because most of stocks are highly correlated, this means, when the market is going down, the profit of the bot will be also down for this period, so this must be considered when investing in this bot in automatic mode, and high margin use is not recommanded.