TypeScript Demo
The platform adds native TypeScript support, you only need to add it at the beginning of the source code (the policy language type is still selectedJavaScript) Can automatically recognize asTypeScript
The platform adds native TypeScript support, you only need to add it at the beginning of the source code (the policy language type is still selectedJavaScript)
// @ts-check
Can automatically recognize asTypeScript
Source JavaScript
// @ts-check
class Greeter {
greeting: string;
constructor(message: string) {
this.greeting = message;
}
greet() {
return "Hello, " + this.greeting;
}
}
function peopleName(firstName: string, ...restOfname: string[]) {
return firstName + " " + restOfname.join(" ");
}
function main() {
let greeter = new Greeter("world");
Log(greeter.greet());
Log(peopleName('xiaochuan', 'xiaoming', 'xiaohong'))
}
Published by 发明者量化 on the FMZ strategy square · last modified 2023-04-30. Collected in the Quant Trading Vault. Unvalidated research: re-test with your own data and costs before trusting it.
Build this with AgenKit
A spec is not a trading system. Paste this into your coding agent and AgenKit runs a specialist team — architecture, test-first build, risk gates, review — with paper trading on by default.
/agenkit build a production-grade trading bot with a backtest engine, risk controls and paper trading by default from strategies/TypeScript-Demo.md- npx agenkit install engineering-kit in your project
- Paste the command into your agent and approve each phase
- Get tests, backtest, risk controls and a paper-trading switch
Understand it first
Before you run this, read the lesson behind the idea and how to backtest it honestly. Specs like this one are the survivors of an unknown number of trials; deflate their results accordingly.