no-trade-no-life / yuan Goto Github PK
View Code? Open in Web Editor NEWYuan - Personal Investment Operating System
Home Page: https://y.ntnl.io
License: MIT License
Yuan - Personal Investment Operating System
Home Page: https://y.ntnl.io
License: MIT License
add a new field expired_at
for DataRecord
When the current timestamp exceeds expired_at
, the data record should be deleted logically.
if expired_at
is null, it means it will never expire.
Terminal should not send expired records to others and delete them in some plan.
Benefits:
Previously, we used to be a closed-source software with a mono-repo structure and did not release npm packages. As for the docker images, we needed stable image tags, meaning the tag of an image should not change if the content of the corresponding package did not change. Therefore, we used to calculate the git tracked files' hash as the docker image tag.
However, now that Yuan is an open source software and has a good npm release routine, it is time to move forward and use the package's semver as the docker image tag, if available.
// 双均线策略 (Double Moving Average)
// 当短期均线由下向上穿越长期均线时做多 (金叉)
// 当短期均线由上向下穿越长期均线时做空 (死叉)
import { useSMA, useSimplePositionManager } from "@libs";
export default () => {
// 使用收盘价序列
const { product_id, close } = useParamOHLC("SomeKey");
// NOTE: 使用当前 K 线的上一根 K 线的收盘价,保证策略在 K 线结束时才会执行
const idx = close.length - 2;
// 使用 20,60 均线
const sma20 = useSMA(close, 20);
const sma60 = useSMA(close, 60);
const accountInfo = useAccountInfo();
// 设置仓位管理器
const [targetVolume, setTargetVolume] = useSimplePositionManager(
accountInfo.account_id,
product_id
);
useEffect(() => {
if (idx < 60) return; // 略过一开始不成熟的均线数据
// 金叉开多平空
if (sma20[idx] > sma60[idx]) {
setTargetVolume(1);
}
// 死叉开空平多
if (sma20[idx] < sma60[idx]) {
setTargetVolume(-1);
}
}, [idx]);
};
note this const idx = close.length - 2
and make links for these jargons
Make all product ID unique for global.
Embed datasource_id into product_id field.
No response
for those exchanges that distinguish position IDs, orders should be sent with the position ID filled to reduce the complexity of vendor
已通过如下方式获取到high和low序列,如何计算high-low的差值序列
const { product_id, open, high, low, close } = useParamOHLC("SomeKey");
允许 Terminal 回收
TODO:
支持 terminal 的 dispose 方法,释放 connection,取消 terminal 中的一切后台订阅。
Currently, the App market-data-collector
is using Cronjobs with retries to schedule its sync tasks. It is working fine when dealing with no more than 200 different jobs.
However, the failure rate tends to increase as more new jobs are added from this point onwards.
The scheduling mechanism is not robust enough to support more jobs, thus a refactor is required to resolve the issue.
No response
No response
Operator cannot handle updates of manifest properly right now
Currently, we have only one CI workflow with one job for rush build docker image build & publish.
Soon, we will add npm publish into the CI workflow, which is not relevant to the docker build, thus, we should separate these steps into different jobs so that the CI workflow would be running in parallel.
Foreseeably, we shall have three jobs:
Job 2 and job 3 can be running in parallel.
We need a k8s operator to simplify deployment.
manifest.yuan.ntnl.io
.Once a manifest resource is created:
Others:
NPM_REGISTRY
for other npm registry.Having a base UI solution for data view & manipulation.
This UI has the following features:
We can rapidly build a complete and consistent UI for new data record types.
Many features benefit from this feature:
A kernel's state can be dumped and restored.
We can inspect a remote kernel by dumping the state and restoring it locally.
We can make the data-checking logic more efficient.
We can make the indicator-monitor scene more efficient.
TODO:
dump
and restore
.dump
and restore
.dump
for other terminals.It is crucial that we store the user's settings in the FileSystem to ensure the safety and accessibility of their data.
By doing so, we can easily sync the settings using OneDrive or any other similar tools.
Currently, we are storing some settings in IndexedDB, which unfortunately can be cleaned for various reasons, resulting in the loss of important data.
That's why it's essential to store certain settings, such as the "host config," in the FileSystem, as it provides a more reliable and secure option for storing and accessing user data.
Directory content change does not reflect in the file tree view immediately which is causing big confusion for users
If you're familiar with Jupyter Notebook, you know how useful it is for managing research. But what if I told you there's an even better way? Imagine being able to effortlessly create a notebook that only highlights the key points you care about. That's exactly what we're offering. With our web GUI, you can easily create code boxes and render various charts, tables, and more, making it a breeze to create your own version of Jupyter Notebook. Don't waste time clicking around to find what you need. Simplify your research management with our innovative solution today.
The server-side terminal should provide a JSON schema for its service.
The client-side terminal should choose one target terminal to process the request.
Why:
MongoDB
terminal_idEnable rush build cache to speed up CI build
No response
No response
Check all libraries's exporting API:
Observable<T>
and replace them with AsyncIterable<T>
Subject<T>
and replace them with NativeSubject<T> = AsyncIterable<T> | AsyncIterator<T, void, T>
.ObservableInput<T>
and replace them with AsyncIterable<T> | PromiseLike<T> | ArrayLike<T> | Iterable<T>
Hint: All Observable<T>
can be transformed to AsyncIterable<T>
, and back to Observable<T>
.
It might cause compatibility issues.
Confusing when someone is new to development.
Observable of rxjs
is useful for defining a stream interface.
But, the issue is that when we export an interface with Observable, it will bind the version of rxjs. (because Observable is a class rather than an interface)
We met a compiling error: Observable cannot be assigned to another Observable from a different version of rxjs
.
The solutions are:
To introduce the short rule: Never export a class type
In JavaScript & node modules cache & npm:
So, exporting a class type might cause compatibility issues.
Terminals now hold resources like IConnection
, which is implemented using rxjs Subject
and Observables
, when not dispose properly, it may cause memory leak.
Benefits:
Work Items:
dispose
method to Terminal. It disposes connection and unsubscribes all backend subscriptions.It's crucial that our i18n coverage reaches 100%.
By doing so, we'll be able to showcase our project "Yuan" to the wider English-speaking community on platforms like "Hacker News".
Let's prioritize internationalization and take the necessary steps to make it happen!
案例中提供的模型都是当前K线结束后交易(close.length-1),如下,
// NOTE: 使用当前 K 线的上一根 K 线的收盘价,保证策略在 K 线结束时才会执行
const idx = close.length - 2;
// 设置仓位管理器
const pL = useSinglePosition(product_id, PositionVariant.LONG);
const pS = useSinglePosition(product_id, PositionVariant.SHORT);
useEffect(() => {
if (idx < N) return; // 略过一开始不成熟的均线数据
if (close[idx] > Upper[idx]) {
pL.setTargetVolume(1);
pS.setTargetVolume(0);
}
if (close[idx] < Lower[idx]) {
pL.setTargetVolume(0);
pS.setTargetVolume(1);
}
}, [idx]);
能否提供一个盘中交易的模型案例
Since the rush publish process changes git repo with the -a
option (for version bump), to publish npm packages in CI, we instead always execute rush publish
without the -a
option. Thus, a manually triggered workflow for just npm publish is not needed,
参数优化这块,如果能展示参数-盈利的多维分布图,可以更方便识别参数的峰值和平原区,便于挑选合适的参数。
No response
No response
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.