The resource loading... loading...

Three-Week High-Low Momentum Trading Strategy

Author: ChaoZhang, Date: 2024-07-30 10:44:11
Tags: FVGOHLC

img

See also:

This strategy is a dynamic trading strategy based on three-cycle highs and lows. It uses price data from the last three weeks to identify potential buying and selling opportunities. The strategy focuses primarily on the relationship between the latest highs, the latest closing price, and the closing price three weeks ago, and generates trading signals by comparing these price levels.

The Principles of Strategy

The core principles of the strategy include the following key elements:

  1. The calculation indicator is:

    • Latest highs: using the ta.highest function to calculate the highest price for the last 30 trading days (approximately 4 weeks).
    • The latest closing price: use close[1] to get the closing price of the day before.
    • Closing price three weeks ago: use close[30] to get the closing price before 30 trading days.
  2. Conditions for purchase:

    • Condition 1: The latest high is greater than or equal to the closing price three weeks ago.
    • Condition 2: The latest closing price is higher than the closing price three weeks ago.
  3. Conditions for sale:

    • When the latest closing price is higher than the closing price three weeks ago, a sell signal is triggered.
  4. Execution of the transaction:

    • When the buy signal is triggered, it is executed as a multiple entry.
    • When the sell signal is triggered, the liquidation ends the current multi position.
  5. See also:

    • Use the plotshape function to mark buy and sell signals on a chart.

This design is intended to capture the upward movement when the price breaks out of its three-week-old level, while breaking even in time when the price falls back to protect profits.

Strategic advantages

  1. Medium-term trend capture: The strategy is able to effectively identify the formation and continuation of a medium-term trend by comparing the current price to the price level three weeks ago.

  2. Noise filtering: The use of a three-cycle time frame helps filter out short-term market fluctuations and improves signal reliability.

  3. Dynamic Adaptation: The strategy is based on the latest price data and constantly updates the judgement criteria to be able to dynamically adapt to market changes.

  4. Risk management: By setting clear selling conditions, strategies can be used to effectively control risk and stabilize it in a timely manner when the market shifts.

  5. Simple and easy to understand: Strategy logic is intuitive, easy to understand and implement, suitable for both novice and experienced traders.

  6. Visualization support: Clearly marked buy and sell signals on the chart, which facilitates intuitive judgments and feedback analysis by traders.

Strategic risks

  1. False breakout risk: In the horizontal market, there may be frequent false breakouts, leading to excessive trading and unnecessary loss of processing fees.

  2. Delay: Using three-cycle historical data can cause signal lag and miss the best time to enter a rapidly changing market.

  3. Single time frame limitations: data that rely on only three cycles may ignore important market information from other time frames.

  4. Lack of stop-loss mechanism: The current strategy does not have a clear stop-loss mechanism and may face higher losses in times of sharp market fluctuations.

  5. Excessive reliance on closing prices: The strategy is based primarily on closing prices and may ignore important price changes in the market.

  6. Lack of transaction confirmation: Failure to take transaction factors into account may result in false signals during low-volume periods.

Optimization of strategy

  1. Multi-time frame analysis: Integrates data from multiple time frames, such as the sunline, sunline, and moonline, to provide a more comprehensive view of the market.

  2. Introduction of traffic indicators: Combined with traffic analysis, signal reliability can be improved, especially in terms of breakthrough confirmation.

  3. Dynamic stop-loss mechanisms: Implement adaptive stop-loss strategies, such as tracking stops or ATR-based stops, to better manage risk.

  4. Signal filters: Adding additional technical indicators or market sentiment indicators, such as RSI or MACD, to reduce false signals.

  5. Optimized entry: Consider using a cap or observation range instead of a direct market entry to get a better transaction price.

  6. Position management: Implement a dynamic position management strategy that adjusts the position size of each trade based on market volatility and account risk.

  7. Market condition recognition: Logic of identifying market conditions (trends, closings, high volatility) using different trading parameters in different market environments.

  8. Retesting and optimization: Retesting a large amount of historical data to optimize policy parameters such as time cycles, condition thresholds, etc.;

Summary

The three-cycle high-low momentum trading strategy is a simple and effective medium-term trend tracking method. By comparing the latest highs, closing prices and closing prices three weeks ago, the strategy is able to capture price breakouts and momentum changes. Its advantages are that it can filter short-term noise, capture medium-term trends, and its logic is simple to understand. However, the strategy also faces challenges such as false breakouts, signal lag and inadequate risk management.

Future optimization directions should focus on multi-time frame analysis, transaction confirmation, dynamic risk management, and market condition identification. Through these improvements, strategies are expected to perform more robustly in different market environments and provide more reliable decision support for traders.

Overall, this strategy provides a good starting point for quantitative trading and has the potential to become a powerful trading tool through continuous optimization and refinement. However, in practical applications, investors should be cautious, fully aware of market risks, and use the strategy in conjunction with their own risk tolerance and investment goals.

Overview

This strategy is a momentum trading approach based on three-week high and low points. It utilizes price data from the recent three weeks to identify potential buying and selling opportunities. The strategy primarily focuses on the relationship between the latest high, the latest closing price, and the closing price from three weeks ago, generating trading signals by comparing these price levels. This method aims to capture medium-term price trends while avoiding the impact of short-term market noise.

Strategy Principle

