← All tools · Guides

Cloud quant desk: a small server for crawlers, cron, and an LLM digest

Hands-on, part 1. One small cloud server for a crawler that stays on, a scheduled backtest, and an LLM digest.

Short answer: start with a lightweight application server at 2 vCPU and 2 GB on Ubuntu 22.04. Install Miniconda and Python 3.11 in about 20 minutes, hang the jobs on cron, and keep the model API key in an environment variable.

How to choose: To keep a personal quant job running all week, rent a lightweight application server, not a full managed ECS instance. A market-data crawler, cron, and a news digest start on 2 vCPU and 2 GB of RAM with Ubuntu 22.04. Multi-process backtests and parameter scans move to 2 vCPU and 4 GB, and you add memory first. Batch LLM research stays on 2 vCPU and 4 GB; the spend goes to a pay-as-you-go model API, not to a bigger machine. Pick a region close to you. Prices and discounts follow the official campaign page. This page is the cloud desk. It is not the order of tools, not the site FAQ, and not the paper-trading ledger.

Who it is for: Someone who writes a little Python and needs a machine that stays on: a market-data crawler, a daily backtest, or an LLM digest of research notes. The path is a 2 vCPU and 2 GB start, about 20 minutes to install Miniconda and a conda environment named quant on Python 3.11, cron, and a model API key kept in an environment variable.

Who it is not for: Someone who only runs one backtest on a computer they leave on, or who wants a broker terminal that sends live orders. A server that only runs scripts and does not serve a public site on a bound domain does not need an ICP filing. Binding a domain for a website on a mainland China node does. This page is not the tool-order guide, not the site FAQ, and not the paper-trading ledger. Once the machine is up, the next part is AKShare market data into SQLite. Opening the instance and connecting over SSH is a different article.

The same walkthrough in Chinese is the cloud quant desk. It is part 1 of that series. The next part, China A-share bars into SQLite, is AKShare into SQLite. The same data walkthrough in Chinese is AKShare market data into a database. A paper-trading ledger after a backtest is the Chinese paper-trading guide. That ledger is not this article. Opening an instance and connecting over SSH is opening a cloud server. The same note in Chinese is the Chinese cloud-server note. That note is not this article either. A broker terminal that sends live orders is a different choice, and QMT needs Windows, not this Ubuntu desk. That comparison is how to choose between QMT and PTrade. A browser chart for watchlists and alerts, with no server, is the TradingView setup. That page is not this desk.

Facts below follow the Chinese walkthrough. The commands were not re-run for this English page. The Chinese page links an Alibaba Cloud new-customer entry. That entry is an affiliate link. The price is the same as going there yourself. New customers are often offered 85% of list price, some products are time-limited, and the official campaign page wins. This page does not repeat that link. This is not investment advice.

01 · Why these jobs belong on a cloud server

A quant stack on a laptop usually stalls on three things:

One real reference: the site you are reading crawls three data sources at 07:17, refreshes a directory of 1100+ tools, and aggregates investment news across 12 tracks. That pipeline is one entry-level cloud server plus cron. The Chinese page compares the monthly cost to one takeout meal.

02 · How to choose the size

JobSuggested sizeCost
Market-data crawler, cron, and a news digestLightweight application server, 2 vCPU, 2 GB, Ubuntu 22.04Lowest. A new-customer discount makes it cheaper still
Multi-process backtests or a parameter scan2 vCPU and 4 GB to start, and add memory firstResize when you need it. Stopped billing costs less
Batch LLM research or an agent pipeline2 vCPU and 4 GB, plus a pay-as-you-go model APIThe spend is the API, not the machine

The point: 2 vCPU and 2 GB is enough to start. Resize after the jobs already run. Prefer the lightweight application server over a full ECS instance. That is the better deal for one researcher. Pick a region close to you so the latency is lower. Prices and discounts follow the official campaign page.

The Chinese page says new Alibaba Cloud customers are often offered 85% of list price through this site's entry, and that some products are time-limited. The entry on that page is an affiliate link. This English page does not include it.

03 · The environment, about 20 minutes

Miniconda, then the libraries this series uses:

# 1. Miniconda, from the Tsinghua mirror
wget https://mirrors.tuna.tsinghua.edu.cn/anaconda/miniconda/Miniconda3-latest-Linux-x86_64.sh
bash Miniconda3-latest-Linux-x86_64.sh -b && ~/miniconda3/bin/conda init bash && source ~/.bashrc

# 2. A separate environment and the usual libraries
conda create -n quant python=3.11 -y && conda activate quant
pip install akshare backtrader pandas pyarrow requests -i https://pypi.tuna.tsinghua.edu.cn/simple

# 3. Check
python -c "import akshare; print(akshare.__version__)"

The -i flag is the Tsinghua PyPI mirror from the Chinese page. The same pip install without that flag uses the default index.

04 · Cron, so the jobs start themselves

The system crontab is enough. Data in the morning, a weekly backtest after Friday's close:

crontab -e
# Every day at 08:00, data update, one log file per day
0 8 * * * cd /home/quant/jobs && ./update_data.sh >> logs/update_$(date +\%F).log 2>&1
# Friday at 16:30, after the close, weekly backtest
30 16 * * 5 cd /home/quant/jobs && ./run_backtest.sh >> logs/bt_$(date +\%F).log 2>&1

What holds up: every job writes a log, split by day. When something breaks, read the log first. On failure, have the script send one notice (a WeCom or DingTalk webhook, about ten lines). A silent failure is the expensive kind.

05 · A model API for a research digest

A cloud server plus a model API is the lowest setup for AI-assisted research: the machine keeps the clock, the API does the reading. Alibaba Cloud Model Studio (Bailian) uses one key for the Qwen series, on an OpenAI-compatible API:

