0bps

Strategy vault / Multi-timeframe

multiple timeframe trading

Demonstrates how the pine language use multiple timeframe

Author
发明者量化
Complexity
Starter · 21 lines
Parameters
0
Backtest bar
1d · swing
Tested on
BTC/USD · spot

Demonstrates how the pine language use multiple timeframe

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"}]
*/
strategy("multiple timeframe trading")

expr = ta.ema(close, 5)
hVal = request.security(syminfo.tickerid, '60', expr)

plot(expr, timeframe.period)
plot(hVal, '1hour')

// 5 hour vs 5 days
if hVal > expr
    strategy.entry("long", strategy.long)
else
    strategy.entry("short", strategy.short)

Published by 发明者量化 on the FMZ strategy square · last modified 2022-05-06. 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/multiple-timeframe-trading.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