MACD Pine
Pine Script strategy by 发明者量化.
The original spec has no written description. Read the source below.
Parameters
| Name | Default | What it controls |
|---|---|---|
| v_input_1 | 12 | fast |
| v_input_int_1 | 26 | slow |
| v_input_float_1 | 9 | signal |
Source Pine Script
/*backtest
start: 2021-05-04 00:00:00
end: 2022-05-03 23:59:00
period: 1d
basePeriod: 1h
exchanges: [{"eid":"Bitfinex","currency":"BTC_USD"}]
*/
fastPeriod = input(12, "fast")
slowPeriod = input.int(26, "slow")
singnalPeriod = input.float(9, "signal")
[fast, slow, _] = ta.macd(close, fastPeriod, slowPeriod, singnalPeriod)
plot(fast, 'fast')
plot(slow, 'slow')
if fast>slow and fast[1]<slow[1]
strategy.entry("Enter Long", strategy.long)
else if fast<slow and fast[1]>slow[1]
strategy.entry("Enter Short", strategy.short)
Published by 发明者量化 on the FMZ strategy square · last modified 2022-05-23. 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/MACD-Pine.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.