研究方法Our method

我们验证的是“系统是否严格按你的规则工作”,而不是“策略能赚多少钱”。前者可以被证明,后者没有人能保证。

We verify that the system does exactly what your rules say, not how much the strategy will make. The first can be proven. Nobody can promise the second.

1. 想法变规则1. From idea to rules

每个项目从一份规则说明书开始。我们把“看起来要涨了就买”这样的描述,改写成没有歧义的条件:哪个品种、哪个周期、什么条件入场、什么条件出场、每次多少仓位、出错时怎么办。每条规则都有编号(R1、R2……),之后的代码、回测和对账都引用这些编号。

Every project starts with a rule specification. A description like "buy when it looks ready to run" becomes unambiguous conditions: which instrument, which timeframe, what triggers an entry or exit, how much to trade, and what happens when something fails. Each rule gets an ID (R1, R2…) that the code, the backtest and the reconciliation all refer back to.

规则必须由你提供并签字确认。我们会指出含糊或矛盾的地方,但不会替你设计或优化策略。
You supply and sign off the rules. We point out anything vague or contradictory, but we do not design or optimise the strategy for you.

2. 规则变代码2. From rules to code

我们用 Pine Script 在 TradingView 上实现策略,因为你可以直接在图表上看到每一次信号。需要更复杂的数据处理或多品种组合时,再用 Python 实现。代码遵循三个习惯:

We implement in Pine Script on TradingView, because you can see every signal on your own chart. When a strategy needs heavier data work or many instruments, we use Python. The code follows three habits:

  • 只在 K 线收盘后发信号,避免盘中闪现又消失的信号
  • 不引用未来数据,跨周期取数时只用已经收盘的数据
  • 每个信号带唯一编号,执行端据此去重和对账
  • Signals fire only on bar close, so nothing appears and then vanishes intrabar
  • No look-ahead: higher-timeframe data uses completed bars only
  • Every signal carries a unique ID for de-duplication and reconciliation

3. 数据来源3. Market data

Pine Script 策略使用 TradingView 提供的 K 线数据。Python 策略可以接入券商行情或第三方数据服务,具体取决于品种和你已有的订阅。评估阶段我们会写清楚数据来自哪里、延迟多少、费用由谁承担。

Pine Script strategies use TradingView's bar data. Python strategies can use broker market data or a third-party vendor, depending on the instrument and the subscriptions you already hold. The assessment states where data comes from, its delay, and who pays for it.

4. 回测检查4. Backtest checks

回测的目的不是展示收益,而是检查代码有没有按规则工作。我们会做这些检查:

The backtest is there to check the code against the rules, not to show off returns. We check:

检查Check要回答的问题Question it answers
规则追溯Rule tracing每笔交易是由哪条规则触发的?Which rule triggered each trade?
抽样复核Spot checks随机抽 10 笔,人工对照图表是否正确?Do 10 random trades match the chart by hand?
成本与滑点Costs and slippage加入手续费和滑点后,结果是否仍合理?Do results still make sense with commissions and slippage?
样本外区间Out-of-sample在没参与设定的时间段,规则是否照常触发?Do the rules behave the same on data not used to set them?
参数敏感度Sensitivity参数稍微变动,结果是否剧烈变化?Does a small parameter change swing results wildly?

5. 模拟盘验证5. Paper trading

上实盘前,系统在你的券商模拟账户中连续运行两周。我们每天核对信号与订单,并故意制造问题:发送重复信号、断开服务器、让券商拒单,确认系统会去重、暂停并通知你。验收标准写在规则说明书里,只看系统是否按约定工作,不看盈亏。

Before going live, the system runs for two weeks on your broker's paper account. We reconcile signals and orders daily and deliberately cause trouble: duplicate signals, a downed server, a rejected order. Acceptance criteria live in the rule specification and judge whether the system works as agreed, never profit or loss.

6. 执行与对账6. Execution and reconciliation

信号路径是:TradingView 警报 → 你名下的服务器(校验、去重、风控上限、日志)→ 你的券商账户。服务器和券商账户都属于你,密码只在你手里。需要重新登录时,你在手机上打开链接、输入密码,再在券商 App 里点批准即可。系统未连接时收到的信号会被拒绝并记录,不会在恢复后用过时价格补单。

The signal path is: TradingView alert → a server in your name (validation, de-duplication, risk limits, logs) → your brokerage account. You own both, and only you hold the password. When a re-login is needed, you open a link on your phone, enter your password and approve in your broker's app. Signals that arrive while disconnected are rejected and logged, never replayed later at stale prices.

看看这些步骤在一份示例报告里的样子See these steps in a sample report