0bps

Strategy vault / Other

Combination of Double MA and RSI

- Strategy Name: Combination of Double MA and RSI - Data Cycle: 15M, 30M, etc. - Support: Commodity Futures - Main chart: MA 1, formula: MA1 ^^ EMA (C, N1); MA 2, formula: MA2 ^^ EMA (C, N2); - Secondary chart: RSI…

MyLanguageOtherRSIEMASMA
Author
阿基米德的浴缸
Complexity
Starter · 28 lines
Parameters
3
  • Strategy Name: Combination of Double MA and RSI

  • Data Cycle: 15M, 30M, etc.

  • Support: Commodity Futures

    IMG
    IMG

  • Main chart: MA 1, formula: MA1 ^^ EMA (C, N1); MA 2, formula: MA2 ^^ EMA (C, N2);

  • Secondary chart: RSI, formula: RSIVALUE:SMA(MAX(CLOSE-REF(CLOSE,1),0),LENGTH,1)/SMA(ABS(CLOSE-REF(CLOSE,1)),LENGTH,1)*100;

Parameters

NameDefaultWhat it controls
SLOSStrueStop Loss Percentage | Stop Loss Percentage
N150Moving average 1 parameters | MA1 parameter
N2300Moving average 2 parameters | MA2 parameter

Source MyLanguage

(*backtest
start: 2018-11-05 00:00:00
end: 2018-12-05 00:00:00
period: 15m
exchanges: [{"eid":"Futures_OKCoin","currency":"BTC_USD"}]
args: [["ContractType","this_week",126961]]
*)

MA1^^EMA(C,N1);
MA2^^EMA(C,N2);

LENGTH:=9;
OVERBOUGHT:=70;
OVERSOLD:=100-OVERBOUGHT;
RSIVALUE:SMA(MAX(CLOSE-REF(CLOSE,1),0),LENGTH,1)/SMA(ABS(CLOSE-REF(CLOSE,1)),LENGTH,1)*100;
BUYK:=BKVOL=0 AND BARPOS>N2 AND MA1>MA2 AND C>MAX(MA1,MA2) AND CROSSUP(RSIVALUE,OVERBOUGHT);
SELLK:=SKVOL=0 AND BARPOS>N2 AND MA1<MA2 AND C<MIN(MA1,MA2) AND CROSSDOWN(RSIVALUE,OVERSOLD);
SELLY:=MA1<MA2 AND C>BKPRICE*(1+SLOSS*0.01);
BUYY:=MA1>MA2 AND C<SKPRICE*(1-SLOSS*0.01);
SELLS:=C<BKPRICE*(1-SLOSS*0.01);
BUYS:=C>SKPRICE*(1+SLOSS*0.01);

BUYK,BK;
SELLK,SK;
SELLY,SP(BKVOL);
BUYY,BP(SKVOL);
SELLS,SP(BKVOL);
BUYS,BP(SKVOL);

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/Combination-of-Double-MA-and-RSI.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