Type/to search

Pattern Recognition Pinbar Trading Strategy

Cryptocurrency
Created: 2023-09-18 14:14:51
Last modified: 3 years ago
1
Follow
1781
Followers

Overview

This strategy implements price pattern trading by identifying candlestick patterns. It looks for the nearest pinbar pattern and goes long or short based on the signal. Traders can set take profit and stop loss multiples. A trailing stop locks in more profit as the trend develops.

Strategy Logic

Identify if the current candle meets pinbar requirements - body in lower half, close and open near low. Long signal is the opposite - body in upper half, close/open near high. Find the last signal candle and calculate its body height. Set take profit to N times the height, and stop loss to M times the height (M < N).

After entry, begin trailing the stop. Keep moving take profit towards profit while maintaining stop loss, until either is hit.

Advantage Analysis

  • Price patterns identify low frequency signals, avoiding overtrading
  • Customizable profit/loss multiples balance risk and reward
  • Trailing stop locks in more profits
  • Filters false breakouts avoiding traps

Risk Analysis

  • Pattern recognition accuracy is never 100%
  • Small stop loss risks being stopped out by noise
  • Take profit needs timely adjusting when trailing

Risks can be reduced via parameter optimization, adding indicators etc.

Optimization Directions

  • Test different take profit and stop loss settings
  • Add indicators to filter false signals
  • Optimize pattern recognition logic
  • Test robustness across products

Conclusion

This strategy identifies opportunities through pattern recognition with good backtest results. Reasonable stops control trade risk. Further refinements like parameter optimization can make it a simple and practical system.

Source
Pine
/*backtest
start: 2023-09-10 00:00:00
end: 2023-09-17 00:00:00
period: 5m
basePeriod: 1m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/

//@version=5
// 
// Pinbar strategy script by samgozman (https://github.com/samgozman)
// 
Strategy parameters
Strategy parameters
Profit options
Profit multiplier
Loss multiplier
Trading options
Use trailing stops?
Close trade if opposit signal occures?
Enter long trades?
Enter short trades?
Backtest Time Period
Begin Backtest at Start Date
Start Date
Comment
All comments (0)
No data
No data
  • 1
iPhone Download
Forums
PINE Language
© 2015 - ∞ INVENTOR PTE LTD (SG)