Personal Stock Market Algo Trading Architecture Tips and Tricks and Whatnot

Personal Stock Market Trading Automation

so you want make money wen line go up.

part 1 of N?

Simple Stock Market Theory

The easiest way to understand what motivates stock price movement is a combination of auction and inventory management.

“Auction” means there is a place where buyers and sellers meet to trade. The stock market lists stocks on exchanges where trades happen. There’s actually no whole “stock market,” but rather just a collection of exchanges your broker forwards your order to for execution (and many brokers allow you to target specific exchanges instead of your broker deciding for you, and different exchanges can have different features for placing trades too!). Buyers provide the market with a budget for buying (your bid price) and somebody tells the market how much they are willing to sell for (their ask price) and when the prices meet, your trade executes swapping their sold shares for your bought shares, and now you instantly have responsibility for a new (price * quantity) amount in your account.

You can use a “depth of market” or “Level 2” order book to view the current auction levels on various exchanges. An order book is basically just a data structure where buy requests (bids) are sorted by price from high to low and sell requests (asks) are sorted by price from low to high price (plus also sorted by other magic like time-of-arrival priority and customer priority if there are conflicts at a specific per-price level, and also certain privileged market participants can offer sub-penny increments in standard equities which you probably can’t express directly):

“Inventory” means once you have acquired a stock[^sterm] into your portfolio, the shares acts as “inventory.” (yes, i wrote it that way the first time and it’s too great i’m not editing it out) — Shares of stock operate as any other inventory item in any warehouse for acquisition and disposal: buy low, sell high as dictated by supply and demand.

Also, here we use “stock” to mean any tradeable instrument (unless otherwise clarified) including, but not limited to: stocks, ETFs, ETNs, options, futures, forex/cash, warrants, …

You can think of all stock trading as how ticket scalpers operate: buy up public inventory you think somebody else will pay higher prices for later. That’s it. That’s the entire game. You want to acquire inventory you think will have more value in the future so you can exchange your past decisions for future profit (or, from the short side: sell public inventory you think is overpriced now but somebody will want to buy back for cheaper later).

Some more fun data points: look at this AMD chart where is started a “confirmed uptrend,” but got derailed due to the overall market collapsing, then it resumed its uptrend from a smaller starting point, but with almost exactly the same slope as previously, then it jumps the trend up to the original trend; so here, if you had extrapolated the trend from Sept 25 to Oct 10 and guessed the price three months out, you would have been correct.

Or for a different case, here’s NVDA over almost the same time frame where it didn’t quite resume its September trend yet, but it sure is trying to do something wild currently (it has only jumped from $400 to $500 in two weeks, did nothing for a month, then jumped from $500 to $600 in two weeks again, no big deal).

Methods of Automated Trading

There’s multiple ways to automate your trades depending on your strategy and goals:

  • time-based trading: every month, just buy $X of Y stock or ETF
    • requires: an account with any brokerage platform offering time-based recurring buys. This was a rare feature of brokerages 10 years ago, but most have added auto-deposit-auto-trade-buy-in these days.
    • estimated holding period: unlimited
  • time-based trading with a volatility boost: a more clever approach is using time based buying, but adjust your purchase amount to be more or less aggressive based on the status of the overall market. if prices are currently at average value buy $X, but if price is relatively high, buy less because it’s overpriced, but also if prices are currently low so you think it’s underpriced (“buy the dip”), buy more than your standard buy amount.
    • requires: same as regular time-based trading but your platform should also support a way to configure bounds for “buy more if in decline” versus “buy less if in strong uptrend” versus “buy average amount if price is stable”
    • estimated holding period: unlimited
  • daily rules based rebalancing: you can evaluate more complex metrics or indicators to enter or exit trades at the end of each day based on the overall daily activity (if prices suddenly turned around today in a good way, maybe you want to buy now, or the opposite).
    • estimated holding period: anywhere from 1 day to a couple months for each position
  • near-real-time trading based on your own “algo trading” logic: the most complex strategy requires running your own stock market price tracking logic then having code make decisions throughout the day (or night or whenever) as to when buying or selling is a high probability profitable course of action.
    • estimated holding period: anywhere from 5 seconds to 5 hours, and maybe sometimes a couple weeks
  • hybrid algo trading: any mix of regular trading or algo trading, but you are using automated buy/sell alerts to help your decisions and you manually enter all the trades yourself.

Personal Near Real-Time Algo Trading

The holy grail of every passive income wonk is some set-it-and-forget-it system to generate daily gains compounded forever and then you never need to answer to managers or customers ever again.

The problem with holy grails though: if you are unworthy you get turned to dust instead.

Getting Started

You need some pre-conditions before you begin personal “algo trading” during live market hours:

  • a brokerage account at a broker with a usable API
  • a market data account for receiving real time market data
  • arguably 10+ years of software development experience with servers and various APIs (or else you’ll just automate losing all your money; yes, it’s even possible to buy live stock market instruments which you can’t sell back so if your system goes on an automated buying spree of worthless things you just get stuck)
  • experience managing distributed systems error conditions including data outages, timeouts, idempotent retries, not retrying in a loop forever if an error is false and something is actually executing anyway, …
  • and perhaps most obviously, enough money to actually do it.
    • For futures or forex, you don’t need any account minimums. as long as you can pass an initial margin check per trade, you can transact.
    • For US equity markets you need to always have a minimum of $25,000 of account value or else you get locked out of buying in margin accounts until your account is worth over $25k again (though, practically $25k alone isn’t enough and you’d want $40k+ as a safe buffer because even $0.01 under $25,000 gets your account locked out of buying), but also you can opt for a cash account instead so the $25k limit never applies if you are fine trading your account value only once per day until it gets returned overnight again.

Special attention is needed for some of your initial decisions:

  • there is no common broker API adapter, so your brokerage trade algo adapter agent will be specifically written to the broker you are using. You can’t easily switch broker execution and account management logic between e.g. tradier and IBKR and webull and moomoo and alpaca.
  • your market data feeds can be provided by your broker if they support flexible and reliable data for the symbols you need updates from, or you can also use an external consolidated data provider like polygon.io.

Market Data Considerations

Limit of One

This is a business of money, and money hates giving away things for free. Your market data always has strings attached, and the biggest problem with market data: market data agreements.

You may remember, a long time ago now, stock quotes used to always be “20 minutes delayed” everywhere you would see them. The stock exchanges hate giving out information you could use to make profitable decisions for free, so by default, media could only provide “useless recent history” prices nobody could use for decisions. These days there are some exchanges with IDGAF policies towards putting real time trade updates on display, but you don’t get the full NBBO exposure either unless you pay market providers an excessive amount per month for display fees.

Market data agreements restrict your legal usage and how you can access your market data. The legal market data restrictions are basically:

  • don’t rebroadcast your market data to the public, use it only only for personal systems
  • market data only allows one connection at a time to the upstream data feed

The one connection limit means you can’t have multiple systems reading your market data from multiple programs or services. The only way around the “one connection per market data feed” limit is to write your own custom market data rebroadcasters. You should be familiar with easy ways to write internal pub/sub rebroadcasting services because this will be the least of your architecture problems.

The easiest rebroadcast pattern you can have is writing a primary “market data server” to subscribe to your upstream 1-client-only market data connections, then have your internal “market data server” just copy all upstream inputs to downstream client outputs. Depending on which data feeds you are consuming upstream, your “market data server” could either forward everything or act as a real pub/sub system where each client would subscribe to only a subset of symbols for forwarding. This is all really basic server setup stuff.

Data Outages

No system is perfect, and even though market trading involves money, market data doesn’t have any special gold plated reliability protection stronger than any other online services. Outages happen. Multi-hour, mid-day data outages happen. It’s up to you to figure out how your system should respond when suddenly your algo decision frameworks stop receiving price updates for 90 minutes in the middle of the day. Do you have active positions and your algos are now blind to price movement? Maybe deploy emergency brackets or just evict all your positions until you can see the market again.

You also have to watch out for the worst data outage scenario: your market data service doesn’t disconnect or even show errors but instead, your upstream data provider just stops sending data while the connection remains live. You are left to your own judgment as to workarounds for detecting outages on live connections and how sensitive to data latency your system should be before taking different actions.

Components

So what parts are needed to generate a functional personal automated stock market trading platform?

I think a workable system requires at least five pieces:

  • consolidated market data feed
    • if you have multiple data providers, you should combine them into one common data format and a single network feed for your other systems to read
    • multiple data providers occur under multiple circumstances: maybe futures quotes are from Provider A, but options quotes are on Provider B, and stock quotes are on Provider C — your system should merge all those providers into one easy to consume endpoint with a single data format for clients to consume internally because you’ll have multiple internal systems needing data for all symbols regardless of data source.
  • algo agents
    • agents subscribe to your market data feed to read (timestamp, symbol, price, quantity) for consuming trades or (timestamp, symbol, duration, open, high, low, close, volume, vwap) for consuming pre-generated bars; then your agent uses those inputs to generate your own internal custom duration bars plus all your unique metadata like custom indicators with algo decisions attached.
  • historical price database updated daily
    • I think it’s useful if your system can look back in time a couple days. Is the current volume really high or really low compared to last week? Is the current price near yesterday’s high or yesterday’s low? You can also generate your own internal historical volatility metrics to figure out near-term trending for potential symbols to focus more attention towards.
    • For my own system I maintain a nightly updated local database of all stocks going back 3 years with daily bars and also 3 minute bars for each symbol too.
  • execution agent subscribing to your algo agent decision output
    • an execution agent talks to your broker API for buying / selling / opening / closing trades based on your algo agent decision output.
    • your execution agent is what manages which symbols to trade, your account spending limits, max drawdowns allowed, etc.
  • a backtesting framework
    • there are many public “backtesting frameworks” but if you are building a custom trading system none of them will work for you. You have to build your own backtest framework from the ground up because you will be generating your own custom algo decisions. Your custom backtesting framework can also build out all your custom trade metrics based on historical bars then output reports and charts for how your algos perform against your backtest symbols for all combinations of bar durations and algos and error thresholds.

Given all those pieces, one important consideration is: algo trading doesn’t need to be 100% automated. You can use all those pieces to generate real time signals for you to validate then execute manually.

For hybrid augmented algo/cyborg trading, I like a couple more pieces:

  • a human-readable scrolling output for events happening on each symbol
    • is symbol X trending up or trending down? has symbol X been trending up for 90 seconds and it isn’t stopping? maybe we should look at it?
    • also useful for passively detecting if your market data feeds have problems because your live updates will suddenly stop.
  • an announcer agent
    • the problem with an on-screen data feed is it will be very busy and you have to be looking at it to see when things happen. trend changes often happen quickly (which is where automated agents help), but manually catching quick events when you aren’t staring at a scrolling feed 600 minutes per day is tricky.
    • What helps here? Just have your systems talk to you. “HIGH OF DAY ON AAPL,” “HIGH OF DAY ES,” “LOW OF DAY RTY,” etc. Plus, your announcer can be augmented with daily event announcements throughout the day too since many market movements happen on predictable schedules based around news releases or other markets opening/closing.
    • Another project I haven’t completed yet: a market music generator where, depending on current price movement, we generate background music in the sound of the market (nicer sounds for nicer prices, high bpm aggressive sounds for rapid down movement, etc). The goal is to receive a constant passive feedback about the overall market (or individual instrument/position) without needing to have your watering eyes glued to the screen for ten hours per day. You should be able to take a 5 minute break with your wireless headphones on and still know what the market is doing while you’re away from your screens.

