A Developer's Journey: Building a Cryptocurrency Trend Indicator

·

In technical analysis, identifying core price structure patterns—Higher Highs (HH), Higher Lows (HL), Lower Highs (LH), and Lower Lows (LL)—forms the foundation for determining market trend direction and potential reversal points. These patterns offer a clear view of the dynamic balance between supply and demand, revealing dominant market sentiment (bullish or bearish) and providing objective guidance for trading decisions.

Understanding Bullish and Bearish Market Structures

Bullish Trends: Signs of Strength

A bullish trend is confirmed when both higher highs and higher lows emerge on the price chart. A higher high occurs when a price peak surpasses the previous peak, signaling that buyers are gaining control and pushing prices upward. A higher low forms when a pullback halts above the prior low, indicating strong support and sustained buying interest.

👉 Discover how to spot powerful bullish trends before they accelerate.

Together, these patterns reflect a robust uptrend, visually represented by a series of ascending peaks and troughs. This structure suggests growing confidence among market participants and often precedes further price appreciation.

Bearish Trends: Signals of Weakness

Conversely, a bearish trend is marked by lower highs and lower lows. A lower high appears when a rally fails to exceed the previous peak, suggesting weakening buying pressure. A lower low occurs when selling intensifies, driving prices below prior support levels—an indication of increasing supply and deteriorating market health.

These formations are critical for identifying downtrends. When both highs and lows trend downward over consecutive periods, it reflects a persistent bearish momentum, often fueled by fear, profit-taking, or broader negative sentiment.

Why Quantify Trend Recognition in Crypto?

Cryptocurrency markets are uniquely volatile, operating 24/7 with strong emotional influences and relatively short historical data compared to traditional assets. In such an environment, subjective chart reading can lead to inconsistent results. That’s where quantified trend analysis becomes essential.

By algorithmically detecting sequences of higher highs/lows or lower highs/lows, traders gain an objective, repeatable method to assess market direction. This approach removes emotional bias and enhances decision-making accuracy—especially valuable in fast-moving crypto markets.

Core Keywords: cryptocurrency trend indicator, higher high higher low, lower high lower low, quantitative trading, market structure analysis, trend detection algorithm, crypto technical analysis, automated trend monitoring

Why FMZ Was Chosen for Development

The FMZ Quant Platform offers an ideal ecosystem for developing and testing algorithmic trading tools:

These features made FMZ the optimal choice for building a systematic trend detection model focused on high-low continuity.

Designing for Cryptocurrency Market Realities

Before coding began, key characteristics of crypto markets were considered:

To address these factors, the following design choices were implemented:

Implementing the Trend Detection Algorithm

Core Data Structure

Each cryptocurrency’s state is tracked independently using a structured dictionary:

data = defaultdict(lambda: {
 "daily_records": [],     # Stores prior day’s complete candle
 "trend_buffer": [],      # Holds recent price data for analysis
 "patterns": [],          # Logs completed trend cycles
 "current_trend": None,   # Tracks active trend status
 "last_processed_time": 0
})

This modular setup ensures clean separation between different assets and avoids cross-contamination of signals.

Key Logic: Detecting Continuity

The system only evaluates yesterday’s complete candle to avoid distortions from incomplete current-day data. The core function checks whether both high and low prices are rising (bullish) or falling (bearish):

def is_trend_continuing(buffer, trend_type):
    curr = buffer[-1]
    prev = buffer[-2]
    if trend_type == "BULL":
        return curr["High"] > prev["High"] and curr["Low"] > prev["Low"]
    elif trend_type == "BEAR":
        return curr["High"] < prev["High"] and curr["Low"] < prev["Low"]

Only when both conditions are met for at least three consecutive days is a trend officially confirmed.

👉 See how automated systems can detect trends before retail traders react.

Performance Analysis Across Major Cryptocurrencies

Backtested from 2020 to mid-2025 using FMZ platform data, here's how the indicator performed across BTC, ETH, and BNB.

Ethereum (ETH): High Volatility, Big Moves

ETH showed explosive potential during bullish phases—such as the 26.94% surge from May 6–9, 2025. However, it also exhibited erratic behavior, including a "bullish" phase that yielded just -0.17%. On average:

Bitcoin (BTC): Stability Amid Downturns

BTC demonstrated relative stability despite being in a bear-dominant phase (6 out of 10 cycles). Key metrics:

Binance Coin (BNB): Consistent Uptrends

BNB stood out with 7 bullish cycles out of 10:

Frequently Asked Questions

Q: Can this indicator predict future price movements?
A: No—it identifies existing trends based on confirmed price structures. It does not forecast future moves but helps confirm ongoing momentum.

Q: Why require both higher high AND higher low?
A: Requiring both filters out false signals. A higher high alone could be a spike; combining it with a higher low confirms sustained demand.

Q: Is this suitable for short-term trading?
A: Yes, especially for swing trades lasting 3–5 days. Due to its 3-day confirmation rule, it’s less effective for scalping.

Q: How often should I check the signals?
A: Daily checks are sufficient since the model uses completed daily candles. Real-time updates aren’t necessary.

Q: Does it work during sideways markets?
A: Less effectively. In ranging conditions, signals may flip frequently or fail to trigger, which is normal and expected.

Q: Can I apply this to other assets?
A: Absolutely. The logic works for stocks, forex, or commodities—any market with clear price action and sufficient volatility.

Practical Uses and Limitations

What This Tool Can Do

What It Cannot Do

Room for Improvement

While functional, several enhancements could increase reliability:

👉 Start applying systematic trend analysis to your strategy today.

Final Thoughts on This Experiment

This project successfully transformed classic technical analysis concepts into an automated monitoring system. By leveraging FMZ’s infrastructure, we built a tool that objectively tracks market structure across major cryptocurrencies.

Its real value lies in offering a clear, data-backed perspective on market conditions—helping traders avoid emotional decisions and focus on statistically meaningful patterns. As more data accumulates over time, the insights derived from long-term trend frequency and duration will become increasingly valuable.

While not a standalone trading solution, this indicator serves as a powerful foundation—a starting point for deeper analysis, strategy development, and disciplined decision-making in the ever-evolving world of digital assets.