0bps

Strategy vault / Arbitrage

Bitcoin Trading Strategy Based on Ichimoku Cloud

This strategy is a bitcoin trading strategy designed based on the Ichimoku cloud indicator. It generates trading signals when the short-term line crosses over the long-term line by calculating the equilibrium prices…

Author
ChaoZhang
Complexity
Starter · 43 lines
Parameters
5
Backtest bar
1h · intraday
Tested on
BTC/USDT · futures

IMG

Overview

This strategy is a bitcoin trading strategy designed based on the Ichimoku cloud indicator. It generates trading signals when the short-term line crosses over the long-term line by calculating the equilibrium prices over different periods.

Strategy Logic

The strategy uses the Ichimoku cloud indicator. The specific formulas are:

Lmax = highest price over period_max

Smax = lowest price over period_max

Lmed = highest price over period_med

Smed = lowest price over period_med

Lmin = highest price over period_min

Smin = lowest price over period_min

HL1 = (Lmax + Smax + Lmed + Smed)/4

HL2 = (Lmed + Smed + Lmin + Smin)/4

It calculates the equilibrium prices for the long-term line HL1 and short-term line HL2. A long signal is generated when HL2 crosses over HL1. A close signal is generated when HL2 crosses below HL1.

Advantage Analysis

The advantages of this strategy include:

  1. Using Ichimoku cloud filters market noise and identifies trends effectively.
  2. Crossover of different period lines generates trading signals and reduces false signals.
  3. The logic is simple and easy to understand and implement.
  4. Customizable period parameters adapt to different market environments.

Risk Analysis

There are also some risks:

  1. Ichimoku cloud has lagging and may miss short-term signals.
  2. Crossover of long and short term lines can be vulnerable to arbitrage.
  3. Signals may become unreliable during high volatility.

These risks can be reduced by optimizing parameters or incorporating other indicators.

Optimization Directions

The strategy can be optimized in the following aspects:

  1. Optimize long and short term periods to adapt to market changes.
  2. Add stop loss to control losses.
  3. Incorporate other indicators like MACD to improve accuracy.
  4. Suspend trading at high volatility periods to avoid huge losses.

Conclusion

This strategy generates signals when short-term equilibrium line crosses over long-term line based on Ichimoku cloud. Compared to single indicators, it effectively filters out false signals. Further improvements on parameters and risk control can enhance its stability and profitability.

Parameters

NameDefaultWhat it controls
v_input_120period_max
v_input_210period_med
v_input_316period_min
v_input_42020v_input_4
v_input_52025v_input_5

Source Pine Script

/*backtest
start: 2023-12-31 00:00:00
end: 2024-01-30 00:00:00
period: 1h
basePeriod: 15m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/

// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © Alferow

//@version=4
strategy("BTC_ISHIMOKU", overlay=true)

period_max = input(20, minval = 1)
period_med = input(10, minval = 1)
period_min = input(16, minval = 1)

Lmax = highest(high, period_max)
Smax = lowest(low, period_max)

Lmed = highest(high, period_med)
Smed = lowest(low, period_med)

Lmin = highest(high, period_min)
Smin = lowest(low, period_min)

HL1 = (Lmax + Smax + Lmed + Smed)/4
HL2 = (Lmed + Smed + Lmin + Smin)/4

p1 = plot(HL1, color = color.red, linewidth = 2)
p2 = plot(HL2, color = color.green, linewidth = 2)

fill(p1, p2, color = HL1 < HL2 ? color.green : color.red, transp = 90)

start = timestamp(input(2020, minval=1), 01, 01, 00, 00)
finish = timestamp(input(2025, minval=1),01, 01, 00, 00)
trig = time > start and time < finish ? true : false

strategy.entry("Long", true, when = crossover(HL2, HL1) and trig)
// strategy.entry("Short", false, when = crossunder(HL2, HL1) and trig)
strategy.close("Long", when = crossunder(HL2, HL1) and trig)

Published by ChaoZhang on the FMZ strategy square · last modified 2024-01-31. 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 spread arbitrage engine with WebSocket order routing and leg-risk controls from strategies/Bitcoin-Trading-Strategy-Based-on-Ichimoku-Cloud.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