Create an Expert Advisor for 30-Day Compounding Trading Strategy

Achieve $1,000 in 30 days with our advanced compounding trading EA for

Workflow Stage:
Use Case
Save Prompt
Prompt Saved

Overview

This prompt aims to guide developers in creating an Expert Advisor for a specific trading strategy using AlgoBuilder AI. Programmers and traders will benefit from the detailed requirements and structure for implementing an effective trading tool.

Prompt Overview

Purpose: This EA aims to implement a 30-day compounding trading strategy using reversal candlestick patterns.

Audience: Designed for Forex and commodity traders seeking automated trading solutions with precise risk management.

Distinctive Feature: The EA dynamically adjusts daily profit targets while ensuring compliance with strict trading rules and risk limits.

Outcome: Users can expect to achieve a $1,000 account balance from an initial $100 through disciplined trading practices.

Quick Specs

Variables to Fill

No inputs required — just copy and use the prompt.

Example Variables Block

No example values needed for this prompt.

The Prompt


You are tasked with developing an Expert Advisor (EA) compatible with AlgoBuilder AI that implements a precise 30-day compounding trading strategy.
**Starting Conditions:**
– Begin with a $100 account aiming to reach $1,000.
**Trading Strategy:**
– The EA will trade bullish and bearish reversal candlestick patterns detected at candle close, specifically:
– Bullish Pin Bar
– Bearish Pin Bar
– Morning Star
– Evening Star
– Bullish Engulfing
– Bearish Engulfing
**Timeframe and Asset Support:**
– Operate on user-selectable timeframes of H1 or H4.
– Support all Forex pairs and commodities, explicitly including XAUUSD.
**Key Requirements:**
1. Trading Strategy Implementation:
– Detect reversal patterns only at candle close.
– Enter market BUY orders immediately when bullish patterns are confirmed; SELL orders when bearish patterns are confirmed.
– Use a hard Stop Loss of 30 pips (or 300 points for XAUUSD) and Take Profit of 60 pips (or 600 points for XAUUSD).
– Allow timeframe selection input for H1 or H4.
2. 30-Day Compounding “Blitz Spreadsheet” Model:
– Include inputs for:
– DailyProfitPercent (default 5%)
– TradingDaysPerMonth (default 21)
– Option to auto-adjust DailyProfitPercent to achieve $1,000 in 30 days.
– Calculate daily profit target as:
– DailyTarget = PreviousDayEquity × DailyProfitPercent at the start of each trading day.
– Cease opening new trades once daily closed P/L ≥ DailyTarget, resuming only the next trading day.
– Roll equity forward daily:
– NextDayEquity = PreviousDayEquity + realized daily P/L.
– Permit user adjustment to daily profit percentage to meet the 30-day $1,000 goal precisely.
3. Risk and Money Management:
– User-configurable RiskPercent per trade (e.g., 1%).
– Dynamically calculate lot size as:
– LotSize = (Equity × RiskPercent) ÷ (SL_pips × PipValue), adjusting for instrument and timeframe.
– Implement Break-Even trade management: move SL to entry price once +30 pips profit is reached.
– Trail SL by 20 pips after break-even is active.
– Enforce a DailyRiskPercent limit (e.g., 5%) applied cumulatively to the risk of all open trades to prevent overexposure.
4. Integration and Testing:
– Use AlgoBuilder AI syntax including handle_init, handle_tick, and other relevant handlers.
– Expose all critical parameters as configurable inputs.
– Deliver pure MQL4/MQL5 code without reliance on external libraries to ensure compatibility with MT4/MT5 Strategy Tester environments.
– Provide a sample configuration (.set file) targeting backtesting on XAUUSD H1.
– Create an on-chart dashboard displaying:
– Symbol
– Timeframe
– Current equity
– Daily P/L vs DailyTarget
– Last detected pattern with timestamp
– Count and combined P/L of open trades
– SL/TP levels
– Current lot size
– MagicNumber
5. Deliverables:
– Fully commented and readable EA source (.mq4 or .mq5) compatible with AlgoBuilder AI.
– A detailed README covering:
– Strategy logic
– Compounding plan
– Parameter explanation
– Instructions for backtesting in AlgoBuilder and MT platforms.
– Sample backtest results with screenshots illustrating daily 5% (or adjusted) profit achievement on XAUUSD H1, including dashboard output.
– Robust error handling ensuring no duplicate trade entries and strict adherence to the compounding logic.
**Steps:**
6. Implement pattern detection logic accurately triggering only on candle close.
7. Calculate dynamic lot sizes based on equity, SL, and pip value.
8. Incorporate daily profit target calculations and trade entry constraints per compounding plan.
9. Build trade management routines including break-even and trailing stop.
10. Develop on-chart dashboard for real-time monitoring.
11. Validate compliance with AlgoBuilder AI syntax.
12. Conduct sample backtests on XAUUSD H1 using the provided sample set file.
13. Prepare comprehensive documentation and error handling.
**Output Format:**
– Deliver the entire EA source code file (.mq4 or .mq5) ready for direct use in AlgoBuilder AI and MT4/MT5, containing comprehensive inline code comments.
– Provide the README file content as separate text, sample .set file configuration, and sample backtest results documentation including screenshots descriptions.
**Notes:**
– For pattern detection, adhere strictly to standard definitions of the cited candlestick patterns.
– Pip and point calculations must account for instrument specifics (e.g., XAUUSD points differ from standard pips).
– The compounding logic must prevent exceeding daily profit targets and avoid restarting trading on the same day once the target is met.
– The dashboard must update dynamically with live trade and equity data.
– All inputs must be user-modifiable with sensible defaults.

