Type/to search

Neurodoc Trading Bot

EMA
2
Follow
477
Followers

img
img

This Isn't Your Average DCA Strategy—It's a Thinking Trading Bot

After reviewing thousands of Pine Script codes, this "Master Trading Bot" genuinely has some serious chops. The author has elevated DCA (Dollar Cost Averaging) to new heights: instead of mindless averaging down, it's an intelligent position-sizing system based on technical indicators. Starting with 5% position size, incrementing by 2.5% per DCA, capped at 100%. This progressive capital management approach is more scientific than traditional equal-amount averaging.

The key lies in DCA trigger conditions: price must drop below average cost AND meet a dynamic threshold of 2% + step×4%. First DCA requires 2% drop, second needs 6%, third needs 10%. This design prevents frequent averaging in minor fluctuations, only adding positions during genuine pullbacks.

Multiple Technical Indicators Combined, Yet Logic Remains Clear

The strategy uses 3/7/18 period EMAs for trend framework, combined with 20-period Bollinger Bands for price positioning, 52/200/3 MACD parameters favoring medium-to-long-term signals, and 14-period RSI for overbought/oversold conditions. This combination covers trend, momentum, and volatility—more reliable than single-indicator strategies.

Entry conditions are strict: Fast EMA > Slow EMA + MACD golden cross + price above BB middle + RSI < 65. All four conditions must align for entry, filtering out most false signals. Exit conditions are equally rigorous: minimum 2% profit + trend weakening + MACD death cross. This "profit-first exit" design avoids meaningless stop losses.

100% Stop Loss Seems Aggressive, But Actually Reasonable

The 100% stop loss in the code looks extreme, but the comment clarifies: "price would have to go to 0 to trigger." This effectively disables traditional stop losses, relying entirely on technical indicators and profit targets for risk management. For DCA strategies, this design makes sense—if you're adding on dips, traditional stops become counterproductive.

Real risk control comes from: 2% price drop signals + dynamic DCA thresholds + mandatory profitable exits. The strategy tracks highest price over 500 periods, triggering sell signals when current price drops 2% from peaks. This is more flexible than fixed stops, adapting to different market environments.

Capital Management Is This Strategy's Core Competitive Edge

Each buy amount = current equity × DCA percentage ÷ current price. This equity-based rather than fixed-amount approach allows the strategy to scale positions as the account grows. Initial 5% position controls single-trade risk, while progressive sizing ensures sufficient firepower for real opportunities.

Most ingenious is the "just_sold" state management: no immediate re-entry after selling unless strong bullish signals emerge. This prevents frequent trading in choppy markets, reducing commission costs and emotional trading risks.

Clear Use Cases—Not a Universal Strategy

This strategy works best for buying pullbacks within medium-to-long-term uptrends, performing poorly in bear markets or extended sideways action. The MACD 52/200 parameters favor larger timeframe trend identification, unsuitable for scalping.

RSI oversold threshold at 25 instead of 30 indicates preference for deeper pullback entries. This design captures better entry points in bull markets but risks "catching falling knives" in bear markets. Recommend using during clear uptrends, avoiding activation at market tops or downtrends.

Backtest Performance Requires Focus on Maximum Drawdown and Consecutive Losses

The strategy's theoretical logic is sound, but actual performance depends on specific backtest data. Key metrics to monitor: maximum drawdown within acceptable ranges, consecutive loss frequency, performance variations across market environments.

DCA strategies naturally add positions during declines, meaning account equity drops before rising. Investors need sufficient psychological tolerance and capital reserves. Recommend testing with small capital first, confirming strategy characteristics before scaling up investment size.

Risk Warning: All quantitative strategies carry loss risks. Historical backtests don't guarantee future returns. Strict risk management and appropriate capital allocation are essential.

Source
Pine
/*backtest
start: 2024-10-20 00:00:00
end: 2025-10-18 08:00:00
period: 1d
basePeriod: 1d
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT","balance":500000}]
*/

// This Pine Script™ code is subject to the terms of the MPL 2.0 at https://mozilla.org/MPL/2.0/
// © MTB by Neurodoc
// By Nicolás Astorga
Strategy parameters
Strategy parameters
DCA Configuration
Initial Buy Percentage (%) (Optional)
Increment per DCA Buy (%) (Optional)
Maximum Buy Percentage (%) (Optional)
Minimum Profit for Sell (%) (Optional)
Risk Management
Stop Loss (%) (Optional)
Price Drop for Sell Signal (%) (Optional)
Indicator Parameters
Fast EMA (Optional)
Medium EMA (Optional)
Slow EMA (Optional)
Bollinger Bands Length (Optional)
BB Standard Deviation (Optional)
MACD Fast (Optional)
MACD Slow (Optional)
MACD Signal (Optional)
RSI Length (Optional)
RSI Oversold (for divergence) (Optional)
Comment
All comments (0)
No data
No data
  • 1
iPhone Download
Forums
PINE Language
© 2015 - ∞ INVENTOR PTE LTD (SG)