import os
from openai import OpenAI

client = OpenAI(
    api_key=os.environ["DASHSCOPE_API_KEY"],  # key in the environment, not in the file
    base_url="https://dashscope.aliyuncs.com/compatible-mode/v1",
)
resp = client.chat.completions.create(
    model="qwen-plus",
    messages=[{"role": "user", "content": "把这条资讯浓缩成一句对A股板块的影响:" + news_text}],
)
print(resp.choices[0].message.content)

The user message is the Chinese sentence from the original page, stored here as unicode escapes. It asks for one sentence on how that news item affects an A-share sector. news_text is the item you pass in. The investment-news digest on this site summarizes 100+ sources in Chinese on this path. Billing is pay-as-you-go. At a personal research volume the Chinese page puts the monthly API bill at a few yuan to a few tens of yuan.

06 · Pitfalls, each one already paid for

Start at 2 vCPU and 2 GB. The first scheduled crawler can run the same day. The Chinese page also links an Alibaba Cloud new-customer promo. The price is the same as going there yourself, and the discount is whatever the official page shows that day. The link on the Chinese page is an affiliate link.

Once the machine stays on, the next job is a daily database of China A-share bars:

Next: AKShare into SQLite →

This tutorial is not investment advice. Prices and discounts follow the official campaign page.

Part 1 of the hands-on series. Next: AKShare into SQLite.

Frequently asked questions

How to choose a cloud machine for a quant desk?

To keep a personal quant job running all week, rent a lightweight application server, not a full managed ECS instance. A market-data crawler, cron, and a news digest start on 2 vCPU and 2 GB of RAM with Ubuntu 22.04. Multi-process backtests and parameter scans move to 2 vCPU and 4 GB, and you add memory first. Batch LLM research stays on 2 vCPU and 4 GB; the spend goes to a pay-as-you-go model API, not to a bigger machine. Pick a region close to you. Prices and discounts follow the official campaign page. This page is the cloud desk. It is not the order of tools, not the site FAQ, and not the paper-trading ledger.

Who it is for?

Someone who writes a little Python and needs a machine that stays on: a market-data crawler, a daily backtest, or an LLM digest of research notes. The path is a 2 vCPU and 2 GB start, about 20 minutes to install Miniconda and a conda environment named quant on Python 3.11, cron, and a model API key kept in an environment variable.

Who it is not for?

Someone who only runs one backtest on a computer they leave on, or who wants a broker terminal that sends live orders. A server that only runs scripts and does not serve a public site on a bound domain does not need an ICP filing. Binding a domain for a website on a mainland China node does. This page is not the tool-order guide, not the site FAQ, and not the paper-trading ledger. Once the machine is up, the next part is AKShare market data into SQLite. Opening the instance and connecting over SSH is a different article.

Why put quant jobs on a cloud server?

A laptop fails three jobs. A crawler, a daily backtest, and a news digest need to run at a set time, and they miss a day when the machine is off or the home connection drops. A cloud server has a fixed egress and datacenter bandwidth, and it does not use your home connection. A research environment that breaks can be reinstalled without touching the computer you use every day. The pipeline behind this site crawls three data sources at 07:17, refreshes a directory of 1100+ tools, and aggregates investment news across 12 tracks. That runs on one entry-level cloud server plus cron. The Chinese page compares the monthly cost to one takeout meal.

Which size should you start with?

A crawler, cron, and a news digest fit a lightweight application server with 2 vCPU, 2 GB of RAM, and Ubuntu 22.04. That is the cheapest start. Multi-process backtests and parameter scans start at 2 vCPU and 4 GB, and you add memory first, scaling only when the smaller machine is already busy. Batch LLM research and an agent pipeline stay at 2 vCPU and 4 GB and add a pay-as-you-go model API, so the compute bill is the API, not the machine. Start at 2 vCPU and 2 GB, then resize. Prefer the lightweight application server over a full ECS instance. Pick a nearby region. Prices and discounts follow the official campaign page. The Chinese page says new customers are often offered 85% of list price, and that some products are time-limited.

What does the 20-minute setup install?

About 20 minutes. Install Miniconda from the Tsinghua mirror, create an environment named quant on Python 3.11, then pip install akshare, backtrader, pandas, pyarrow, and requests from the Tsinghua PyPI mirror. Check it with python -c importing akshare and printing akshare.__version__.

How do the cron jobs look?

crontab is enough. Every day at 08:00, run update_data.sh: 0 8 * * *. Every Friday at 16:30, run run_backtest.sh: 30 16 * * 5. Write a log file per day. On failure, send one notice through a WeCom or DingTalk webhook, about ten lines, so a job cannot fail in silence.

How do you call the Qwen API?

Alibaba Cloud Model Studio (Bailian) uses one key for the Qwen series and an OpenAI-compatible API. Put the key in the environment variable DASHSCOPE_API_KEY. The base URL is https://dashscope.aliyuncs.com/compatible-mode/v1. The example model is qwen-plus. The investment-news digest on this site summarizes 100+ sources in Chinese on that path. Billing is pay-as-you-go. At a personal research volume the Chinese page puts the monthly API bill at a few yuan to a few tens of yuan.

What pitfalls does this walkthrough call out?

Four. A server that only runs scripts and does not serve a public website on a bound domain does not need an ICP filing. Binding a domain for a website on a mainland China node does. An overseas host can skip the filing, with a speed tradeoff. Open only SSH, and change the default port, plus the ports you actually need. Keep API keys in environment variables or a secrets file, never in the repository, and revoke a leaked key at once. Set a billing alert, and release pay-as-you-go resources when the test is over.