The investment Operating System for everyone
AI empowered, global market, serverless, cloud-native, and privacy.
Access the Yuan GUI from any device Β»Read the Docs π Β· Report Bug π Β· Request Feature π‘ Β· Join Discord
I'm a software engineer. And I want to make money through quantitative and automatic trading.
There are many great tools and platforms available. However, I didn't find one that suited my needs, so I created Yuan.
Here's why:
- My trading strategy is secret. I am afraid someone illegally obtained the results. I want to test and run it on trusted devices.
- The historical data is highly reused and never updated anymore. I want to download the data once and use it forever. So the data should be free.
- I want to work everywhere from any device. I don't want to install prerequisites (Python or any others) before starting my work. Most devices have installed browsers. So I want to use a browser to work.
- The market is similar around the world. I want to trade in any global market without changing any strategy code. Write once, and run everywhere.
- Real-world trading is important. The trading system should be highly available. I want to create and maintain them easily.
For more general usages:
- Maybe you feel troubled about coding. You can ask an AI assistant for help. Just tell AI your idea and run. AI can complete the code.
- Maybe you need to manage your money dispersed across many accounts.
In summary, I hope Yuan can be an operating system, which helps you control your money.
Powerful Web GUI
With Yuan Web GUI, you have access to a comprehensive solution for creating, testing, and managing your trading system, as well as deploying and monitoring your applications. The GUI is completely open-source and can be deployed anywhere, without an internet connection. You can easily switch between multiple environments using just one GUI, making your experience more streamlined.
We have designed the GUI with modern browsers in mind, and it integrates with the latest web technologies, such as WebWorker, FileSystemHandle, WebRTC, and more. It is highly responsive and fast, and we are constantly working to make it even better for you.
Although the GUI is currently written in Chinese, we have plans to make it internationalized, so you can use it in your native language in the future. We welcome contributions to the project's translation, so everyone can benefit from this amazing tool. You can access the GUI for free under the MIT license, without the need to install anything - simply use the GUI.
Simple language and AI assistant
If you're interested in developing a trading strategy without the need to learn a new language or DSL, the modern JavaScript/TypeScript language is an excellent option. You can use any IDE to write your code and any version control system to manage it. If you have difficulty with coding, you can seek assistance from an AI assistant by communicating your idea to it.
// It's a simple trend-tracking trading strategy that uses the SMA indicator.
import { useSMA, useSimplePositionManager } from '@libs';
export default () => {
const { close } = useOHLC('Y', 'XAUUSD', 'PT1H');
const ma20 = useSMA(close, 20);
const accountInfo = useAccountInfo();
const [targetVolume, setTargetVolume] = useSimplePositionManager(accountInfo.account_id, 'XAUUSD');
useEffect(() => {
const idx = close.length - 2;
if (close[idx] > ma20[idx]) {
setTargetVolume(1);
} else {
setTargetVolume(0);
}
}, [close.length]);
};
More examples can be found here.
Local, cloud...or hybrid!
Yuan is a hybrid-cloud software that allows you to deploy your trading system in your home or public cloud simultaneously. You can start using your home PC and then gradually switch to the public cloud as your business grows. Choosing between your home PC or the public cloud will depend on your availability, costs, privacy, and security requirements.
Extension-first Ecosystem
In Yuan, extensions are treated as first-class citizens. Many core features are built and distributed as extensions. You can use extensions to add new features, connect with more markets, and enhance your experience. You can download extensions from the community or create your own extension to share with others.
Prerequisites: nodejs >= 18.17.0
, docker for image build, and rush for mono repo management.
npm install -g @microsoft/rush
Then you can install dependencies and build projects
rush update && rush build
All the libraries should be independent of the platform by default. They can be used in the browser, node.js, or other platforms. And provide both ESM and CommonJS modules.
- @yuants/data-model Data Model and related utils.
- @yuants/protocol Network protocol, service definition and infrastructure.
- @yuants/utils Some general utils that are not found in the community.
- @yuants/kernel The kernel of Time-Machine. Time-Machine can travel from history to the future. This package also contains some useful units and scenes.
- @yuants/agent Agent is a trading bot. The agent contains the core of the trading strategy.
- @yuants/extension This defined the extension interface. You can use extensions to enhance your experience.
All the apps should provide an image and publish it as a npm package. You can deploy the app by docker and Kubernetes. You can find the App List and get the image. All the apps implemented the extension interface. So you can treat them as extensions.
- @yuants/app-host Host is a very lightweight message broker. Terminals can connect to the host and send messages to each other. Notice that all terminals in a host should trust each other. In practice, all the terminals in a host belong to the same owner. There's no need to verify every message. You can deploy multiple hosts to isolate the risk.
- @yuants/app-market-data-collector This will deploy a terminal as a data-collecting service. The terminal collects market data from the market terminals continuously.
- @yuants/app-agent This will deploy a terminal as the daemon service of the agent. You can run the agent in real mode. It can automatically correct the history data error. It can also automatically restart the agent when it crashes.
- @yuants/app-alert-receiver This will deploy a terminal as an alert-receiving service. It receives alerts from the alert terminals and sends them to the notifier terminals.
- @yuants/app-mongodb-storage This will deploy a terminal as a storage service. It stores data in MongoDB.
- @yuants/app-email-notifier This will deploy a terminal as a notifier service. It sends notifications to your email.
- @yuants/app-feishu-notifier This will deploy a terminal as a notifier service. It sends notifications to your Feishu by a Feishu bot.
- @yuants/app-trade-copier This will deploy a terminal as a trade copier service. It watches the source accounts and ensures the target accounts follow the source accounts.
- @yuants/app-metrics-collector This will deploy a terminal as a metrics-collecting service. The metrics collector collects metrics from terminals continuously. It works with Prometheus.
@yuants/ui-web is the GUI. You can do anything with the GUI because we prefer to implement the feature in GUI rather than CLI. All the users use the same GUI distribution. It's independent of hosts and scenes. User has their own workspace locally. The workspace is secret. You can install extensions to enhance your workspace. Any device with a modern browser can access the GUI and its features. But currently, the layout on the desktop is the most friendly. We will enhance the experience of mobile in the future.
@yuants/tool-kit is all you need. This provides a CLI when you need to build an extension. It helps you to build a docker image, create a bundle and more. To ensure your extension is ready to use.
Vendors include markets, exchanges, and data sources. You can access the global market through various vendors. For some legal reason, they are probably not open to everyone. But you can use them if you gain permission from the provider.
Every vendor is a gateway to connect the external service directly. Your private data including account info and market data will not be stored in Yuan Cloud Service. You can deploy the vendor in your own cloud or local machine.
- @yuants/vendor-ctp This connects to the "Comprehensive Transaction Platform" (CTP). The CTP platform was developed by the Shanghai Futures Exchange (SHFE). CTP provides China's future exchanges. To comply with regulations, you might have to request permission from your broker company.
Contributions make the open-source community a fantastic place to learn, inspire, and create. Any contributions you make are greatly appreciated.
If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open a feature request issue. Don't forget to give the project a star! Thanks again!
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
Thanks sincerely to the contributors:
Zheng Chen π§βπ« π» π¨ π |
Siyuan Wang π» π |
Jinhaolin π» |
Hobo Chen π |
Yalun Lin Hsu π» |
SakurazukaKen π» |
Haoran Ren π» |
pruderior π» |
playground π» |
- Yuan-Public-Workspace You can learn how to write strategy models from this repository. You can import it to your workspace from the GUI. The repository is embedded in AI with a vector database. Contribute with your examples is greatly appreciated!
- Yuan-Public-Data Our public data is maintained here as a repository. Free to use. Welcome to contribute if you have other data!