Meme StreetYour bots

Trading bots: the guide

A bot is a short list of rules you write, like "buy when the price crosses above the 20 EMA, sell when it gets back below it". It trades on your account while you are away, with the same fees, cooldowns and limits as your own clicks. Bots come with Meme Street Expert, which includes everything in Pro.

Set one up, step by step

  1. Open Bots in the menu. You need an Expert pass that is on; without one the page links to the Shop.
  2. Press New bot, or start from a template: EMA trend, RSI dip, Breakout on volume, News momentum or Calls on good news. A template is an ordinary bot you can change.
  3. Name it, list its stocks and pick a candle size. Stocks are tickers separated by commas (NVXA, CLDR), up to 10. The candle size is 1m, 5m, 15m, 30m or 1h: the bot thinks once each candle of that size closes.
  4. Write its rules. Each row is a condition (When this is true) and an action (Do this), with a size for buys, shorts and options. Add a rule adds a row, up to 10. The order matters: the first rule that is true and makes sense acts (below).
  5. Set a stop and a target if you want them: the position closes when it moves that % against you or for you, from your entry (0 means none). At most … trades a game day caps how busy it can get.
  6. Choose its news words if it reads the news (optional; below).
  7. Run a backtest under the editor: pick a stock, a candle size, how many candles and how much MB to start with, and press Run. It shows how the rules would have done (below).
  8. Save. A rule the bot can't understand is refused with the place it went wrong, so you can fix it.
  9. Switch it on on its card. The card shows its stocks, how many trades it has made today, its rules in plain words, and What it did: its last 40 actions and what came of each. Switch off, Edit and Delete are on the card too.

How a bot runs

Writing rules

A condition is a small formula that is either true or false. Some examples:

cross_above(close, ema(20)) and rsi(14) < 70
price >= ema(200) or pnl_pct <= -5
news_score > 2 and change(12) > 0
close > highest(20) and volume > volume_sma(20) * 1.5

Every word a rule can use

The candles

WordWhat it is
open high low close volumeThe last finished candle.
priceThe price right now (inside the candle that is still forming).
prev(x, n)Anything x as it was n candles ago (1 to 200): prev(close, 1) is the close before, prev(rsi(14), 3) the RSI three candles back.

Indicators

The numbers in brackets are lengths in candles (1 to 500) and must be plain numbers. Leave one out to get the default shown.

IndicatorWhat it is
sma(n)Simple moving average of the closes over n candles.
ema(n)Exponential moving average: like the SMA, but recent candles count more.
wma(n)Weighted moving average: weights n, n−1, … 1, newest first.
rsi(n=14)Relative strength index, 0 to 100. Below 30 is often called oversold, above 70 overbought.
macd(fast=12, slow=26)The MACD line: ema(fast) − ema(slow).
macd_signal(12, 26, 9)The signal line: an EMA of the MACD line.
macd_hist(12, 26, 9)The histogram: MACD line minus signal line.
atr(n=14)Average true range: how far a candle typically moves, in MB.
bb_upper(n=20, k=2)
bb_mid(n=20)
bb_lower(n=20, k=2)
Bollinger bands: the SMA, and k standard deviations above and below it.
stoch_k(n=14)
stoch_d(n=14, d=3)
Stochastic oscillator, 0 to 100: where the close sits in the range of the last n candles; %D is its d-candle average.
highest(n)
lowest(n)
The highest high and lowest low of the n candles before this one, so a breakout reads close > highest(20).
change(n)The % change of the close over n candles: change(12) > 3 means up more than 3%.
volume_sma(n)Average volume over n candles.
vwap()Volume-weighted average price since the start of the game day (30 real minutes).

Crosses and helpers

WordWhat it is
cross_above(a, b)True on the candle where a went from at or below b to above it.
cross_below(a, b)True on the candle where a went from at or above b to below it.
abs(x) min(a, b) max(a, b)Size without sign, the smaller, the larger.

Your account (for the stock being looked at)

WordWhat it is
positionShares held: positive when long, negative when short, 0 when flat.
long short flat1 (true) or 0 (false).
entryYour average entry price (0 when flat).
pnl_pctThe open position's move from the entry in %, your way: +4 means 4% in your favour, long or short.
cash equityYour free cash, and what the whole account is worth, in MB.
calls putsHow many call or put positions you hold on this stock.

The news

WordWhat it is
news_scoreThe score of this stock's recent headlines, with your words (below).
market_newsThe same for headlines about no single company: the economy, rates, the market.