Screenshot Examples

How to Use This Prompt

  1. Copy the prompt provided above.
  2. Paste it into your coding environment.
  3. Follow the outlined requirements and steps carefully.
  4. Implement the trading strategy as specified.
  5. Test the EA using the sample configuration file.
  6. Document your process and results thoroughly.

Tips for Best Results

  • Pattern Detection: Implement logic to identify reversal candlestick patterns only at candle close for accurate trade entries.
  • Dynamic Lot Sizing: Calculate lot sizes based on account equity, risk percentage, and stop loss to manage risk effectively.
  • Daily Profit Target: Set daily profit targets based on previous equity and allow user adjustments to meet the 30-day compounding goal.
  • On-Chart Dashboard: Create a real-time dashboard displaying key metrics like current equity, daily P/L, and last detected pattern for easy monitoring.

FAQ

  • What is the goal of the 30-day compounding strategy?
    To grow a $100 account to $1,000 through daily trading profits.
  • Which candlestick patterns does the EA detect?
    Bullish and bearish pin bars, morning stars, evening stars, and engulfing patterns.
  • What is the hard Stop Loss for trades?
    30 pips for Forex pairs and 300 points for XAUUSD.
  • How is the daily profit target calculated?
    DailyTarget = PreviousDayEquity × DailyProfitPercent at the start of each trading day.

Compliance and Best Practices

  • Best Practice: Review AI output for accuracy and relevance before use.
  • Privacy: Avoid sharing personal, financial, or confidential data in prompts.
  • Platform Policy: Your use of AI tools must comply with their terms and your local laws.

Revision History

  • Version 1.0 (February 2026): Initial release.

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Used Prompts

Related articles

System prompt for guiding AI in building Python backend and React frontend

Learn how to efficiently structure and integrate backend and frontend development.

AI Web Builder Generate Websites from Natural Language Prompts for Developers

Create functional websites quickly using simple, conversational instructions.

Analyze Lua Obfuscated Code for Interpreter or VM Functionality

This structured approach reveals the underlying logic and security implications.

Analyze Ironbrew1 Obfuscated Lua Code for Deobfuscation

This structured approach reveals the script's original logic and intent.