System Outline

I think I’m on my 5th generation custom automated trading system architecture now. The constant refactoring is mostly an artifact of trying to make it more reliable and less prone to getting stuck in bad decisions (automating failure is worse than automating success).

My setup currently looks like:

Broker and Execution API

IBKR

I tried a couple different brokers and they all have their own downsides, so we have to pick the least worst place to bounce money around.

Now I primarily use IBKR because of their extended market algo types like pegged/relative orders and midprice orders and giving easy access to market-on-open/market-on-close order types as well as “helper” market algos like “adaptive fast (urgent)” which does its best to find a “good price” instead of just being an aggressive limit order or dumping direct to market liquidity.

IBKR also provides access to all tradeable asset classes via API from standard stocks and options to futures to forex to warrants and bonds and probably other exotic things.

Downside: the IBKR API requires a local client proxy you have to run and 2FA login to each time (somewhere between once a week to every day depending on if your “weekly authorization token” survives or not) and the Java client proxy program can be fairly buggy without manual fixes like increasing the memory limit manually to 4+ GB if you are doing large API requests for market data. IBKR is also globally known for their poor market data overall, so if you want full backtests on historical data you’re better off using other providers for historical and real time data.

Market Data

IBKR and Polygon and sometimes Tradier

Polygon has the best data APIs I’ve found, but they still aren’t perfect. The week I’m writing this they had a 90 minute mid-day data outage and they apparently weren’t aware of it until I notified them 40 minutes into the outage. They also claim to have full market data but they don’t return overnight data… I haven’t figured out why yet since the market is operating overnight and they claim to support everything, but the data never shows up.

IBKR has data for everything, but they limit you to only subscribing to 100 symbols concurrently unless you pay for “quote booster packs” or maintain excessive account sizes and commission spends. Also they only have two data formats: quotes updating every 250ms or bars updating every 5s.

For my own data agent processing, I just forward the IBKR 5 second bars for futures and some select stocks into my unified market consolidation rebroadcaster (since I’m not subscribing to polygon real time stocks currently, which would be simpler, except polygon doesn’t have futures either).

Algo Agent Server

The algo agent server receives direct market data by connecting to the Market Data server. For each bar (or trade) received, an algo agent is first created then later updated with all new price details.

One important part of trade decisions is the timeframe for your trades and the bar duration you want to consume. Standard bar durations are in intervals of (15 seconds, 1 minute, 5 min, 30 min, 1 hr, 65 min, 4 hr, 1 day, 1 week, etc). Since your Market Data server is sending you direct and unchanged data from your data providers, the job of your Algo Agent Server to generate larger bar durations for your various decisions. Depending on volatility measures, you would want to use different timeframes. If prices are jumping 1% every 30 seconds, you probably don’t want to use 5 minute bars, but if prices are only moving 1% over 4 hours, using 15 second bars will probably ruin you. Detecting proper duration and bounce sensitivity is the primary goal of your entire algo system (because if you knew ahead of time how much something is going to rise or fall it would be much easier deciding your entry and exit points!).

Broker API Execution Agents

Now we have algo agents generating trade decisions from live market data, but how do we execute trades from the algo decisions? How do we decide which symbols to trade? How do we decided which bar durations and algos and error tolerances to trade all combined?

We need to connect our algo agent decisions to our live broker trade execution APIs.

For trading, you can only do two things:

  • buy
  • sell

You can make profit in any direction though, so actually you can:

  • buy to open (enter long)
  • sell to close (exit long)
  • sell to open (enter short)
  • buy to close (exit short)

When using IBKR, their system doesn’t have any designation of “buy/sell to open/close” so you just “buy” or “sell” directly and you’re responsible for maintaining the balance and order of operations of all your active positions. Their system even supports “buy through” or “sell through” if you want to flip sides, so if you have say 100 AAPL shares and you want to sell your 100 share long position and make it short, you can “sell 200 AAPL” and now you end up having -100 AAPL shares.

