Scalping Dips in Bull Market Strategy
The Scalping Dips in Bull Market strategy is a trend-following strategy. It buys the dip during bull markets, sets a wide stop loss to lock in profits when exiting positions. This strategy is suitable for bull…

Overview
The Scalping Dips in Bull Market strategy is a trend-following strategy. It buys the dip during bull markets, sets a wide stop loss to lock in profits when exiting positions. This strategy is suitable for bull markets and can yield excess returns.
Strategy Logic
This strategy first calculates the percentage price change over a lookback period. When the price drops by more than the preset callback percentage, a buy signal is triggered. At the same time, the moving average line needs to be above the close price as a confirmation of the uptrend.
After entering a position, stop loss and take profit prices are set. The stop loss percentage is large to ensure sufficient funds; the take profit percentage is small for fast profit taking. When the stop loss or take profit is triggered, the position will be closed.
Advantage Analysis
The advantages of this strategy are:
- Aligns with the trend following methodology to obtain excess returns
- Reasonable callback percentage and trend criteria ensure accuracy
- The stop loss design fully considers capital safety
- Quick profit taking by take profit settings and drawdown control
Risk Analysis
There are also some risks with this strategy:
- Overly deep retracement or trend reversal may lead to losses
- Drawdown risk from the wide stop loss
- Difficulty satisfying stop loss/profit conditions during range-bound markets
Counter measures: Strictly control position sizing, adjust stop loss percentage, properly reduce take profit exit ratio to mitigate risks.
Optimization Directions
The strategy can be optimized in the following aspects:
- Dynamically adjust the callback percentage to optimize entry opportunities
- Add more indicators to improve decision accuracy
- Incorporate volatility measures to dynamically tune stop loss/profit ratios
- Optimize position sizing to better control risks
Conclusion
The Scalping Dips in Bull Market strategy locks in excess returns using a wide stop loss. It capitalizes on buying callback dips in bull market trends for profit opportunities. Fine tuning parameters and risk controls can yield good steady returns.
Parameters
| Name | Default | What it controls |
|---|---|---|
| v_input_1 | true | From Month |
| v_input_2 | 10 | From Day |
| v_input_3 | 2020 | From Year |
| v_input_4 | true | Thru Month |
| v_input_5 | true | Thru Day |
| v_input_6 | 2112 | Thru Year |
| v_input_7 | true | Show Date Range |
| v_input_8 | true | Lookback Period |
| v_input_9 | 50 | Moving Average |
| v_input_10 | 2 | v_input_10 |
| v_input_11 | 10 | v_input_11 |
| v_input_12 | 3 | v_input_12 |
Source Pine Script
/*backtest
start: 2023-12-30 00:00:00
end: 2024-01-29 00:00:00
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/
// © Coinrule
//@version=3
strategy(shorttitle='Scalping Dips On Trend',title='Scalping Dips On Trend (by Coinrule)', overlay=true, initial_capital = 1000, default_qty_type = strategy.percent_of_equity, default_qty_value = 30, commission_type=strategy.commission.percent, commission_value=0.1)
//Backtest dates
fromMonth = input(defval = 1, title = "From Month")
fromDay = input(defval = 10, title = "From Day")
fromYear = input(defval = 2020, title = "From Year")
thruMonth = input(defval = 1, title = "Thru Month")
thruDay = input(defval = 1, title = "Thru Day")
thruYear = input(defval = 2112, title = "Thru Year")
showDate = input(defval = true, title = "Show Date Range")
start = timestamp(fromYear, fromMonth, fromDay, 00, 00) // backtest start window
finish = timestamp(thruYear, thruMonth, thruDay, 23, 59) // backtest finish window
window() => true
inp_lkb = input(1, title='Lookback Period')
perc_change(lkb) =>
overall_change = ((close[0] - close[lkb]) / close[lkb]) * 100
// Call the function
overall = perc_change(inp_lkb)
//MA inputs and calculations
MA=input(50, title='Moving Average')
MAsignal = sma(close, MA)
//Entry
dip= -(input(2))
strategy.entry(id="long", long = true, when = overall< dip and MAsignal > close and window())
//Exit
Stop_loss= ((input (10))/100)
Take_profit= ((input (3))/100)
longStopPrice = strategy.position_avg_price * (1 - Stop_loss)
longTakeProfit = strategy.position_avg_price * (1 + Take_profit)
strategy.close("long", when = close < longStopPrice or close > longTakeProfit and window())Published by ChaoZhang on the FMZ strategy square · last modified 2024-01-30. Collected in the Quant Trading Vault. Unvalidated research: re-test with your own data and costs before trusting it.
Build this with AgenKit
A spec is not a trading system. Paste this into your coding agent and AgenKit runs a specialist team — architecture, test-first build, risk gates, review — with paper trading on by default.
/agenkit build a production-grade trading bot with a backtest engine, risk controls and paper trading by default from strategies/Scalping-Dips-in-Bull-Market-Strategy.md- npx agenkit install engineering-kit in your project
- Paste the command into your agent and approve each phase
- Get tests, backtest, risk controls and a paper-trading switch
Understand it first
Before you run this, read the lesson behind the idea and how to backtest it honestly. Specs like this one are the survivors of an unknown number of trials; deflate their results accordingly.
Related specs
- 20Bitcoin and Gold 5 Minute Scalping Strategy 20Pine Script · Scalping · 1h
- Bollinger Bands Heiken Ashi Short term Trading StrategyPine Script · Scalping · 1d
- Scalping EMA ADX RSI with Buy SellPine Script · Scalping · 5m
- Super ScalperPine Script · Scalping · 1m
- Advanced Multi Trend Confirmation EMA Supply Demand Zone Dynamic Scalping StrategyPine Script · Scalping · 1d
- Bollinger Awesome Alert R1Pine Script · Scalping · 1h