Skip to main content

Average Directional Index (ADX) and Ichimoku Kinko Hyo

The strategy aims to implement a momentum trading approach that uses two technical indicators, the Average Directional Index (ADX) and Ichimoku Kinko Hyo, to identify entry and exit signals.

The Average Directional Index (ADX) is a trend indicator that measures the strength of a current trend, whether it's an uptrend or downtrend. The ADX ranges from 0 to 100, with values above 25 indicating a strong trend.

Ichimoku Kinko Hyo is a complex indicator that consists of several lines and can be used to identify trends, support and resistance levels, and momentum. This indicator is primarily used in trending markets.

The strategy involves monitoring these indicators and identifying signals that suggest a high probability of a trend continuation. For instance, when the ADX is above 25 and the Ichimoku Kinko Hyo shows a bullish trend, it could suggest a buy signal. Conversely, if the ADX is below 25 and the Ichimoku Kinko Hyo indicates a bearish trend, it could suggest a sell signal.


This example strategy is machine generated using Gunbot AI. Review its behavior carefully in a simulated bot instance before using parts of this code in production.

// initialize customStratStore within pairLedger object = || {};

// forced wait time reduces risk of double orders
function checkTime() {
return ! || typeof !== "number"
? ( =, false)
: ( - > 8000);
const enoughTimePassed = checkTime();

// set timestamp for checkTime in next round
const setTimestamp = () => =;

// calculate ADX
const adx =;
console.log("ADX:", adx);

// calculate Ichimoku Kinko Hyo
const tenkan =;
const kijun =;
const senkouSpanA =;
const senkouSpanB =;
const chikou =;
console.log("Tenkan:", tenkan);
console.log("Kijun:", kijun);
console.log("Senkou Span A:", senkouSpanA);
console.log("Senkou Span B:", senkouSpanB);
console.log("Chikou:", chikou);

if (enoughTimePassed) {
// calculate trading conditions
const adxCondition = adx > 25;
const ichimokuCondition = tenkan > kijun &&[] < senkouSpanA &&[] < senkouSpanB &&[] > senkouSpanA &&[] > senkouSpanB;
const sellCondition = chikou >[];

// fire orders when conditions are met
if (adxCondition && ichimokuCondition && ! {
const buyAmount = parseFloat( /;
} else if (sellCondition && {

// Code is machine generated, review it and run in simulator mode first