Your algo agent will generate output in the form of (timestamp, duration, symbol, algos) so your agent needs to be configured to select which data fields to use:

  • which symbol(s) you want to trade
  • which duration(s) for which symbol(s) you want to trade
  • which algos and tolerances for which duration(s) for which symbol(s) you want to trade
  • how much to spend/risk per trade as either a cash amount or a percentage of your available funds based on the margin rate for the symbol(s) you are trading and adjusted for instrument multipliers (e.g. futures typically have 3% margin during RTH while ETFs will have 25% margin and single stocks have 33% margin or worse)
  • which directions you want to trade (are you only trading long (buy->sell) or do you want to trade both long and short (buy->sell; sell->buy) or maybe only short (sell->buy)

Your broker execution agent will only trade what you enable, so you need to provide combinations of matching (symbol, duration, algo, tolerance) at your requested per-trade funding amounts.

Your broker execution agent may also want to be a little smarter where maybe instead of trusting the algo decision to buy immediately, maybe your agent starts by buying 1/5th of the position, then if the position is profitable 30 seconds later, it buys another 1/5th, then continues scaling in up to your total amount. Nothing is quite as annoying as having a good entry signal, dropping your account into it, then the signal reversing 15 seconds later and ending up in an immediate drawdown now working against you. Scale can help the “do we trust it” logic a bit. On the other hand, if prices were excessively depressed and your algo caught the low price imbalance, but now prices rock up from $2 to $20 in 5 minutes, your attempt at “safely” scaling in surrendered your best entry time and now you’re probably holding inventory at ($2, $3, $7, $9) instead of all at $2. On the other other hand, if you were taking a risky $2 entry then it drops to $1, the less risk the better. tradeoffs!

Bonus Agent

One problem you may have noticed already: if we are recording each market data symbol under 5 different time durations, this also means all our indicators and algos and logic will be repeated for each time duration per symbol.

As a concrete example, my current system generates 1,000 algo indicators per symbol (5 durations each with 20 algos and each algo is calculated with 10 different error bounds == 1,000 indicators per symbol), so just subscribing to 80 symbols per day generates 80,000 daily algo indicators for trade decisions. We’ve reached a curse of dimensionality.

So what we actually need is one more layer I call the Prime Agent.

Prime Agent takes all agent data and market data and knows your account balances and risk tolerances then tries to discover on an update-by-update basis the best bar duration as well as the best algo indicator agent inside of the best duration.

Prime Agent is also responsible for live portfolio rebalancing. If your account is fully allocated to 3 stocks each at 33% of your buying power, but one stock starts going up 1% every 10 minutes for the past 30 minutes while the other stocks aren’t moving much anymore, Prime Agent should reallocate your portfolio to hold more of the growing profitable position. Prime Agent can also be responsible for automatically rolling on position protection if something seems risky and de-risking when appropriate too.

Prime Agent is also responsible for real time alerting on market-wide conditions like highs/lows of day or unusual activity happening, which can be useful because if something is reaching a high of day 10 times over and continues reaching more highs of the day… it’s a fairly good signal to just keep going.

Seeing It All

The market data providers SEND you data, which you READ into your consolidated Market Data Server, which your Algo Agents CONSUME, then your Broker Executing APIs CONSUME the output of your Algo Agents.

Something weakly like:

Market Data From {IBKR, Polygon} <- Market Data Server <- Algo Agents <- Broker Executing API Agents

Basically: the local Market Data Rebroadcaster server SUBSCRIBES to Market Data upstream, then the Algo Agent server SUBSCRIBES to your Market Data Rebroadcaster, then your Broker Executing API Agent clients SUBSCRIBE to your Algo Agent server.

Backtest Output Example

Here’s my current backtest report format.

The backtest estimates trading $10k of shares or $10k of options contracts or 1 futures contract per trade and it can trade long or short for equity and futures but only long for options.

The report lets you experience daily disappointment seeing how you could have turned $10k into $300k in a day with the right timing and risk tolerance, but instead of trusting your automation, you manually flipped some small cap from $89 long to $83 exiting for a loss after 10 days of the stock being dead, all while using $200k margin, so then you give up for a month again because you know you can’t trust yourself, but of course, as always happens at max drawdown, over the next 3 days it recovers to $96 all at once so you would have been up 25% in a day instead of down 20% over two weeks if you had only tried your same move 11 days after your first attempt, but now your knees weak arms heavy the buy button hurts too much to try again.

================= TOP-2-BEST-PERFORMING-ALGOS-PER-SYMBOL - bars-2024-01-18.json ===============
                  symbol  time                                     algo  profit_cash     win_cash    fail_cash  wins  losses  Lwins  Swins  trades
0                   AAPL   180      crossover-volstop-ehma-0.5x-1x-2.25      $241.47      $337.36      -$95.89     6       6      3      2      12
1                   AAPL   180      crossover-volstop-ehma-0.5x-1x-2.50      $246.93      $337.36      -$90.43     6       6      3      2      12
2                    AMD   300       crossover-volstop-sma-20x-40x-1.25      $443.69      $450.49       -$6.80     5       1      2      1       6
3                    AMD   180      crossover-volstop-thma-0.5x-1x-1.75      $473.43      $601.35     -$127.92     7       3      2      1      10
4                   AMZN   180                              ema-0.5x-1x       $75.16       $75.16        $0.00     1       0      1      0       1
5                   AMZN   300                               ehma-1x-2x       $79.08       $84.00       -$4.92     1       1      1      0       2
6                   AVGO   180                               ehma-1x-2x      $243.26      $243.26        $0.00     3       0      2      1       3
7                   AVGO    55                             volstop-5.25      $243.34      $280.64      -$37.30     3       1      2      1       4
8                   CELH    55                         temathma-0.5x-1x      $366.55      $580.53     -$213.98     8       6      4      4      14
9                   CELH   300        crossover-volstop-sma-5x-10x-1.00      $372.25      $479.77     -$107.52     5       6      2      1      11
10                  COPX   300                              sma-15x-30x        $7.03       $30.04      -$23.01     1       2      1      0       3
11                  COPX   180                             volstop-5.75       $22.88       $33.04      -$10.16     1       1      1      0       2
12                   CRM    55        crossover-volstop-thma-1x-2x-2.25       $87.43      $247.24     -$159.81    11      11      4      4      22
13                   CRM    35                           temathma-1x-2x      $102.07      $268.43     -$166.36     9       9      5      4      18
14                  CVNA   180      crossover-volstop-thma-0.5x-1x-2.75      $227.42      $269.70      -$42.28     3       2      1      1       5
15                  CVNA   180                             thma-0.5x-1x      $243.25      $281.83      -$38.58     2       2      1      1       4
16                    ES   300       crossover-volstop-sma-0.5x-1x-2.75    $2,203.70    $2,203.70        $0.00     2       0      1      0       2
17                    ES   300       crossover-volstop-sma-0.5x-1x-1.75    $2,203.70    $2,203.70        $0.00     2       0      1      0       2
18                 GOOGL   300                           temathma-1x-2x       $87.04      $105.36      -$18.32     1       2      1      0       3
19                 GOOGL   180                         temathma-1x-1.5x       $87.81      $121.60      -$33.79     1       3      1      0       4
20                   IWM   300                             ehma-0.5x-1x      $177.30      $203.52      -$26.22     3       2      2      1       5
21                   IWM   180                             thma-0.5x-1x      $197.22      $209.00      -$11.78     3       1      2      1       4
22                  LULU   180                              sma-20x-30x       $84.45      $115.45      -$31.00     3       1      1      2       4
23                  LULU   180       crossover-volstop-sma-20x-30x-1.25       $85.48      $112.56      -$27.08     5       1      1      2       6
24                  META    35                             volstop-4.50      $125.88      $254.69     -$128.81     8       7      4      4      15
25                  META   180                             volstop-2.75      $150.31      $164.57      -$14.26     5       1      3      2       6
26                  MSFT   180      crossover-volstop-thma-0.5x-1x-2.50       $23.70       $67.40      -$43.70     6       5      2      2      11
27                  MSFT   180      crossover-volstop-thma-0.5x-1x-2.25       $23.80       $76.35      -$52.55     6       6      2      2      12
28                    NQ   180                              ema-0.5x-1x    $4,950.60    $4,950.60        $0.00     1       0      1      0       1
29                    NQ   180      crossover-volstop-ehma-0.5x-1x-3.00    $5,207.20    $7,039.80   -$1,832.60     8       4      6      1      12
30                  NVDA   180         crossover-volstop-sma-1x-2x-3.00      $162.70      $162.70        $0.00     2       0      1      0       2
31                  NVDA   300                             ehma-0.5x-1x      $187.34      $204.20      -$16.86     3       1      2      1       4
32                  ORCL   180       crossover-volstop-sma-20x-30x-3.00      $126.79      $156.18      -$29.39     3       2      2      0       5
33                  ORCL   300                             thma-0.5x-1x      $133.33      $173.23      -$39.90     1       2      1      0       3
34                  PYPL   300                             thma-0.5x-1x      $239.36      $253.00      -$13.64     1       1      1      0       2
35                  PYPL   300                              ema-1x-1.5x      $239.36      $253.00      -$13.64     1       1      1      0       2
36                   QQQ   180      crossover-volstop-ehma-0.5x-1x-2.75      $106.48      $172.25      -$65.77     6       5      3      1      11
37                   QQQ   180      crossover-volstop-ehma-0.5x-1x-2.50      $108.61      $172.27      -$63.66     6       5      3      1      11
38                  RBLX   300       crossover-volstop-sma-10x-20x-1.25      $200.97      $401.83     -$200.86     4       6      2      1      10
39                  RBLX   300       crossover-volstop-sma-10x-20x-1.00      $206.15      $407.01     -$200.86     4       6      2      1      10
40                  ROKU   180       crossover-volstop-sma-20x-30x-2.75      $284.27      $340.12      -$55.85     6       2      2      3       8
41                  ROKU   300       crossover-volstop-sma-10x-20x-2.50      $291.45      $354.44      -$62.99     6       1      2      2       7
42                   RTY   300                             ehma-0.5x-1x    $2,308.00    $2,591.80     -$283.80     3       2      2      1       5
43                   RTY   300      crossover-volstop-ehma-0.5x-1x-3.00    $2,314.20    $2,543.00     -$228.80     5       2      2      1       7
44                  SHOP   180                               ehma-1x-2x      $260.35      $286.99      -$26.64     2       2      1      1       4
45                  SHOP   180                             thma-0.5x-1x      $353.50      $360.99       -$7.49     2       1      1      1       3
46                  SNOW    55                         temathma-0.5x-1x      $550.34      $661.30     -$110.96     8       5      4      4      13
47                  SNOW    35                           temathma-1x-2x      $571.02      $645.03      -$74.01     8       7      4      4      15
48                  SPOT   180      crossover-volstop-ehma-1x-1.5x-2.25      $390.77      $408.04      -$17.27     6       1      2      1       7
49                  SPOT    35                             volstop-2.25      $397.37      $647.28     -$249.91    11      13      8      3      24
50   SPXW240118C04700000    15  crossover-volstop-temathma-1x-1.5x-2.25    $4,273.40    $4,273.40        $0.00     4       0      2      0       4
51   SPXW240118C04700000    15  crossover-volstop-temathma-1x-1.5x-2.00    $4,273.40    $4,273.40        $0.00     4       0      2      0       4
52   SPXW240118C04710000    55                             ehma-1x-1.5x    $6,088.60    $6,088.60        $0.00     1       0      1      0       1
53   SPXW240118C04710000    35                               thma-1x-2x    $6,748.60    $6,748.60        $0.00     1       0      1      0       1
54   SPXW240118C04720000    35                               sma-5x-10x   $12,036.60   $16,018.20   -$3,981.60     2       4      2      0       6
55   SPXW240118C04720000    15                               sma-5x-10x   $12,566.60   $17,178.20   -$4,611.60     2       4      2      0       6
56   SPXW240118C04730000    55                             volstop-1.75   $22,605.60   $30,850.00   -$8,244.40     5       6      5      0      11
57   SPXW240118C04730000   180                             volstop-2.00   $23,987.20   $31,010.00   -$7,022.80     5       2      5      0       7
58   SPXW240118C04740000    15                                ema-1x-2x   $42,564.80   $51,246.00   -$8,681.20     5       3      5      0       8
59   SPXW240118C04740000   300                             volstop-6.00   $46,812.40   $52,152.80   -$5,340.40     3       1      3      0       4
60   SPXW240118C04750000   300                             volstop-4.25   $75,566.00   $83,456.80   -$7,890.80     3       2      3      0       5
61   SPXW240118C04750000    55                         temathma-1x-1.5x   $85,071.60   $96,491.80  -$11,420.20     3       3      3      0       6
62   SPXW240118C04760000    35                              sma-20x-30x  $120,741.20  $141,669.40  -$20,928.20     9       8      9      0      17
63   SPXW240118C04760000    15                             volstop-5.00  $131,469.80  $152,993.40  -$21,523.60     9       9      9      0      18
64   SPXW240118C04770000    55                             thma-1x-1.5x  $136,169.80  $155,505.20  -$19,335.40     7       6      7      0      13
65   SPXW240118C04770000    15                         total-since-0.50  $214,661.60  $214,661.60        $0.00     1       0      1      0       1
66   SPXW240118C04780000    15                             volstop-3.50   $35,268.60   $68,097.20  -$32,828.60    17      15     17      0      32
67   SPXW240118C04780000    55                             volstop-1.25   $40,025.80   $74,316.60  -$34,290.80    16      20     16      0      36
68   SPXW240118C04790000   180       crossover-volstop-sma-15x-30x-3.00   $12,462.60   $14,707.00   -$2,244.40     5       1      1      0       6
69   SPXW240118C04790000   180                             ehma-0.5x-1x   $19,436.20   $22,195.60   -$2,759.40     1       1      1      0       2
70   SPXW240118C04800000   180       crossover-volstop-ema-1x-1.5x-2.50    $1,942.60    $1,942.60        $0.00     1       0      1      0       1
71   SPXW240118C04800000    55                         temathma-1x-1.5x    $2,827.60    $2,827.60        $0.00     1       0      1      0       1
72   SPXW240118P04680000    55        crossover-volstop-sma-5x-10x-2.00      $679.60      $679.60        $0.00     1       0      0      0       1
73   SPXW240118P04680000    55        crossover-volstop-sma-5x-10x-2.25      $679.60      $679.60        $0.00     1       0      0      0       1
74   SPXW240118P04690000   300       crossover-volstop-sma-20x-30x-1.75      $475.60      $475.60        $0.00     1       0      0      0       1
75   SPXW240118P04690000    55      crossover-volstop-ehma-1x-1.5x-1.25    $1,095.80    $1,095.80        $0.00     3       0      1      0       3
76   SPXW240118P04700000   300        crossover-volstop-sma-5x-10x-1.25      $876.60    $5,058.20   -$4,181.60     2       4      0      0       6
77   SPXW240118P04700000   300        crossover-volstop-sma-5x-10x-1.00    $1,397.60    $5,234.20   -$3,836.60     2       4      0      0       6
78   SPXW240118P04710000   300       crossover-volstop-sma-10x-20x-1.00    $2,986.80    $4,777.20   -$1,790.40     2       1      0      0       3
79   SPXW240118P04710000   180      crossover-volstop-thma-1x-1.5x-1.00    $9,155.20    $9,155.20        $0.00     2       0      1      0       2
80   SPXW240118P04720000   180       crossover-volstop-sma-15x-30x-1.00   $10,296.80   $10,534.80     -$238.00     3       1      1      0       4
81   SPXW240118P04720000   300       crossover-volstop-sma-15x-30x-1.50   $11,687.40   $12,636.80     -$949.40     3       1      0      0       4
82   SPXW240118P04730000    55       crossover-volstop-sma-20x-40x-2.50   $18,557.20   $31,358.80  -$12,801.60     8       4      1      0      12
83   SPXW240118P04730000    15                              sma-1x-1.5x   $18,579.80   $65,916.80  -$47,337.00    13      20     13      0      33
84   SPXW240118P04740000    55        crossover-volstop-sma-5x-10x-2.25   $19,618.60   $50,926.00  -$31,307.40    15      16     10      0      31
85   SPXW240118P04740000    55        crossover-volstop-sma-5x-10x-2.50   $23,282.40   $50,836.00  -$27,553.60    15      14     11      0      29
86   SPXW240118P04750000    55       crossover-volstop-sma-20x-40x-2.00   $18,520.60   $21,854.80   -$3,334.20     8       3      2      0      11
87   SPXW240118P04750000    55       crossover-volstop-sma-20x-40x-1.75   $19,160.20   $22,849.80   -$3,689.60     8       4      1      0      12
88   SPXW240118P04760000    15       crossover-volstop-ema-0.5x-1x-2.00   $27,943.00   $51,790.20  -$23,847.20    27      25     13      0      52
89   SPXW240118P04760000    15       crossover-volstop-ema-0.5x-1x-2.25   $28,169.80   $51,972.20  -$23,802.40    27      22     13      0      49
90   SPXW240118P04770000    55        crossover-volstop-sma-5x-10x-1.25   $10,283.20   $23,574.80  -$13,291.60    14       8      4      0      22
91   SPXW240118P04770000   180                    grab-and-go-vwap-1.50   $10,771.60   $18,184.60   -$7,413.00     6       5      2      0      11
92   SPXW240118P04780000    15       crossover-volstop-sma-10x-20x-3.00   $11,274.40   $23,783.80  -$12,509.40     8       6      3      0      14
93   SPXW240118P04780000    15       crossover-volstop-sma-10x-20x-2.75   $11,274.40   $23,783.80  -$12,509.40     8       6      3      0      14
94   SPXW240118P04790000    15    crossover-volstop-temathma-1x-2x-2.00    $8,260.40   $11,748.00   -$3,487.60     5       4      3      0       9
95   SPXW240118P04790000    15    crossover-volstop-temathma-1x-2x-2.25    $8,786.00   $12,313.60   -$3,527.60     6       4      3      0      10
96   SPXW240118P04800000    35       crossover-volstop-ema-1x-1.5x-1.50    $3,014.20    $3,077.60      -$63.40     1       1      1      0       2
97   SPXW240118P04800000    15        crossover-volstop-sma-5x-10x-2.50    $3,333.00    $7,758.40   -$4,425.40     4       7      1      0      11
98   SPXW240118P04810000    15      crossover-volstop-ehma-1x-1.5x-2.00   -$2,013.40        $0.00   -$2,013.40     0       1      0      0       1
99   SPXW240118P04810000    15      crossover-volstop-ehma-1x-1.5x-1.00   -$2,013.40        $0.00   -$2,013.40     0       1      0      0       1
100  SPXW240118P04820000    35      crossover-volstop-thma-0.5x-1x-1.25    $1,069.80    $1,523.20     -$453.40     2       1      0      0       3
101  SPXW240118P04820000    35      crossover-volstop-thma-0.5x-1x-1.00    $1,069.80    $1,523.20     -$453.40     2       1      0      0       3
102                  SPY   180         crossover-volstop-sma-1x-2x-2.25       $63.65       $63.65        $0.00     2       0      1      0       2
103                  SPY   180       crossover-volstop-sma-1x-1.5x-2.25       $63.65       $63.65        $0.00     2       0      1      0       2
104                 TSLA   180                    grab-and-go-vwap-3.00      $446.72      $446.72        $0.00     6       0      2      2       6
105                 TSLA    55                                sma-1x-2x      $473.21      $473.21        $0.00     4       0      2      2       4
106                  TSM   180                              ema-0.5x-1x      $438.86      $438.86        $0.00     1       0      1      0       1
107                  TSM   180                                ema-1x-2x      $438.86      $438.86        $0.00     1       0      1      0       1
108                  WMT   180  crossover-volstop-temathma-1x-1.5x-1.50       $73.53      $107.82      -$34.29     1       1      1      0       2
109                  WMT   180  crossover-volstop-temathma-1x-1.5x-1.25       $75.39      $109.68      -$34.29     1       1      1      0       2
110                  XBI   300       crossover-volstop-sma-15x-30x-3.00      $224.11      $244.11      -$20.00     4       2      1      2       6
111                  XBI   180                              sma-15x-30x      $253.89      $283.42      -$29.53     2       2      1      1       4
112                  XLK    55                             volstop-5.25      $143.77      $177.54      -$33.77     3       2      2      1       5
113                  XLK    35                                ema-1x-2x      $156.77      $156.77        $0.00     3       0      2      1       3
================= TOP-2-BEST-PERFORMING-ALGOS-PER-SYMBOL - bars-2024-01-19.json ===============
                  symbol  time                                     algo  profit_cash     win_cash    fail_cash  wins  losses  Lwins  Swins  trades
0                   AAPL   300                             volstop-2.75       $90.64       $90.64        $0.00     5       0      2      3       5
1                   AAPL   300                             volstop-2.25       $92.62      $102.62      -$10.00     4       1      2      2       5
2                    AMD   180                    grab-and-go-vwap-2.50      $431.47      $620.63     -$189.16     3       7      1      1      10
3                    AMD   180                    grab-and-go-vwap-2.25      $437.07      $643.19     -$206.12     3       8      1      1      11
4                   AMZN   180      crossover-volstop-thma-0.5x-1x-2.25      $104.45      $154.17      -$49.72     5       4      1      2       9
5                   AMZN    55                              ema-0.5x-1x      $145.42      $191.18      -$45.76     4       4      2      2       8
6                   AVGO   300       crossover-volstop-sma-10x-20x-3.00      $374.96      $421.76      -$46.80     2       3      1      0       5
7                   AVGO   300       crossover-volstop-sma-10x-20x-2.75      $374.96      $421.76      -$46.80     2       3      1      0       5
8                   CELH    55                             volstop-5.00    $1,116.15    $1,237.28     -$121.13     1       3      0      1       4
9                   CELH    55                             volstop-5.25    $1,116.15    $1,237.28     -$121.13     1       3      0      1       4
10                  COPX    55                              sma-1x-1.5x      $195.01      $195.01        $0.00     1       0      1      0       1
11                  COPX    55                                sma-1x-2x      $195.01      $195.01        $0.00     1       0      1      0       1
12                   CRM   180       crossover-volstop-sma-20x-40x-2.50       $84.84      $158.16      -$73.32     3       3      2      0       6
13                   CRM   300                    grab-and-go-vwap-1.25       $93.48      $207.04     -$113.56     4       4      2      0       8
14                  CVNA   180       crossover-volstop-sma-10x-20x-1.50      $471.22      $726.72     -$255.50     7       9      2      2      16
15                  CVNA   180       crossover-volstop-sma-10x-20x-1.25      $494.22      $749.72     -$255.50     7       9      2      2      16
16                    ES   180                              ema-0.5x-1x    $2,995.60    $2,995.60        $0.00     1       0      1      0       1
17                    ES   180                    grab-and-go-vwap-2.25    $3,472.90    $3,794.20     -$321.30     7       2      4      1       9
18                 GOOGL   300                              ema-1x-1.5x       $97.90       $97.90        $0.00     1       0      1      0       1
19                 GOOGL   300                              ema-0.5x-1x       $97.90       $97.90        $0.00     1       0      1      0       1
20                   IWM   300       crossover-volstop-sma-20x-40x-3.00       $73.68      $142.08      -$68.40     4       2      2      0       6
21                   IWM   180        crossover-volstop-ehma-1x-2x-1.25       $80.28      $150.46      -$70.18     4       7      1      0      11
22                  LULU    35                              ema-1x-1.5x      $185.16      $205.80      -$20.64     2       2      1      1       4
23                  LULU    35                                ema-1x-2x      $198.20      $198.20        $0.00     2       0      1      1       2
24                  META   180                             volstop-5.25       $93.77      $112.37      -$18.60     2       2      1      1       4
25                  META   180                             volstop-5.00       $93.77      $112.37      -$18.60     2       2      1      1       4
26                  MSFT   180  crossover-volstop-temathma-0.5x-1x-2.50       $92.45      $105.45      -$13.00     4       2      1      1       6
27                  MSFT   180  crossover-volstop-temathma-0.5x-1x-2.75       $92.45      $105.45      -$13.00     4       2      1      1       6
28                    NQ   180                              ema-0.5x-1x    $6,250.60    $6,250.60        $0.00     1       0      1      0       1
29                    NQ   180                              ema-1x-1.5x    $6,250.60    $6,250.60        $0.00     1       0      1      0       1
30                  NVDA   180        crossover-volstop-ehma-1x-2x-1.50      $272.44      $327.41      -$54.97     5       3      1      1       8
31                  NVDA   180                               ehma-1x-2x      $279.13      $359.82      -$80.69     3       2      2      1       5
32                  ORCL   180                               thma-1x-2x       $79.23       $79.23        $0.00     2       0      1      1       2
33                  ORCL   180                         temathma-0.5x-1x       $80.86       $80.86        $0.00     2       0      1      1       2
34                  PYPL   300                             thma-0.5x-1x      $512.06      $534.61      -$22.55     1       1      1      0       2
35                  PYPL    55  crossover-volstop-temathma-1x-1.5x-1.75      $547.47      $859.64     -$312.17    10      15      6      0      25
36                   QQQ   180                              ema-1x-1.5x      $111.31      $111.31        $0.00     1       0      1      0       1
37                   QQQ   180                                ema-1x-2x      $111.31      $111.31        $0.00     1       0      1      0       1
38                  RBLX   300                             volstop-6.50      $110.76      $129.58      -$18.82     1       1      0      1       2
39                  RBLX   300                             volstop-6.75      $110.76      $129.58      -$18.82     1       1      0      1       2
40                  ROKU   180                             thma-0.5x-1x      $332.45      $353.99      -$21.54     2       2      1      1       4
41                  ROKU   180                             ehma-1x-1.5x      $368.77      $422.85      -$54.08     3       1      2      1       4
42                   RTY    55                    grab-and-go-vwap-2.25    $1,344.80    $2,456.40   -$1,111.60    19      14      8      4      33
43                   RTY    55                    grab-and-go-vwap-2.00    $2,023.40    $3,183.80   -$1,160.40    23      16      8      4      39
44                  SHOP   180        crossover-volstop-ehma-1x-2x-3.00      $289.17      $454.07     -$164.90     2       3      1      0       5
45                  SHOP    35                              sma-20x-40x      $296.89      $433.21     -$136.32     3       7      1      2      10
46                  SNOW   300      crossover-volstop-ehma-0.5x-1x-3.00      $191.93      $261.63      -$69.70     2       2      1      1       4
47                  SNOW   300      crossover-volstop-ehma-0.5x-1x-2.25      $269.03      $303.87      -$34.84     3       2      1      1       5
48                  SPOT   180                             thma-0.5x-1x      $151.07      $151.07        $0.00     2       0      1      1       2
49                  SPOT   180                               ehma-1x-2x      $155.79      $176.96      -$21.17     2       1      1      1       3
50   SPXW240119C04700000    15                             volstop-2.50    $4,706.60    $4,706.60        $0.00     1       0      1      0       1
51   SPXW240119C04700000    15                             volstop-2.00    $4,706.60    $4,706.60        $0.00     1       0      1      0       1
52   SPXW240119C04730000    35        crossover-volstop-ehma-1x-2x-2.75    $2,554.60    $2,554.60        $0.00     6       0      3      0       6
53   SPXW240119C04730000    35        crossover-volstop-ehma-1x-2x-2.50    $2,554.60    $2,554.60        $0.00     6       0      3      0       6
54   SPXW240119C04740000    35                             volstop-2.00    $2,156.60    $2,156.60        $0.00     1       0      1      0       1
55   SPXW240119C04740000    35                             volstop-5.00    $2,156.60    $2,156.60        $0.00     1       0      1      0       1
56   SPXW240119C04750000    35                              sma-0.5x-1x    $9,785.20    $9,785.20        $0.00     2       0      2      0       2
57   SPXW240119C04750000   180                               sma-5x-10x    $9,972.80   $10,105.20     -$132.40     2       1      2      0       3
58   SPXW240119C04760000   300                             volstop-6.50   $14,712.20   $14,712.20        $0.00     2       0      2      0       2
59   SPXW240119C04760000   300                             volstop-4.00   $14,712.20   $14,712.20        $0.00     2       0      2      0       2
60   SPXW240119C04770000    55                              sma-20x-40x   $18,739.20   $18,739.20        $0.00     2       0      2      0       2
61   SPXW240119C04770000    15                              sma-20x-30x   $18,998.80   $18,998.80        $0.00     3       0      3      0       3
62   SPXW240119C04780000   300                                ema-1x-2x   $28,632.60   $28,632.60        $0.00     1       0      1      0       1
63   SPXW240119C04780000   300                             volstop-2.50   $29,371.40   $32,648.20   -$3,276.80     2       2      2      0       4
64   SPXW240119C04790000   180                           temathma-1x-2x   $41,366.60   $41,366.60        $0.00     1       0      1      0       1
65   SPXW240119C04790000    55                                ema-1x-2x   $45,104.20   $45,427.60     -$323.40     1       1      1      0       2
66   SPXW240119C04800000   180                              ema-0.5x-1x   $65,415.60   $65,415.60        $0.00     1       0      1      0       1
67   SPXW240119C04800000   180                                ema-1x-2x   $65,415.60   $65,415.60        $0.00     1       0      1      0       1
68   SPXW240119C04810000    55                             volstop-3.75   $93,133.80  $106,078.80  -$12,945.00     8       5      8      0      13
69   SPXW240119C04810000    35                             volstop-5.00   $93,404.60  $105,207.20  -$11,802.60     7       4      7      0      11
70   SPXW240119C04820000    55                                sma-1x-2x  $182,331.40  $192,375.20  -$10,043.80     2       2      2      0       4
71   SPXW240119C04820000   180                             volstop-3.25  $190,791.60  $198,852.00   -$8,060.40     5       1      5      0       6
72   SPXW240119C04830000    35                              ema-0.5x-1x  $194,840.80  $216,170.40  -$21,329.60     4       9      4      0      13
73   SPXW240119C04830000    55                              sma-1x-1.5x  $235,099.00  $247,987.20  -$12,888.20     2       3      2      0       5
74   SPXW240119C04840000    35                              ema-0.5x-1x   $75,278.40   $83,693.20   -$8,414.80     2       3      2      0       5
75   SPXW240119C04840000   180                             ehma-0.5x-1x   $95,018.40  $103,032.80   -$8,014.40     3       1      3      0       4
76   SPXW240119C04850000    55        crossover-volstop-sma-5x-10x-2.75   $21,600.20   $37,806.20  -$16,206.00     7       7      5      0      14
77   SPXW240119C04850000    55        crossover-volstop-sma-5x-10x-2.50   $21,600.20   $37,806.20  -$16,206.00     7       7      5      0      14
78   SPXW240119P04720000    15        crossover-volstop-ehma-1x-2x-2.75   -$2,244.40        $0.00   -$2,244.40     0       1      0      0       1
79   SPXW240119P04720000    15    crossover-volstop-temathma-1x-2x-2.75   -$2,244.40        $0.00   -$2,244.40     0       1      0      0       1
80   SPXW240119P04730000   180       crossover-volstop-sma-20x-40x-1.25      $155.60      $155.60        $0.00     1       0      0      0       1
81   SPXW240119P04730000   180       crossover-volstop-sma-20x-40x-1.50      $155.60      $155.60        $0.00     1       0      0      0       1
82   SPXW240119P04740000   180        crossover-volstop-thma-1x-2x-3.00    $2,414.80    $3,835.20   -$1,420.40     2       1      0      0       3
83   SPXW240119P04740000   180        crossover-volstop-thma-1x-2x-2.75    $2,414.80    $3,835.20   -$1,420.40     2       1      0      0       3
84   SPXW240119P04750000   180                    grab-and-go-vwap-2.25    $5,056.80    $5,056.80        $0.00     3       0      0      0       3
85   SPXW240119P04750000   180                    grab-and-go-vwap-2.50    $5,056.80    $5,056.80        $0.00     3       0      0      0       3
86   SPXW240119P04760000   300      crossover-volstop-ehma-1x-1.5x-2.25    $6,037.20    $6,037.20        $0.00     2       0      1      0       2
87   SPXW240119P04760000   180       crossover-volstop-sma-15x-30x-1.00    $6,466.60    $6,955.00     -$488.40     5       2      2      0       7
88   SPXW240119P04770000   300      crossover-volstop-ehma-1x-1.5x-1.75    $8,261.20    $8,261.20        $0.00     2       0      1      0       2
89   SPXW240119P04770000   180       crossover-volstop-sma-15x-30x-1.00    $9,006.00   $10,181.80   -$1,175.80     3       2      1      0       5
90   SPXW240119P04780000   180        crossover-volstop-thma-1x-2x-2.50   $11,316.80   $11,553.20     -$236.40     2       1      1      0       3
91   SPXW240119P04780000   180        crossover-volstop-thma-1x-2x-2.75   $11,316.80   $11,553.20     -$236.40     2       1      1      0       3
92   SPXW240119P04790000    35         crossover-volstop-sma-1x-2x-3.00    $9,935.60   $11,474.00   -$1,538.40     5       1      1      0       6
93   SPXW240119P04790000    35         crossover-volstop-sma-1x-2x-2.25    $9,935.60   $11,474.00   -$1,538.40     5       1      1      0       6
94   SPXW240119P04800000   300        crossover-volstop-sma-5x-10x-1.00    $9,073.40   $14,593.00   -$5,519.60     5       5      1      0      10
95   SPXW240119P04800000    35       crossover-volstop-sma-0.5x-1x-3.00    $9,504.20   $13,594.80   -$4,090.60     8       4      3      0      12
96   SPXW240119P04810000    55        crossover-volstop-ehma-1x-2x-1.50    $9,259.60   $14,326.40   -$5,066.80     9       2      3      0      11
97   SPXW240119P04810000    55        crossover-volstop-ehma-1x-2x-1.25    $9,489.40   $13,336.20   -$3,846.80     7       2      3      0       9
98   SPXW240119P04820000    15                    grab-and-go-vwap-1.00    $5,932.40    $7,815.00   -$1,882.60     5       4      2      0       9
99   SPXW240119P04820000    15                    grab-and-go-vwap-1.25    $6,412.80    $7,815.00   -$1,402.20     5       3      2      0       8
100  SPXW240119P04830000    35       crossover-volstop-sma-20x-30x-2.50   $11,074.20   $18,491.40   -$7,417.20     4       3      1      0       7
101  SPXW240119P04830000    35       crossover-volstop-sma-20x-30x-1.00   $11,431.20   $18,052.40   -$6,621.20     4       3      1      0       7
102  SPXW240119P04840000    35       crossover-volstop-sma-20x-30x-1.25   $12,389.20   $16,330.00   -$3,940.80    10       2      3      0      12
103  SPXW240119P04840000    35       crossover-volstop-sma-20x-30x-1.50   $12,389.20   $16,330.00   -$3,940.80    10       2      3      0      12
104  SPXW240119P04850000   300                    grab-and-go-vwap-1.00    $5,733.20    $5,733.20        $0.00     2       0      0      0       2
105  SPXW240119P04850000   300                    grab-and-go-vwap-1.25    $5,733.20    $5,733.20        $0.00     2       0      0      0       2
106                  SPY   180                              ema-1x-1.5x       $67.76       $67.76        $0.00     1       0      1      0       1
107                  SPY   180                                ema-1x-2x       $67.76       $67.76        $0.00     1       0      1      0       1
108                 TSLA   180    crossover-volstop-temathma-1x-2x-2.75      $240.25      $253.90      -$13.65     4       1      1      1       5
109                 TSLA   180    crossover-volstop-temathma-1x-2x-3.00      $240.25      $253.90      -$13.65     4       1      1      1       5
110                  TSM   180      crossover-volstop-thma-1x-1.5x-2.75      $244.73      $297.83      -$53.10     3       3      2      0       6
111                  TSM   180      crossover-volstop-thma-1x-1.5x-2.50      $250.33      $297.83      -$47.50     3       3      2      0       6
112                  WMT    35                                ema-1x-2x       $63.06      $100.26      -$37.20     3       2      1      2       5
113                  WMT    55                              sma-20x-40x       $63.98       $94.03      -$30.05     4       4      2      2       8
114                  XBI   300                    grab-and-go-vwap-1.25       $81.56      $158.99      -$77.43     4       4      2      1       8
115                  XBI   300                    grab-and-go-vwap-1.50       $95.20      $158.99      -$63.79     4       3      2      1       7
116                  XLK   300                              ema-0.5x-1x       $98.80      $115.20      -$16.40     1       1      1      0       2
117                  XLK   180       crossover-volstop-sma-15x-30x-1.75      $103.20      $133.20      -$30.00     2       3      1      0       5

because we control the sorting and all the logic, we can also generate reports showing algos having minimum loss instead of only maximum gains — we can see there’s many algo settings which, on a good day, generate no losses and only profit. Of course, this is equivalent to overfitting because we’re throwing 1,000 algo combinations per symbol into the backtest then only reporting the best winners (which we obviously can’t know at the start of the day going in blind).

================= SMALLEST-LOSS-HIGHEST-WIN - bars-2024-01-18.json ===============
                  symbol  time                                     algo  profit_cash     win_cash   fail_cash  wins  losses  Lwins  Swins  trades
0                   AAPL   180       crossover-volstop-sma-0.5x-1x-2.25      $103.79      $103.79       $0.00     2       0      1      0       2
1                   AAPL   180       crossover-volstop-sma-0.5x-1x-2.00      $103.79      $103.79       $0.00     2       0      1      0       2
2                    AMD   300       crossover-volstop-sma-20x-30x-2.25      $372.32      $372.32       $0.00     4       0      2      1       4
3                    AMD   300       crossover-volstop-sma-20x-40x-2.25      $396.91      $396.91       $0.00     5       0      2      1       5
4                   AMZN   180                              ema-0.5x-1x       $75.16       $75.16       $0.00     1       0      1      0       1
5                   AMZN   180                                ema-1x-2x       $75.16       $75.16       $0.00     1       0      1      0       1
6                   AVGO    35                                ema-1x-2x      $239.80      $239.80       $0.00     3       0      2      1       3
7                   AVGO   180                               ehma-1x-2x      $243.26      $243.26       $0.00     3       0      2      1       3
8                   CELH   300         crossover-volstop-ema-1x-2x-1.00       $14.33       $24.33     -$10.00     1       1      0      1       2
9                   CELH   300        crossover-volstop-ehma-1x-2x-1.00       $31.75       $41.75     -$10.00     2       1      0      1       3
10                  COPX   180       crossover-volstop-ema-1x-1.5x-1.50      -$10.00        $0.00     -$10.00     0       1      0      0       1
11                  COPX   180         crossover-volstop-ema-1x-2x-1.50      -$10.00        $0.00     -$10.00     0       1      0      0       1
12                   CRM   180       crossover-volstop-sma-0.5x-1x-2.75       $49.90       $49.90       $0.00     2       0      1      1       2
13                   CRM   180       crossover-volstop-sma-0.5x-1x-3.00       $49.90       $49.90       $0.00     2       0      1      1       2
14                  CVNA   180       crossover-volstop-sma-1x-1.5x-2.00       $65.08       $75.08     -$10.00     2       1      1      0       3
15                  CVNA   180       crossover-volstop-sma-1x-1.5x-1.75       $65.08       $75.08     -$10.00     2       1      1      0       3
16                    ES   300       crossover-volstop-sma-0.5x-1x-2.75    $2,203.70    $2,203.70       $0.00     2       0      1      0       2
17                    ES   300       crossover-volstop-sma-0.5x-1x-1.75    $2,203.70    $2,203.70       $0.00     2       0      1      0       2
18                 GOOGL   180       crossover-volstop-sma-0.5x-1x-3.00       $19.06       $19.06       $0.00     1       0      1      0       1
19                 GOOGL   180                              sma-0.5x-1x       $44.00       $44.00       $0.00     1       0      1      0       1
20                   IWM   300                              sma-20x-30x       $83.20       $83.20       $0.00     3       0      2      1       3
21                   IWM   180                              sma-20x-40x      $163.78      $163.78       $0.00     3       0      2      1       3
22                  LULU   180       crossover-volstop-sma-0.5x-1x-3.00       $56.72       $56.72       $0.00     2       0      1      0       2
23                  LULU   180       crossover-volstop-sma-0.5x-1x-1.50       $56.93       $56.93       $0.00     2       0      1      0       2
24                  META   180       crossover-volstop-sma-0.5x-1x-1.00       $39.82       $39.82       $0.00     2       0      1      0       2
25                  META   180       crossover-volstop-sma-0.5x-1x-1.25       $50.22       $50.22       $0.00     2       0      1      0       2
26                  MSFT   300       crossover-volstop-sma-0.5x-1x-1.25       -$7.40        $4.40     -$11.80     1       1      0      0       2
27                  MSFT   300       crossover-volstop-sma-0.5x-1x-2.25       -$7.40        $4.40     -$11.80     1       1      0      0       2
28                    NQ   180                              ema-0.5x-1x    $4,950.60    $4,950.60       $0.00     1       0      1      0       1
29                    NQ   180                                ema-1x-2x    $4,950.60    $4,950.60       $0.00     1       0      1      0       1
30                  NVDA   180         crossover-volstop-sma-1x-2x-3.00      $162.70      $162.70       $0.00     2       0      1      0       2
31                  NVDA   180       crossover-volstop-sma-1x-1.5x-3.00      $162.70      $162.70       $0.00     2       0      1      0       2
32                  ORCL   180                              sma-0.5x-1x       $40.00       $40.00       $0.00     1       0      1      0       1
33                  ORCL   180       crossover-volstop-sma-0.5x-1x-2.75       $40.00       $40.00       $0.00     1       0      1      0       1
34                  PYPL   180                              sma-1x-1.5x       $76.87       $76.87       $0.00     1       0      1      0       1
35                  PYPL   180                              sma-0.5x-1x      $185.55      $185.55       $0.00     1       0      1      0       1
36                   QQQ   180         crossover-volstop-sma-1x-2x-2.00       $90.32       $90.32       $0.00     2       0      1      0       2
37                   QQQ   180       crossover-volstop-sma-1x-1.5x-2.00       $90.32       $90.32       $0.00     2       0      1      0       2
38                  RBLX   300    crossover-volstop-temathma-1x-2x-2.25       $45.68       $54.20      -$8.52     2       1      1      0       3
39                  RBLX   300    crossover-volstop-temathma-1x-2x-2.50       $45.68       $54.20      -$8.52     2       1      1      0       3
40                  ROKU   180                             volstop-5.75      $254.42      $254.42       $0.00     2       0      1      1       2
41                  ROKU   180                             volstop-5.50      $277.74      $277.74       $0.00     2       0      1      1       2
42                   RTY   300       crossover-volstop-sma-0.5x-1x-2.50    $1,516.20    $1,516.20       $0.00     2       0      1      0       2
43                   RTY   180                             volstop-3.75    $1,922.40    $1,922.40       $0.00     4       0      2      2       4
44                  SHOP   180       crossover-volstop-sma-0.5x-1x-1.25       -$3.46       $14.80     -$18.26     1       1      0      1       2
45                  SHOP   180                             thma-0.5x-1x      $353.50      $360.99      -$7.49     2       1      1      1       3
46                  SNOW   300      crossover-volstop-thma-0.5x-1x-2.50      $184.72      $184.72       $0.00     5       0      2      1       5
47                  SNOW   300      crossover-volstop-thma-0.5x-1x-2.75      $184.72      $184.72       $0.00     5       0      2      1       5
48                  SPOT   180       crossover-volstop-sma-15x-30x-2.50      $222.70      $222.70       $0.00     4       0      2      1       4
49                  SPOT   180       crossover-volstop-sma-15x-30x-2.25      $222.70      $222.70       $0.00     4       0      2      1       4
50   SPXW240118C04700000    15  crossover-volstop-temathma-1x-1.5x-2.25    $4,273.40    $4,273.40       $0.00     4       0      2      0       4
51   SPXW240118C04700000    15  crossover-volstop-temathma-1x-1.5x-2.00    $4,273.40    $4,273.40       $0.00     4       0      2      0       4
52   SPXW240118C04710000    55                             ehma-1x-1.5x    $6,088.60    $6,088.60       $0.00     1       0      1      0       1
53   SPXW240118C04710000    35                               thma-1x-2x    $6,748.60    $6,748.60       $0.00     1       0      1      0       1
54   SPXW240118C04720000    55                              sma-1x-1.5x    $9,268.60    $9,268.60       $0.00     1       0      1      0       1
55   SPXW240118C04720000    55                                sma-1x-2x    $9,268.60    $9,268.60       $0.00     1       0      1      0       1
56   SPXW240118C04730000   300                                ema-1x-2x   $14,300.60   $14,300.60       $0.00     1       0      1      0       1
57   SPXW240118C04730000   300                              ema-1x-1.5x   $14,300.60   $14,300.60       $0.00     1       0      1      0       1
58   SPXW240118C04740000   300                              ema-1x-1.5x   $22,883.60   $22,883.60       $0.00     1       0      1      0       1
59   SPXW240118C04740000   300                         temathma-0.5x-1x   $22,883.60   $22,883.60       $0.00     1       0      1      0       1
60   SPXW240118C04750000   180                              ema-1x-1.5x   $31,728.60   $31,728.60       $0.00     1       0      1      0       1
61   SPXW240118C04750000   180                                ema-1x-2x   $31,728.60   $31,728.60       $0.00     1       0      1      0       1
62   SPXW240118C04760000   180                              sma-1x-1.5x  $105,457.60  $105,457.60       $0.00     1       0      1      0       1
63   SPXW240118C04760000   180                                sma-1x-2x  $105,457.60  $105,457.60       $0.00     1       0      1      0       1
64   SPXW240118C04770000    15                         total-since-0.75  $135,247.60  $135,247.60       $0.00     1       0      1      0       1
65   SPXW240118C04770000    15                         total-since-0.50  $214,661.60  $214,661.60       $0.00     1       0      1      0       1
66   SPXW240118C04780000   180       crossover-volstop-sma-1x-1.5x-1.75   $28,493.20   $28,493.20       $0.00     2       0      1      0       2
67   SPXW240118C04780000   180       crossover-volstop-sma-1x-1.5x-1.25   $28,493.20   $28,493.20       $0.00     2       0      1      0       2
68   SPXW240118C04790000    55                         total-since-0.50   $10,595.20   $10,595.20       $0.00     2       0      1      0       2
69   SPXW240118C04790000   180                             ehma-1x-1.5x   $11,015.60   $11,015.60       $0.00     1       0      1      0       1
70   SPXW240118C04800000   180       crossover-volstop-ema-1x-1.5x-2.50    $1,942.60    $1,942.60       $0.00     1       0      1      0       1
71   SPXW240118C04800000    55                         temathma-1x-1.5x    $2,827.60    $2,827.60       $0.00     1       0      1      0       1
72   SPXW240118P04680000    55        crossover-volstop-sma-5x-10x-2.00      $679.60      $679.60       $0.00     1       0      0      0       1
73   SPXW240118P04680000    55        crossover-volstop-sma-5x-10x-2.25      $679.60      $679.60       $0.00     1       0      0      0       1
74   SPXW240118P04690000   300       crossover-volstop-sma-20x-30x-1.75      $475.60      $475.60       $0.00     1       0      0      0       1
75   SPXW240118P04690000    55      crossover-volstop-ehma-1x-1.5x-1.25    $1,095.80    $1,095.80       $0.00     3       0      1      0       3
76   SPXW240118P04700000   300       crossover-volstop-sma-20x-30x-2.50      $490.60      $490.60       $0.00     1       0      0      0       1
77   SPXW240118P04700000   300       crossover-volstop-sma-20x-30x-2.25      $490.60      $490.60       $0.00     1       0      0      0       1
78   SPXW240118P04710000   180      crossover-volstop-thma-1x-1.5x-2.50    $2,315.60    $2,315.60       $0.00     1       0      1      0       1
79   SPXW240118P04710000   180      crossover-volstop-thma-1x-1.5x-1.00    $9,155.20    $9,155.20       $0.00     2       0      1      0       2
80   SPXW240118P04720000   300      crossover-volstop-thma-0.5x-1x-1.25    $5,401.20    $5,401.20       $0.00     2       0      1      0       2
81   SPXW240118P04720000   300      crossover-volstop-thma-0.5x-1x-1.00    $6,826.20    $6,826.20       $0.00     2       0      1      0       2
82   SPXW240118P04730000   180  crossover-volstop-temathma-1x-1.5x-1.00    $7,215.20    $7,215.20       $0.00     2       0      1      0       2
83   SPXW240118P04730000    35                         total-since-0.50   $13,751.60   $13,751.60       $0.00     1       0      1      0       1
84   SPXW240118P04740000    55                         total-since-1.50    $8,755.60    $8,755.60       $0.00     1       0      1      0       1
85   SPXW240118P04740000    35                         total-since-1.50   $15,898.40   $15,898.40       $0.00     4       0      2      0       4
86   SPXW240118P04750000   180        crossover-volstop-ehma-1x-2x-2.25    $9,765.80    $9,765.80       $0.00     3       0      1      0       3
87   SPXW240118P04750000   300      crossover-volstop-ehma-1x-1.5x-1.25   $10,860.20   $10,860.20       $0.00     2       0      1      0       2
88   SPXW240118P04760000   180      crossover-volstop-thma-0.5x-1x-2.00    $9,757.60    $9,757.60       $0.00     6       0      2      0       6
89   SPXW240118P04760000   180      crossover-volstop-thma-0.5x-1x-1.75   $10,557.60   $10,557.60       $0.00     6       0      2      0       6
90   SPXW240118P04770000   300        crossover-volstop-thma-1x-2x-1.25    $8,092.80    $8,092.80       $0.00     3       0      1      0       3
91   SPXW240118P04770000   300        crossover-volstop-thma-1x-2x-1.50    $8,092.80    $8,092.80       $0.00     3       0      1      0       3
92   SPXW240118P04780000   180                    grab-and-go-vwap-3.00    $5,796.40    $5,796.40       $0.00     4       0      0      0       4
93   SPXW240118P04780000   180                    grab-and-go-vwap-2.75    $5,796.40    $5,796.40       $0.00     4       0      0      0       4
94   SPXW240118P04790000    15         crossover-volstop-ema-1x-2x-2.00    $2,882.40    $2,882.40       $0.00     4       0      2      0       4
95   SPXW240118P04790000    15         crossover-volstop-ema-1x-2x-1.00    $2,908.80    $2,908.80       $0.00     3       0      2      0       3
96   SPXW240118P04800000   300      crossover-volstop-ehma-1x-1.5x-1.75    $2,357.20    $2,357.20       $0.00     2       0      1      0       2
97   SPXW240118P04800000   300      crossover-volstop-ehma-1x-1.5x-1.25    $2,357.20    $2,357.20       $0.00     2       0      1      0       2
98   SPXW240118P04810000    15      crossover-volstop-ehma-1x-1.5x-2.00   -$2,013.40        $0.00  -$2,013.40     0       1      0      0       1
99   SPXW240118P04810000    15      crossover-volstop-ehma-1x-1.5x-1.00   -$2,013.40        $0.00  -$2,013.40     0       1      0      0       1
100  SPXW240118P04820000   180                    grab-and-go-vwap-3.00      $341.60      $341.60       $0.00     1       0      0      0       1
101  SPXW240118P04820000   300                    grab-and-go-vwap-3.00      $341.60      $341.60       $0.00     1       0      0      0       1
102                  SPY   180         crossover-volstop-sma-1x-2x-2.25       $63.65       $63.65       $0.00     2       0      1      0       2
103                  SPY   180       crossover-volstop-sma-1x-1.5x-2.25       $63.65       $63.65       $0.00     2       0      1      0       2
104                 TSLA   180                    grab-and-go-vwap-3.00      $446.72      $446.72       $0.00     6       0      2      2       6
105                 TSLA    55                                sma-1x-2x      $473.21      $473.21       $0.00     4       0      2      2       4
106                  TSM   180                              ema-0.5x-1x      $438.86      $438.86       $0.00     1       0      1      0       1
107                  TSM   180                                ema-1x-2x      $438.86      $438.86       $0.00     1       0      1      0       1
108                  WMT   180                             thma-1x-1.5x       $60.54       $84.78     -$24.24     1       1      1      0       2
109                  WMT   180                         temathma-1x-1.5x       $67.20       $87.72     -$20.52     1       1      1      0       2
110                  XBI   180       crossover-volstop-sma-0.5x-1x-1.00       $20.90       $20.90       $0.00     1       0      0      1       1
111                  XBI   300                             volstop-6.75      $183.39      $183.39       $0.00     1       0      0      1       1
112                  XLK    55                             volstop-6.50       $75.12       $75.12       $0.00     2       0      1      1       2
113                  XLK    35                                ema-1x-2x      $156.77      $156.77       $0.00     3       0      2      1       3
================= SMALLEST-LOSS-HIGHEST-WIN - bars-2024-01-19.json ===============
                  symbol  time                                   algo  profit_cash     win_cash   fail_cash  wins  losses  Lwins  Swins  trades
0                   AAPL   300                           volstop-2.75       $90.64       $90.64       $0.00     5       0      2      3       5
1                   AAPL   300                           volstop-2.50       $90.64       $90.64       $0.00     5       0      2      3       5
2                    AMD   180                            sma-1x-1.5x      $321.78      $321.78       $0.00     1       0      1      0       1
3                    AMD   180                              sma-1x-2x      $321.78      $321.78       $0.00     1       0      1      0       1
4                   AMZN   300     crossover-volstop-sma-0.5x-1x-1.00      -$11.03        $0.00     -$11.03     0       1      0      0       1
5                   AMZN   180     crossover-volstop-ema-0.5x-1x-1.75        $8.45       $15.45      -$7.00     3       1      2      0       4
6                   AVGO   180                       temathma-1x-1.5x      $303.10      $303.10       $0.00     1       0      1      0       1
7                   AVGO   180                         temathma-1x-2x      $303.10      $303.10       $0.00     1       0      1      0       1
8                   CELH   300                           volstop-4.75    $1,019.70    $1,019.70       $0.00     1       0      0      1       1
9                   CELH   180                           volstop-6.75    $1,019.70    $1,019.70       $0.00     1       0      0      1       1
10                  COPX    55                            sma-1x-1.5x      $195.01      $195.01       $0.00     1       0      1      0       1
11                  COPX    55                              sma-1x-2x      $195.01      $195.01       $0.00     1       0      1      0       1
12                   CRM   180     crossover-volstop-sma-0.5x-1x-1.25       $43.55       $43.55       $0.00     1       0      1      0       1
13                   CRM   180     crossover-volstop-sma-0.5x-1x-1.00       $43.55       $43.55       $0.00     1       0      1      0       1
14                  CVNA   300                            sma-0.5x-1x      -$10.00        $0.00     -$10.00     0       1      0      0       1
15                  CVNA   180     crossover-volstop-sma-0.5x-1x-1.75      $109.68      $119.68     -$10.00     2       1      1      0       3
16                    ES   180                            ema-0.5x-1x    $2,995.60    $2,995.60       $0.00     1       0      1      0       1
17                    ES   180                            ema-1x-1.5x    $2,995.60    $2,995.60       $0.00     1       0      1      0       1
18                 GOOGL   300                            ema-1x-1.5x       $97.90       $97.90       $0.00     1       0      1      0       1
19                 GOOGL   300                            ema-0.5x-1x       $97.90       $97.90       $0.00     1       0      1      0       1
20                   IWM   180     crossover-volstop-sma-0.5x-1x-2.75       $25.75       $25.75       $0.00     3       0      1      1       3
21                   IWM   180     crossover-volstop-sma-0.5x-1x-2.25       $30.95       $30.95       $0.00     3       0      1      1       3
22                  LULU    55                            ema-0.5x-1x      $171.56      $171.56       $0.00     2       0      1      1       2
23                  LULU    35                              ema-1x-2x      $198.20      $198.20       $0.00     2       0      1      1       2
24                  META   300     crossover-volstop-sma-0.5x-1x-2.00       $16.00       $16.00       $0.00     2       0      1      0       2
25                  META   300     crossover-volstop-sma-0.5x-1x-2.25       $16.00       $16.00       $0.00     2       0      1      0       2
26                  MSFT   300                            sma-0.5x-1x        $0.60        $0.60       $0.00     1       0      0      1       1
27                  MSFT   180  crossover-volstop-temathma-1x-2x-1.25       $46.90       $53.70      -$6.80     2       1      1      1       3
28                    NQ   180                            ema-0.5x-1x    $6,250.60    $6,250.60       $0.00     1       0      1      0       1
29                    NQ   180                            ema-1x-1.5x    $6,250.60    $6,250.60       $0.00     1       0      1      0       1
30                  NVDA   180                              ema-1x-2x      $194.37      $194.37       $0.00     1       0      1      0       1
31                  NVDA   180                            ema-1x-1.5x      $194.37      $194.37       $0.00     1       0      1      0       1
32                  ORCL   180                             thma-1x-2x       $79.23       $79.23       $0.00     2       0      1      1       2
33                  ORCL   180                       temathma-0.5x-1x       $80.86       $80.86       $0.00     2       0      1      1       2
34                  PYPL    55                              ema-1x-2x      $473.04      $473.04       $0.00     1       0      1      0       1
35                  PYPL    55                            ema-1x-1.5x      $473.04      $473.04       $0.00     1       0      1      0       1
36                   QQQ   180                            ema-1x-1.5x      $111.31      $111.31       $0.00     1       0      1      0       1
37                   QQQ   180                              ema-1x-2x      $111.31      $111.31       $0.00     1       0      1      0       1
38                  RBLX   180     crossover-volstop-sma-0.5x-1x-2.50       -$6.98        $0.00      -$6.98     0       1      0      0       1
39                  RBLX   180     crossover-volstop-sma-0.5x-1x-2.25       -$6.98        $0.00      -$6.98     0       1      0      0       1
40                  ROKU   180    crossover-volstop-thma-1x-1.5x-2.25      $245.10      $245.10       $0.00     3       0      2      1       3
41                  ROKU   180    crossover-volstop-thma-1x-1.5x-2.75      $290.94      $290.94       $0.00     4       0      2      1       4
42                   RTY   300                         temathma-1x-2x    $1,070.60    $1,070.60       $0.00     1       0      1      0       1
43                   RTY   300                            ema-1x-1.5x    $1,070.60    $1,070.60       $0.00     1       0      1      0       1
44                  SHOP   180     crossover-volstop-sma-1x-1.5x-1.00       $35.45       $35.45       $0.00     2       0      1      0       2
45                  SHOP   180       crossover-volstop-sma-1x-2x-1.00       $35.45       $35.45       $0.00     2       0      1      0       2
46                  SNOW   180       crossover-volstop-sma-1x-2x-2.00        $3.80        $3.80       $0.00     1       0      1      0       1
47                  SNOW   180       crossover-volstop-sma-1x-2x-1.00        $3.80        $3.80       $0.00     1       0      1      0       1
48                  SPOT   300                           ehma-0.5x-1x      $148.46      $148.46       $0.00     2       0      1      1       2
49                  SPOT   180                           thma-0.5x-1x      $151.07      $151.07       $0.00     2       0      1      1       2
50   SPXW240119C04700000    15                           volstop-2.50    $4,706.60    $4,706.60       $0.00     1       0      1      0       1
51   SPXW240119C04700000    15                           volstop-2.00    $4,706.60    $4,706.60       $0.00     1       0      1      0       1
52   SPXW240119C04730000    35      crossover-volstop-ehma-1x-2x-2.75    $2,554.60    $2,554.60       $0.00     6       0      3      0       6
53   SPXW240119C04730000    35      crossover-volstop-ehma-1x-2x-2.50    $2,554.60    $2,554.60       $0.00     6       0      3      0       6
54   SPXW240119C04740000    35                           volstop-2.00    $2,156.60    $2,156.60       $0.00     1       0      1      0       1
55   SPXW240119C04740000    35                           volstop-5.00    $2,156.60    $2,156.60       $0.00     1       0      1      0       1
56   SPXW240119C04750000   180                            sma-10x-20x    $9,597.60    $9,597.60       $0.00     1       0      1      0       1
57   SPXW240119C04750000    35                            sma-0.5x-1x    $9,785.20    $9,785.20       $0.00     2       0      2      0       2
58   SPXW240119C04760000   300                           volstop-6.50   $14,712.20   $14,712.20       $0.00     2       0      2      0       2
59   SPXW240119C04760000   300                           volstop-4.00   $14,712.20   $14,712.20       $0.00     2       0      2      0       2
60   SPXW240119C04770000    55                            sma-20x-40x   $18,739.20   $18,739.20       $0.00     2       0      2      0       2
61   SPXW240119C04770000    15                            sma-20x-30x   $18,998.80   $18,998.80       $0.00     3       0      3      0       3
62   SPXW240119C04780000   300                              ema-1x-2x   $28,632.60   $28,632.60       $0.00     1       0      1      0       1
63   SPXW240119C04780000   300                             ehma-1x-2x   $28,632.60   $28,632.60       $0.00     1       0      1      0       1
64   SPXW240119C04790000   180                         temathma-1x-2x   $41,366.60   $41,366.60       $0.00     1       0      1      0       1
65   SPXW240119C04790000   180                            ema-1x-1.5x   $41,366.60   $41,366.60       $0.00     1       0      1      0       1
66   SPXW240119C04800000   180                            ema-0.5x-1x   $65,415.60   $65,415.60       $0.00     1       0      1      0       1
67   SPXW240119C04800000   180                              ema-1x-2x   $65,415.60   $65,415.60       $0.00     1       0      1      0       1
68   SPXW240119C04810000   180                            ema-1x-1.5x   $83,518.60   $83,518.60       $0.00     1       0      1      0       1
69   SPXW240119C04810000   180                              ema-1x-2x   $83,518.60   $83,518.60       $0.00     1       0      1      0       1
70   SPXW240119C04820000   300     crossover-volstop-sma-20x-40x-2.75  $118,729.20  $118,729.20       $0.00     2       0      2      0       2
71   SPXW240119C04820000   300     crossover-volstop-sma-20x-40x-3.00  $118,729.20  $118,729.20       $0.00     2       0      2      0       2
72   SPXW240119C04830000   180                            sma-1x-1.5x  $118,195.60  $118,195.60       $0.00     1       0      1      0       1
73   SPXW240119C04830000   180                              sma-1x-2x  $118,195.60  $118,195.60       $0.00     1       0      1      0       1
74   SPXW240119C04840000    55                        multiplier-1.50   $35,119.20   $35,119.20       $0.00     2       0      1      0       2
75   SPXW240119C04840000   180                       total-since-0.50   $55,920.80   $55,920.80       $0.00     3       0      2      0       3
76   SPXW240119C04850000    55                       total-since-0.50   $16,466.60   $16,466.60       $0.00     1       0      1      0       1
77   SPXW240119C04850000    35                       total-since-0.50   $16,466.60   $16,466.60       $0.00     1       0      1      0       1
78   SPXW240119P04720000    15      crossover-volstop-ehma-1x-2x-2.75   -$2,244.40        $0.00  -$2,244.40     0       1      0      0       1
79   SPXW240119P04720000    15  crossover-volstop-temathma-1x-2x-2.75   -$2,244.40        $0.00  -$2,244.40     0       1      0      0       1
80   SPXW240119P04730000   180     crossover-volstop-sma-20x-40x-1.25      $155.60      $155.60       $0.00     1       0      0      0       1
81   SPXW240119P04730000   180     crossover-volstop-sma-20x-40x-1.50      $155.60      $155.60       $0.00     1       0      0      0       1
82   SPXW240119P04740000   300    crossover-volstop-ehma-1x-1.5x-2.00    $2,267.60    $2,267.60       $0.00     1       0      0      0       1
83   SPXW240119P04740000   300    crossover-volstop-ehma-1x-1.5x-2.50    $2,267.60    $2,267.60       $0.00     1       0      0      0       1
84   SPXW240119P04750000   180                  grab-and-go-vwap-2.25    $5,056.80    $5,056.80       $0.00     3       0      0      0       3
85   SPXW240119P04750000   180                  grab-and-go-vwap-2.50    $5,056.80    $5,056.80       $0.00     3       0      0      0       3
86   SPXW240119P04760000   300    crossover-volstop-ehma-1x-1.5x-2.25    $6,037.20    $6,037.20       $0.00     2       0      1      0       2
87   SPXW240119P04760000   300    crossover-volstop-ehma-1x-1.5x-1.00    $6,037.20    $6,037.20       $0.00     2       0      1      0       2
88   SPXW240119P04770000   300    crossover-volstop-ehma-1x-1.5x-1.75    $8,261.20    $8,261.20       $0.00     2       0      1      0       2
89   SPXW240119P04770000   300    crossover-volstop-ehma-1x-1.5x-1.00    $8,261.20    $8,261.20       $0.00     2       0      1      0       2
90   SPXW240119P04780000   300    crossover-volstop-ehma-1x-1.5x-1.75    $9,542.20    $9,542.20       $0.00     2       0      1      0       2
91   SPXW240119P04780000   300    crossover-volstop-ehma-1x-1.5x-1.25    $9,542.20    $9,542.20       $0.00     2       0      1      0       2
92   SPXW240119P04790000   180     crossover-volstop-sma-20x-30x-3.00    $6,287.60    $6,287.60       $0.00     6       0      2      0       6
93   SPXW240119P04790000   180     crossover-volstop-sma-20x-30x-1.00    $7,739.40    $7,739.40       $0.00     4       0      2      0       4
94   SPXW240119P04800000    55       crossover-volstop-sma-1x-2x-3.00    $1,450.80    $1,450.80       $0.00     3       0      1      0       3
95   SPXW240119P04800000    55       crossover-volstop-sma-1x-2x-2.50    $1,450.80    $1,450.80       $0.00     3       0      1      0       3
96   SPXW240119P04810000   180     crossover-volstop-ema-0.5x-1x-1.50    $4,209.80    $4,209.80       $0.00     3       0      1      0       3
97   SPXW240119P04810000   180     crossover-volstop-ema-0.5x-1x-1.25    $4,209.80    $4,209.80       $0.00     3       0      1      0       3
98   SPXW240119P04820000   180     crossover-volstop-sma-0.5x-1x-3.00    $4,509.60    $4,509.60       $0.00     1       0      0      0       1
99   SPXW240119P04820000   180     crossover-volstop-sma-0.5x-1x-2.75    $4,509.60    $4,509.60       $0.00     1       0      0      0       1
100  SPXW240119P04830000    35                       total-since-2.25    $3,089.60    $3,089.60       $0.00     1       0      1      0       1
101  SPXW240119P04830000    15                       total-since-2.25    $4,109.60    $4,109.60       $0.00     1       0      1      0       1
102  SPXW240119P04840000    55       crossover-volstop-sma-1x-2x-1.00    $1,297.60    $1,297.60       $0.00     1       0      0      0       1
103  SPXW240119P04840000    55     crossover-volstop-sma-1x-1.5x-1.00    $1,297.60    $1,297.60       $0.00     1       0      0      0       1
104  SPXW240119P04850000   300                  grab-and-go-vwap-1.00    $5,733.20    $5,733.20       $0.00     2       0      0      0       2
105  SPXW240119P04850000   300                  grab-and-go-vwap-1.25    $5,733.20    $5,733.20       $0.00     2       0      0      0       2
106                  SPY   180                            ema-1x-1.5x       $67.76       $67.76       $0.00     1       0      1      0       1
107                  SPY   180                              ema-1x-2x       $67.76       $67.76       $0.00     1       0      1      0       1
108                 TSLA   300    crossover-volstop-thma-0.5x-1x-1.25      $177.32      $177.32       $0.00     3       0      1      1       3
109                 TSLA   300    crossover-volstop-thma-0.5x-1x-1.00      $199.41      $199.41       $0.00     3       0      1      1       3
110                  TSM   180     crossover-volstop-sma-1x-1.5x-2.50       $44.90       $44.90       $0.00     2       0      1      1       2
111                  TSM   180     crossover-volstop-sma-1x-1.5x-3.00       $44.90       $44.90       $0.00     2       0      1      1       2
112                  WMT   300     crossover-volstop-sma-10x-20x-1.00       $26.93       $32.55      -$5.62     3       1      1      1       4
113                  WMT   180     crossover-volstop-sma-15x-30x-2.00       $47.67       $59.39     -$11.72     3       1      1      1       4
114                  XBI   180                           volstop-5.25       -$7.33       $29.80     -$37.13     1       4      0      1       5
115                  XBI   300                           volstop-3.00       -$3.93       $54.88     -$58.81     1       4      0      1       5
116                  XLK   180     crossover-volstop-sma-0.5x-1x-1.75       $75.10       $75.10       $0.00     1       0      1      0       1
117                  XLK   180                            sma-0.5x-1x       $89.20       $89.20       $0.00     1       0      1      0       1

For ease of data management, backtests heavily rely on pandas but the live trading APIs never touch pandas and generates all information in clean O(1) update classes.

In addition to the report format, any of those (symbol, duration, algo) results can generate charts with algo decision/adventure lines too:

Pre-Conclusion

This could go on for another 100 pages, but let’s stop here and pick up more details later.

What remains to cover?

  • any actual codes and keys
  • actual diagrams / logic flows
  • market mechanical details of exchanges / NBBO / tapes / SIP / TRF / bar / trade condition logic
  • more breakdowns differentiating runtime analysis vs bar analysis vs volatility analysis
  • hours (GTH, PM, RTH, AH) and funds available (“liquid trading hours”)
  • market regimes (are you in a wtfbbq non-stop manipulated melt-up market for 10 months or a oh noes cover ur toes 6 week collapse-super-V-recovery market?)
    • currently in the year of our jobs 2024, the only two ways the US stock markets work is in 6 week collapse cycles or super-V-infinite-bid-melt-up-recovery. You’re either exponentially collapsing or exponentially recovering with nothing in the middle. perfectly functional markets yall.
  • what’s the best-worst you can do? $10 profit on $9 commissions? You still made $1 LFG
  • guards against automated failure when your algo buys high and sells low ten times in a row (standard failure case of trusting moving averages when price is just bouncing in a fixed range and not actually moving up or down very far as time progresses)
  • configuration / automation / user interface / reporting interfaces
  • architecture speed/latency concerns (the markets are all in NYC or Chicago, so your broker APIs will all be there too, so running code on the east coast has lower network latency)
  • best stuffed animals to cry into after:
    • a position dies and you didn’t cut your losses soon enough, but then you do exit for a 20% account drawdown, then the position recovers without you 15% above your original buy-in price. gotta make sure you “buy the dip near the tip” and not buy something mid-collapse without recovery guards.
    • you have a position grow from $7 to $40 so you exit since it feels like great profit and you walk away, but you look back later and it continued running to $450 the same day and you missed out on turning $3,000 into $3 million in a day by exiting too soon.
  • reader fan mail and other war stories

that’s all for now. just don’t run out of money and you’ll be fine.