Type/to search

Long Breakthrough Strategy Based on K-Line Construction

Common strategy
Created: 2024-01-05 12:37:46
Last modified: 3 years ago
1
Follow
1802
Followers

img

Overview

This strategy realizes long position breakout trading on the 4-hour line of Tesla by setting simple K-line pattern judgment rules. The strategy has the advantages of simple implementation, clear logic, easy to understand, etc.

Strategy Principle

The core judgment logic of the strategy is based on the following 4 K-line pattern rules:

  1. The lowest price of the current K-line is lower than the opening price
  2. The lowest price of the current K-line is lower than the lowest price of the previous K-line
  3. The closing price of the current K-line is higher than the opening price
  4. The closing price of the current K-line is higher than the opening price and closing price of the previous K-line

When all 4 rules are met at the same time, a long position opening operation is performed.

In addition, the strategy also sets stop loss and take profit to close positions when price triggers stop loss or take profit conditions.

Advantage Analysis

The strategy has the following advantages:

  1. The K-line judgment rules used are very simple and straightforward, easy to understand, and easy to practice.
  2. It is completely based on the judgment of price entities without the use of overly complex technical indicators, and the backtest results are straightforward.
  3. The code implementation is small in size, runs efficiently, and is easy to optimize and improve.
  4. Stop loss and take profit can be flexibly set by adjusting parameters to control risks.

Risk Analysis

The main risks to note are:

  1. Fixed quantity is used for opening positions without considering position sizing, which may pose risks of overtrading.
  2. No filters are set which may generate too many invalid trades in range-bound markets.
  3. Insufficient backtest data may bias the judgment of the strategy performance.

The following methods can be adopted to mitigate risks:

  1. Incorporate position sizing model to dynamically adjust trade size based on capital size.
  2. Add trade filters to avoid disorderly opening of trades in choppy market conditions.
  3. Collect more historical data to expand backtest duration and improve result reliability.

Optimization Directions

Potential optimization directions for the strategy include:

  1. Incorporate position sizing module to determine trade size based on capital utilization ratio.
  2. Design stop loss and take profit trailing mechanisms for flexible exits.
  3. Add trade filters to avoid invalid trades.
  4. Auto-optimize parameters using machine learning methods.
  5. Support spread trading across multiple products.

Conclusion

This strategy realizes long breakthrough trading using simple K-line pattern rules. Although there is some room left for improvement, from the perspective of simplicity and directness, it is a very suitable long position strategy for beginners to understand and use. With continuous optimizations, the strategy performance can be further enhanced.

Source
Pine
/*backtest
start: 2023-12-01 00:00:00
end: 2023-12-31 23:59:59
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/
// © TheQuantScience

//@version=5
Strategy parameters
Strategy parameters
Start Date
Start Month
Start Year
End Date
End Month
End Year
TakeProfit_long
StopLoss_long
Comment
All comments (0)
No data
No data
  • 1
Forums
PINE Language
Get the app
iPhone Download
© 2015 - ∞ INVENTOR PTE LTD (SG)