0bps

Strategy vault / Other

DMI and High Low Strategy

- Strategy Name: DMI and High-Low Strategy - Data Cycle: 5M - Support: Commodity Futures - Main chart: AMA1 index, formula: AMA1 ^ ^ EMA (DMA (CLOSE, CQ1), 2); AMA2 index, formula: AMA2 ^ ^ EMA (DMA (CLOSE, CQ2), 2);

Author
阿基米德的浴缸
Complexity
Starter · 28 lines
Parameters
6
  • Strategy Name: DMI and High-Low Strategy

  • Data Cycle: 5M

  • Support: Commodity Futures

    IMG
    IMG

  • Main chart: AMA1 index, formula: AMA1 ^ ^ EMA (DMA (CLOSE, CQ1), 2); AMA2 index, formula: AMA2 ^ ^ EMA (DMA (CLOSE, CQ2), 2);

Parameters

NameDefaultWhat it controls
N20AMA1Metric parameters(1) | AMA1 index parameter(1)
N14AMA1Metric parameters(2) | AMA1 index parameter(2)
N260AMA1Metric parameters(3) | AMA1 index parameter(3)
M40AMA2Metric parameters(1) | AMA2 index parameter(1)
M18AMA2Metric parameters(2) | AMA2 index parameter(2)
M2120AMA2Metric parameters(3) | AMA2 index parameter(3)

Source MyLanguage

(*backtest
start: 2018-11-04 00:00:00
end: 2018-11-30 00:00:00
period: 5m
exchanges: [{"eid":"Futures_BitMEX","currency":"XBT_USD"}]
args: [["TradeAmount",100,126961],["ContractType","XBTUSD",126961]]
*)


DIR1:=ABS(CLOSE-REF(CLOSE,N));
VIR1:=SUM(ABS(CLOSE-REF(CLOSE,1)),N);
ER1:=DIR1/VIR1;
CS1:=ER1*(2/(N1+1)-2/(N2+1))+2/(N2+1);
CQ1:=CS1*CS1;
AMA1^^EMA(DMA(CLOSE,CQ1),2);

DIR2:=ABS(CLOSE-REF(CLOSE,M));
VIR2:=SUM(ABS(CLOSE-REF(CLOSE,1)),M);
ER2:=DIR2/VIR2;
CS2:=ER2*(2/(M1+1)-2/(M2+1))+2/(M2+1);
CQ2:=CS2*CS2;
AMA2^^EMA(DMA(CLOSE,CQ2),2);

cq22:CQ2;
aa:DMA(CLOSE,CQ2);

BKVOL=0  AND  REF(AMA1,1)<REF(AMA2,1)  AND  AMA2<AMA1,BPK;
SKVOL=0  AND  REF(AMA1,1)>REF(AMA2,1)  AND  AMA2>AMA1,SPK;

Published by 阿基米德的浴缸 on the FMZ strategy square · last modified 2019-08-20. 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/DMI-and-High-Low-Strategy.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