Type/to search

Stop Loss and Take Profit Strategy Based on Doji Pattern

Common strategy
Created: 2024-02-02 17:17:38
Last modified: 3 years ago
1
Follow
1802
Followers

img

Overview

This strategy is based on the Doji pattern. When a Doji pattern appears, a buy stop order is placed between the high of the Doji and the high of the previous candle, and a sell stop order is placed between the low of the Doji and the low of the previous candle. When the price triggers the stop orders, you can choose to exit with fixed stop loss and take profit, or use the highest and lowest price of the Doji pattern as stop loss and take profit. This strategy works well on higher timeframes like daily and weekly to filter out noise.

Strategy Logic

When a Doji pattern appears, it indicates a change in the supply and demand relationship, with forces becoming more balanced, which may lead to a price reversal. This strategy takes advantage of the price reversal signal indicated by Doji to capture opportunities through stop orders. Specifically, the criteria for determining a Doji pattern is:

body=close-open range=high-low abody=abs(body) ratio=abody/range data=(abs(open - close) <= (high - low) * Doji)

If abs(open-close) <= (high-low)*Doji parameter, it is considered a Doji pattern, and stop orders will be placed. The position of the stop orders is:

longDist= longcandle[1] and range[1]>range? high: max(high,high[1]) shortDist= longcandle[1] and range[1]>range? low: min(low,low[1])

If the body of the previous candle is large, the buy stop order is placed between the high of the Doji and the high of the previous candle. If the previous candle has a small body, the buy stop order is placed at the high of the Doji. The sell stop order follows the same logic.

There are two options for exits:

  1. Fixed stop loss and take profit
strategy.exit("exit buy","buy stop",loss=SL, profit=TP, when=Use_SL_TP)
  1. Use highest and lowest price of Doji as stop loss and take profit
strategy.close("buy stop",when=not Use_SL_TP and close<dojilow)

Advantage Analysis

The advantages of this strategy are:

  1. Simple to implement.
  2. Takes advantage of efficient price reversal signals from Doji pattern.
  3. Customizable stop loss and take profit parameters to control risk.
  4. Works well on higher timeframes to filter out noise.

Risk Analysis

There are some risks with this strategy:

  1. Doji pattern does not always lead to price reversal, may face stop loss. Solution is to reasonably set stop loss distance to limit loss per trade.
  2. Too much noise in Doji signals on lower timeframes. Should only run on higher timeframes like daily and weekly.
  3. Risk of unlimited losses without stop loss and take profit. Must use them properly.

Optimization Directions

Some ways to optimize the strategy:

  1. Optimize Doji parameter for different trading instruments.
  2. Test different combinations of stop loss and take profit.
  3. Dynamic stop loss based on ATR.
  4. Combine with other indicators to determine optimal entry.

Conclusion

The overall performance of this strategy is good. By capturing Doji price reversal opportunities, it can generate decent trading signals. Also simple to implement and applicable across multiple instruments. With continuous testing and optimizations, better results can be expected.

Source
Pine
/*backtest
start: 2024-01-02 00:00:00
end: 2024-02-01 00:00:00
period: 1h
basePeriod: 15m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/

//@version=3
//This is a simple strategy based on Doji star candlestick
//It places two orders: buy stop at doji star high or previous candle high and sell stop at doji star low or previous candle low.
//This strategy works very well with high time frames like Weekly TF because it eliminates the noise in doji formation.
Strategy parameters
Strategy parameters
Use stop loss and take profit?
Take Profit in ticks
Stop Loss in tiks
Doji size
Comment
All comments (0)
No data
No data
  • 1
Forums
PINE Language
Get the app
iPhone Download
© 2015 - ∞ INVENTOR PTE LTD (SG)