0bps

Strategy vault / Other

Quantitative Typing Rate Trading Strategy by Boyu Quantification

MyLanguage strategy by homily.

MyLanguageOther
Author
homily
Complexity
Starter · 24 lines
Parameters
1

The original spec has no written description. Read the source below.

Parameters

NameDefaultWhat it controls
len35len

Source MyLanguage

(*backtest
start: 2019-01-01 00:00:00
end: 2021-01-31 00:00:00
period: 1h
exchanges: [{"eid":"Futures_OKCoin","currency":"BTC_USD","fee":[0.05,0.05]}]
args: [["TradeAmount",200,126961],["ContractType","quarter",126961]]
*)

//len:=35;//Design number of cycles
liang:=INTPART(MONEYTOT*REF(C,1)/100)*0.5;

hh^^HHV(H,len);//Take the highest price within a certain period
ll^^LLV(L,len);//Take the lowest price within a certain period
hl2^^(hh+ll)/2;//Average of the highest price and lowest price
avg^^MA(hl2,5);//Calculate the smoothed moving average for the mean value

ss:SLOPE(avg,len);// Calculate the regression slope for the moving average

ss<REF(ss,1),SPK(liang*2);//When the slope decreases, it indicates weakening market momentum, with a downward trend; close long positions and go short
ss>REF(ss,1),BPK(liang);//When the slope increases, it indicates that market momentum is continuously rising, showing an upward trend. Close short positions and go long.
AUTOFILTER;


Published by homily on the FMZ strategy square · last modified 2021-02-08. 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.

in Claude Code, Cursor, Codex & 4 more
/agenkit build a production-grade trading bot with a backtest engine, risk controls and paper trading by default from strategies/Quantitative-Typing-Rate-Trading-Strategy-by-Boyu-Quantification.md
  1. npx agenkit install engineering-kit in your project
  2. Paste the command into your agent and approve each phase
  3. 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.

Related specs

esc

Try , , or .

↑↓ move↵ open