Type/to search

Quantitative Trading Strategy Based on Daily Close Price Comparison

Cryptocurrency
Created: 2023-11-21 14:34:11
Last modified: 3 years ago
1
Follow
1779
Followers

img

Overview

This strategy is called "Daily Close Price Comparison Strategy". It is a quantitative trading strategy that makes trading decisions based on daily close prices. The strategy generates trading signals by calculating the difference between the current daily close price and the previous daily close price. When the difference exceeds a set threshold, buy or sell orders are executed.

Strategy Logic

The core logic of this strategy is to compare the close prices between the current candlestick/bar and the previous one. Specifically:

  1. Calculate the difference between the current daily close price and the previous daily close price (today - yesterday)
  2. Calculate the ratio between the difference and yesterday's close price (difference / yesterday's close)
  3. If the ratio is greater than the set positive threshold, a buy signal is generated. If the ratio is less than the set negative threshold, a sell signal is generated.
  4. Enter long or short positions according to the signals

The strategy does not set stop loss or take profit conditions, and relies on the threshold-triggered signals for entry and exit.

Advantage Analysis

  • Simple logic, easy to understand, suitable for quant trading beginners
  • Only relies on daily close prices, avoids over-frequent trading
  • Trading frequency can be controlled by adjusting the threshold

Risk Analysis

  • No stop loss, unable to control single trade loss
  • May generate consecutive trading signals resulting in over trading
  • Drawdown may be large, cannot control overall loss well

Optimization Directions

  • Add stop loss logic to control single trade loss
  • Limit number of entries to avoid over trading
  • Optimize parameters to find optimal trading frequency

Conclusion

This strategy generates trading signals by comparing daily close prices. The logic is simple and suitable for beginners to learn. But it contains certain risks and needs further optimization for live trading.

Source
Pine
/*backtest
start: 2022-11-14 00:00:00
end: 2023-11-20 00:00:00
period: 1d
basePeriod: 1h
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/

//@version=2
strategy("Daily Close Comparison Strategy (by ChartArt) correct results", shorttitle="CA_-_Daily_Close_Strat", overlay=false)

// ChartArt's Daily Close Comparison Strategy
Strategy parameters
Strategy parameters
Price Difference Threshold correct results
Comment
All comments (0)
No data
No data
  • 1
iPhone Download
Forums
PINE Language
© 2015 - ∞ INVENTOR PTE LTD (SG)