The core principles of this strategy include the following key elements:

  1. Indicator Calculations:

    • Latest High: Uses the ta.highest() function to calculate the highest price over the last 30 trading days (approximately 4 weeks).
    • Latest Close: Uses close[1] to get the closing price of the previous day.
    • Three Weeks Ago Close: Uses close[30] to get the closing price from 30 trading days ago.
  2. Buy Conditions:

    • Condition 1: The latest high is greater than or equal to the closing price from three weeks ago.
    • Condition 2: The latest closing price is greater than the closing price from three weeks ago.
  3. Sell Condition:

    • Triggers a sell signal when the latest closing price is greater than the closing price from three weeks ago.
  4. Trade Execution:

    • Enters a long position when the buy signal is triggered.
    • Closes the current long position when the sell signal is triggered.
  5. Visualization:

    • Uses the plotshape() function to mark buy and sell signals on the chart.

This design aims to capture upward momentum when the price breaks above the level from three weeks ago, while promptly closing positions to protect profits when the price falls back.

Strategy Advantages

  1. Medium-Term Trend Capture: By comparing current prices with levels from three weeks ago, the strategy effectively identifies the formation and continuation of medium-term trends.

  2. Noise Filtering: Using a three-week time frame helps filter out short-term market fluctuations, improving the reliability of signals.

  3. Dynamic Adaptation: The strategy continuously updates its decision criteria based on the latest price data, allowing it to dynamically adapt to market changes.

  4. Risk Management: Through clear sell conditions, the strategy can close positions promptly when the market turns, effectively controlling risk.

  5. Simple and Understandable: The strategy logic is intuitive, easy to understand and implement, suitable for both novice and experienced traders.

  6. Visual Support: Buy and sell signals are clearly marked on the chart, facilitating intuitive judgment and backtesting analysis for traders.

Strategy Risks

  1. False Breakout Risk: In sideways markets, frequent false breakouts may occur, leading to excessive trading and unnecessary transaction fee losses.

  2. Lagging Nature: Using historical data from three weeks may result in lagging signals, potentially missing optimal entry points in rapidly changing markets.

  3. Single Time Frame Limitation: Relying solely on three-week data may overlook important market information from other time frames.

  4. Lack of Stop-Loss Mechanism: The current strategy lacks a clear stop-loss mechanism, potentially facing significant losses during severe market fluctuations.

  5. Over-reliance on Closing Prices: The strategy mainly bases its judgments on closing prices, potentially ignoring important intraday price movements.

  6. Lack of Volume Confirmation: Not considering volume factors may lead to false signals during periods of low trading volume.

Strategy Optimization Directions

  1. Multi-Time Frame Analysis: Integrate data from multiple time frames, such as daily, weekly, and monthly, to provide a more comprehensive market perspective.

  2. Incorporate Volume Indicators: Combining volume analysis can improve signal reliability, especially in breakout confirmation.

  3. Dynamic Stop-Loss Mechanism: Implement adaptive stop-loss strategies, such as trailing stops or ATR-based stops, for better risk management.

  4. Signal Filters: Add additional technical or market sentiment indicators, like RSI or MACD, to reduce false signals.

  5. Entry Optimization: Consider using limit orders or observation zones instead of direct market orders for entry to obtain better execution prices.

  6. Position Management: Implement dynamic position sizing strategies, adjusting the size of each trade based on market volatility and account risk.

  7. Market State Recognition: Add logic to identify market states (trending, ranging, high volatility) and adopt different trading parameters for different market environments.

  8. Backtesting and Optimization: Conduct extensive historical data backtesting to optimize strategy parameters such as time periods and condition thresholds.

Summary

The Three-Week High-Low Momentum Trading Strategy is a simple yet effective method for medium-term trend following. By comparing the latest high, latest close, and the closing price from three weeks ago, the strategy can capture price breakouts and momentum changes. Its strengths lie in filtering short-term noise, capturing medium-term trends, and its simple, easy-to-understand logic. However, the strategy also faces challenges such as false breakouts, signal lag, and insufficient risk management.

Future optimization directions should focus on multi-time frame analysis, volume confirmation, dynamic risk management, and market state recognition. Through these improvements, the strategy has the potential to perform more robustly in different market environments, providing traders with more reliable decision support.

Overall, this strategy provides a good starting point for quantitative trading. With continuous optimization and refinement, it has the potential to become a powerful trading tool. However, investors should be cautious when applying it in practice, fully recognizing market risks and using the strategy in conjunction with their own risk tolerance and investment objectives.


/*backtest
start: 2024-06-28 00:00:00
end: 2024-07-28 00:00:00
period: 2h
basePeriod: 15m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/

//@version=5
strategy("Buy and Sell Strategy", overlay=true)

// Calculate the latest high, close, and volume
latestHigh = ta.highest(high, 30) // 4 weeks = 30 trading days
latestClose = close[1]


// Calculate the high, close, 
threeWeeksAgoClose = close[30] // 4 weeks = 30 trading days + 1 current day


// Condition 1: Buy if latest high >= 4 weeks ago close
condition1 = latestHigh >= threeWeeksAgoClose

// Condition 2: Buy if latest close > 4 weeks ago close
condition2 = latestClose > threeWeeksAgoClose



// Generate buy and sell signals
buySignal = condition1  
sellSignal = condition2

// Entry and exit logic using if statements
if buySignal
    strategy.entry("Buy", strategy.long)
    
if sellSignal
    strategy.close("Buy")

// Plotting buy and sell signals on the chart
plotshape(buySignal, color=color.green, style=shape.labelup, location=location.belowbar, text="Buy")
plotshape(sellSignal, color=color.red, style=shape.labeldown, location=location.abovebar, text="Sell")



Related

More