Looking for dev partner / multi-server distributed load algo

I will do my best to explain what IS built already built and the ultimate goal… the functionality is VERY complex, so my apologies for any confusion. If something is unclear, please feel free to ask for clarification.

The quick description of the software is “Distributed Workload Signal Monitoring and Algo Trade Execution”

The software works on multiple (up to 28) vps servers behind a firewall hosted with linode. To simplify the architecture I have named the servers WSRelay, Hub, and Shards.

Basic responsibilites of servers:
WSRelay - relays all alpaca websocket messages to subscribed shard servers
Hub - alpaca websocket auth, final trade decisions, trade execution
Shards - distributed workload tick data crunching (5 second intervals)

Hub Server has UI for monitoring (see more at bottom)

proficiencies:
NodeJS
PHP
redis
mysql

The goal is to consume ALL trade data and apply algo trading workflows. Here are the CURRENTLY FUNCTIONAL steps the servers perform on init: (medium detail overview, some saftey check steps have been left out)

  1. Hub Server
    1. connects and auths with WSRelay,
    2. sends message to handshake, auth, and subscribe with alpaca marketdata websocket
    3. upon confirmation queries Alpaca’s (or other trading platform) Account API
    4. initializes shard servers and delegates symbols to be monitored
  2. Shard Servers (each up to 26)
    1. connect and auth with WSRelay to recieve relayed alpaca websocket marketdata messages
  3. WSRelay
    1. validates auth from shard servers
    2. Begins relaying all messages to subscribed Shard Servers
  4. Shard Servers (each, up to 26)
    1. filter messages for designated symbols
      (distribution is one, or a subset of symbol first letters, ie. “Shard A” handles all “A” like AAPL)
    2. collects ticks for each symbol, and builds 5 second buckets, stores data in reddis server
    3. analyzes 5 second buckets (bars) with primary focus on Acceleration Oscillator
    4. when AO thresholds are met for a symbol, the past 3 minutes of rolling data is sent to Hub Server every 5 seconds while AO magnitude remains positive.
  5. Hub Server
    1. Consumes “potential trade candidate” messages
    2. Checks “Confidence Data’” (Market Gravity, Futures Trend, Spread Liquidity, VWAPAllignment)
    3. depending on “concurrent trading” being enabled or disbaled
      1. disabled
        1. Checks to see if a trade is currently active (more info later)
        2. If not, determines a stop loss/ take profit bracket
        3. prepares to execute trade
        4. *****trade API execution is not yet written*****
        5. Alerts designated Shard Server of bracketing
      2. if enabled…
        1. to be decided…
    4. Updates Accounting tables
  6. Shard Server
    1. Receives “Active Trade” Message
    2. Watches for stop loss/ take profit threshold to be passed
    3. alerts Hub Server of position exit signal
  7. Hub Server
    1. Validates position exit. (to be written)

The area that i need help in is sorting out the logic regarding when to pull the trigger in step 5.

  • Live montioring of each “potential trade candidate” are shown in Web UI with AO magnitude on a sparkline chart.
    -UI has error and activity logs
    -All parmeters are currently set as variables and can be changed in the web UI interface
    partial list includes:
  • alpaca_trading_mode
  • ao_accel_lookback
  • ao_accel_rate
  • aoHistoryBuckets
  • bucket_ttl
  • fast_period
  • flatline_ratio
  • letters_per_shard
  • max_vwap_stretch_percent
  • min_5s_flatline_ao_buckets
  • min_cumulative_ao_volume
  • slow_period
  • smooth_period
  • use_market_gravity
  • use_spread_liquidity
  • use_vwap_alignment
  • vol_floor
  • vol_surge_multiplier

If it was not clear, this system is built to be able to make decisions based on 5 second windows. As I am an inexperienced trader, the intention is to minimize risk by setting take profit and stop loss in advance. I have not yet given any consideration to an increase position functionality will exist or not. Simple plan… watch ALL stocks, pick the strongest accelerators, take profit at 3% to 5% and be out for the day. (open to suggestions…lol)

If you would like to see more, reach out to me.

Are you already running this sytem and not executing the trades? Just send the orders using a single share or use paper trading. If you need a developer for programing, using Claude Code.

Have you tried to run this architecture on a single server, on a smaller setup, before scaling to multiple? also, my advise is to rather watch all stocks, only focus on those in play - query news API, volume, gappers. I’ve lost a lot of time and money trying to trade everything that moves or the same basket.

1 Like

I agree with redorbit on all parts of their comment. Additionally, if you have that many moving parts, you might find your life less expensive and easier to manage if you pick yourself up a k8s instance from one of the big providers in a datacenter near chicago or new york rather than trying to manage 28 different vpss. Think in terms of processes instead of servers.

Feel free to DM me if you need help setting this up.