Auftrag beendet
Spezifikation
📄 Development Specification Sheet: Spike Detection Expert Advisor (EA)
Project Name:
SpikeSentry EA – Expert Advisor based on Spike Indicator
Purpose:
To develop an EA that opens trades based on arrow signals from an existing custom spike-detection indicator and manages those trades with options for immediate profit-taking or a trailing stop based on candle count or point distance.
Indicator Integration:
-
The EA must read arrow buffer signals from the custom spike-detection indicator.
-
Buy trade is triggered when the up arrow appears.
-
Sell trade is triggered when the down arrow appears.
Entry Logic:
-
Buy when up arrow appears on the current or previous candle -(Arrows Should Not Be Visible in EA)
-
Sell when down arrow appears on the current or previous candle - (Arrows Should Not Be Visible in EA)
-
Allow only one trade per signal (no duplicate entries on the same signal)
Trade Management Options (User Inputs):
✅ Immediate Take Profit (Optional):
-
[true/false] Use Immediate Take Profit
-
If true, the EA should close the trade as soon as price enters profit (even 1 point/pip).
🔁 Trailing Stop Option (Alternative to Immediate TP):
-
[true/false] Use Trailing Stop
-
If true, activate trailing logic below:
Trailing Stop Settings:
-
Start trailing after X candles in profit
-
Trail behind last X candles
-
Alternative option: Trail by fixed distance → TrailByPoints = 100 (optional override of candle method)
-
The trailing stop should only activate once the trade is in profit.
-
Drop Down Menu to select between the Trailing Functions
Stop Loss Configuration:
-
[int] SL by Candles → SL_CandleDistance = 3
Set SL at the high (for sell) or low (for buy) of # candles from the entry candle.
OR
-
[int] SL by Points → SL_Points = 100
Set SL X points away from entry price.
Only one SL method should be active at a time (candle-based or point-based).
Additional User Inputs:
-
Lot Size → Lots = 0.10
-
Magic Number → MagicNumber = 456789
-
Slippage → Slippage = 5
-
Max Open Trades → MaxTrades = 1
-
Allow Buy/Sell separately → AllowBuy = true , AllowSell = true
-
Comment on Trade → TradeComment = "SpikeSentryEA"
Chart & Visual Feedback:
-
Mark trade entries on the chart (e.g., with small arrow and text “Buy Opened” / “Sell Opened”)
-
Optional: draw trailing stop and SL lines in real-time
Error Handling & Logging:
-
Check for indicator buffer validity on startup
-
Write clear logs in the Experts tab for each action (entry, SL move, TP hit)
Compatibility:
-
Must be compatible with MetaTrader 5 (MT5)
-
Must work with any broker and on all symbols (Forex, Synthetic, Commodities)
-
Must handle missing indicator buffer errors gracefully