Actions and sizes

ActionWhat it doesActs only when
BuyOpens a longyou hold none of the stock
SellCloses the whole longyou are long
ShortOpens a shortyou hold none of the stock
CoverCloses the whole shortyou are short
Close the positionCloses a long or a shortyou hold some
Buy calls / Buy putsBuys whole 100-share option contractsyou don't hold a call (or put) on it
Sell its optionsSells every option you hold on the stockyou hold some

News scores

A bot can read the news wire the way you do. Each headline about the stock is scored by adding up the weights of your words that appear in it. Older headlines count less: a headline's score halves every half-life (30 real minutes unless you change it, 1 to 1,440). news_score is the total for the stock; market_news for headlines about no single company.

In the editor, under News words, write one per line: a word or phrase, =, and its weight. A word ending in * matches any word it starts: upgrade* matches "upgraded" and "upgrades". Up to 200 words. Back to the default words restores the starting list:

beat* = 2       raise* = 1.5    record = 1      surge* = 1.5    soar* = 2
jump* = 1       win* = 1.5      upgrade* = 2    approv* = 2     expand* = 1
strong = 1      buyback = 1.5   partnership = 1 contract = 1    rebound* = 1
rall* = 1.5     rescue* = 1.5   above the forecast = 1
miss* = -2      cut* = -1.5     downgrade* = -2 recall* = -2    lawsuit* = -1.5
probe* = -1.5   investigation = -1.5            warn* = -1.5    delay* = -1
fall* = -1      plunge* = -2    slump* = -1.5   weak* = -1      loss* = -1
layoff* = -1    fraud = -3      bankrupt* = -3  default* = -2   resign* = -1
shortage* = -1  offering = -1   dilut* = -1.5   below the forecast = -1

It only reads the headline text, exactly what you could read yourself, never anything hidden behind the prices.

Backtests

A backtest runs the bot over the past: rules at each candle's close, orders filled at the next candle's open, the same fee, leverage with its interest, stops and targets on the candles' highs and lows, options priced the way the game prices them, and the news score from the headlines the stock has kept. It can use up to 2,000 candles of each size (three real days of 1-minute candles).

The result shows the return against just holding the stock, the number of trades, how many won, the average win and loss, the profit factor (money won ÷ money lost), the worst drawdown, the fees, the time in the market, an equity curve and every trade.

A backtest only shows the past. The market has no free money in it: a rule that did well over a few days has usually found luck, not an edge. Try it on several stocks and candle sizes, and be wary of rules tuned until the curve looks perfect.

Examples

EMA trend (the template; 5m candles, stop 3%)

Buy 20%:  flat and cross_above(close, ema(20)) and close > ema(200)
Sell:     long and (close >= ema(200) * 1.03 or cross_below(close, ema(20)))

RSI dip (15m candles, stop 4%, target 6%)

Buy 15%:  flat and rsi(14) < 30 and close > sma(50)
Sell:     long and rsi(14) > 60

Breakout on volume (5m candles, stop 2.5%)

Buy 20%:  flat and close > highest(20) and volume > volume_sma(20) * 1.5
Sell:     long and close < ema(20)

News momentum (1m candles, stop 2%, target 4%, half-life 20)

Buy 10%:   flat and news_score >= 2
Short 10%: flat and news_score <= -2
Close:     not flat and abs(news_score) < 0.5

Calls on good news (1m candles, half-life 30)

Buy calls 20%, 2% out, next close:  calls == 0 and news_score >= 2
Sell its options:                   calls > 0 and news_score < 0

A few more ideas

Buy on a MACD turn:          cross_above(macd(), macd_signal())
Buy a bounce off the band:   close < bb_lower(20, 2) and rsi() < 35
Buy above the VWAP:          cross_above(close, vwap()) and market_news >= 0
Sell before a gain goes:     pnl_pct > 5 and close < prev(low, 1)

Limits

WhatLimit
Bots a player5
Stocks a bot10
Rules a bot10, each at most 300 characters
Candle sizes1m, 5m, 15m, 30m, 1h
Indicator lengths1 to 500 (a running bot sees the last 300 candles)
Trades a game day1 to 500 (30 to start)
Stop / targetup to 90% / up to 1,000%
News words200; half-life 1 to 1,440 real minutes
Backtestsone every 3 seconds; 50 to 5,000 candles

When a bot does nothing