A central trading engine for TradingView and custom strategies
- Type
- Client project, anonymised
- Duration
- 1 year and 4 months
- Team
- 2 senior and 2 junior developers
- Stack
- Java, SQL, desktop engine on a cloud server
- Brokers
- NinjaTrader, Interactive Brokers, Charles Schwab
- Signals
- TradingView webhooks and 3 strategies coded into the engine
- Scale so far
- Up to 7 accounts; built to add more without a rebuild
- Testing
- Test cases, smoke tests, paper trading
- Outcome
- Runs on its own every session
What the client needed
The client ran several strategies on TradingView and wanted each signal to trade in many accounts, at several brokers at once, with safety checks in between. TradingView alone could not do this. The client also wanted room to add accounts and strategies later without starting again.
What we built
One central engine that listens for the signals from every strategy and saves each one in a database, so there is a full record. It then sends orders to the right accounts at NinjaTrader, Interactive Brokers and Charles Schwab. Three of the client’s strategies were also coded directly into the engine, so they run without depending on TradingView. A new strategy, from TradingView or written by the client, can be plugged in later.
Safety controls
- Risk rules before every trade. Before any order is placed, the engine checks the client’s risk rules for each account, such as how much that account is allowed to put at risk.
- Sizing per account. How much each account puts into a trade is worked out for that account, from rules the client sets.
- Testing first. Nothing goes live until it has passed testing.
How we tested
- Full test cases for normal and unusual situations.
- Smoke tests after every change.
- Trading on paper accounts before any real money was used.
One signal, step by step
- A strategy sends a “buy” signal.
- The engine saves it in the database.
- It checks the risk rules for every account.
- It works out the right size for each account.
- It places the orders at the right brokers. If one account breaks a rule, only that account is skipped and the others carry on.
Adding an eighth account or a fourth strategy does not mean rebuilding anything. Two senior and two junior developers built the engine over a year and four months.
The result
The engine runs every session on its own from a cloud server. So far it carries the client’s TradingView signals and three built-in strategies for up to seven accounts, and it is built to take on more accounts and strategies as the client grows.
What comes next
The client plans to open the system to subscribers through a website. The engine stays where it is, and the website sits in front of it:
- A subscriber logs in to the website and picks one of the client’s strategies.
- The central engine on the cloud server runs the strategies and places the orders.
- The engine writes every action to the database.
- The database feeds the website, so each subscriber sees only their own activity.
Think of a restaurant. Subscribers sit in the dining room, the website, and see their own table’s orders. The kitchen, the engine, does all the cooking out of sight. More guests do not need a new kitchen. Offering strategies to subscribers is the client’s business, and so are the registrations and approvals it needs. Our part is the technology, the same work described on our strategy marketplace platform page.
Turning TradingView alerts into broker orders safely is a subject of its own; our guide to turning a TradingView strategy into a bot covers the checks every alert should pass. For a different client’s platform with a subscriber portal already in place, see our multi-broker platform case study.
This is an anonymised account of client work. The client’s identity, the strategy logic and any trading figures have been removed, and the strategies are the client’s own. We build technology. We do not provide investment advice, we do not manage money, and we make no claim about how any strategy performs.