Spécifications
This is what I got so far with deepseek: Could you create an Expert Advisor (EA) based on the following detailed trading strategy?
Could you ensure the EA incorporates these details, especially the logic for trading the opposite direction of the news candles as well as the unbroken side of the initial range? Let me know if anything needs further clarification! Here's a conceptual outline for the Expert Advisor (EA) based on your strategy. Note that full implementation requires integration with an economic calendar (external service) and thorough backtesting:
1. Risk-to-Reward Ratio
• The EA should maintain a minimum risk-to-reward ratio of 5:1.
• I am willing to risk no more than 1% of my total account size per trade.
2. News Avoidance and Timing Adjustments
• The EA should automatically avoid trading during major and medium-impact news events by integrating an economic calendar or news filter.
• Key Rules Regarding News:
• If news events occur between 7:30 AM and 9:00 AM CST (Central Standard Time), the EA must wait for the news to take place and only start trading 15 minutes after the last news event.
• If news candles break the initial 2:00 AM–7:00 AM range:
• If the highs of the initial range are broken, the EA can trade breakouts of the news candle highs (in the direction of the broken range) or breakouts of the initial range lows (in the opposite direction).
• If the lows of the initial range are broken, the EA can trade breakouts of the news candle lows (in the direction of the broken range) or breakouts of the initial range highs (in the opposite direction).
• If the news candles do not break either side of the initial range, the EA can still trade breakouts of the unbroken side of the initial range, provided a 5-minute full-body candle breaks the range.
• No trades should be entered after 12:00 PM CST.
3. Trading Instrument and Timeframe
• The EA will trade the NAS100 index on the 5-minute timeframe.
• The initial price range to monitor is the range established between 2:00 AM and 7:00 AM CST (adjusted to align with my broker’s timezone of GMT+2).
• The range is defined by the highest and lowest points of the candle bodies (excluding wicks) during this period.
4. Entry Criteria
• The EA should place trades only when the range is broken by a full-body candle closure.
• A full-body candle is defined as one with at least a 70% body-to-wick ratio.
• Trade logic:
• If the initial range is broken by news candles, you can trade both in the direction of the news breakout (either highs or lows of the news candles) or in the opposite direction of the breakout (the unbroken side of the original range).
• If the news candles do not break the range, the EA can trade the breakout of the unbroken side of the original range using a 5-minute full-body candle.
5. Stop-Loss and Take-Profit Rules
• Initial Stop-Loss: 25 points.
• Take-Profit Target: 125 points.
• Break-Even Rule: Once the price moves 50 points in profit, the stop-loss should automatically be moved to breakeven.
6. Example Trade Setup
• I have attached an example image of a trade setup for reference.
7. Broker Timezone and Adjustments
• My broker’s timezone is GMT+2, while my local time is CST (Central Standard Time). Please ensure the range calculations are adjusted accordingly (i.e., 2:00 AM to 7:00 AM CST).
```mq4
//+------------------------------------------------------------------+
//| NAS100_NewsEA.mq4 |
//| Copyright 2023, Your Company Name |
//| https://www.yourdomain.com|
//+------------------------------------------------------------------+
#property copyright "Copyright 2023"
#property version "1.00"
#property strict
//--- Input Parameters
input double RiskPercent = 1.0; // Risk per trade (%)
input int StopLossPoints = 25; // SL (points)
input int TakeProfitPoints= 125; // TP (points)
input int BreakEvenPoints = 50; // BE at (points)
//--- Global Variables
double initialRangeHigh, initialRangeLow;
datetime newsAvoidStart, newsAvoidEnd;
bool rangeBroken = false;
//+------------------------------------------------------------------+
//| Expert initialization function |
//+------------------------------------------------------------------+
int OnInit()
{
DetermineInitialRange();
DetermineNewsPeriods(); // Requires integration with news source
return(INIT_SUCCEEDED);
}
//+------------------------------------------------------------------+
//| Expert tick function |
//+------------------------------------------------------------------+
void OnTick()
{
if(!IsTradingAllowed()) return;
static datetime lastBarTime;
if(Time[0] == lastBarTime) return;
lastBarTime = Time[0];
CheckTradingConditions();
ManageOpenPositions();
}
//+------------------------------------------------------------------+
//| Determine Initial Price Range |
//+------------------------------------------------------------------+
void DetermineInitialRange()
{
datetime cstStart = ConvertCSTToServer(2, 0); // 2:00 AM CST
datetime cstEnd = ConvertCSTToServer(7, 0); // 7:00 AM CST
initialRangeHigh = 0;
initialRangeLow = EMPTY_VALUE;
for(int i = iBarShift(NULL, 0, cstStart); i >= iBarShift(NULL, 0, cstEnd); i--)
{
double bodyHigh = MathMax(Open[i], Close[i]);
double bodyLow = MathMin(Open[i], Close[i]);
if(bodyHigh > initialRangeHigh) initialRangeHigh = bodyHigh;
if(bodyLow < initialRangeLow) initialRangeLow = bodyLow;
}
}
//+------------------------------------------------------------------+
//| Check Trading Conditions |
//+------------------------------------------------------------------+
void CheckTradingConditions()
{
// Check news impact
if(IsNewsEvent()) return;
// Check trading hours
if(TimeCurrent() > ConvertCSTToServer(12, 0)) return; // 12:00 PM CST
// Check breakout conditions
CheckRangeBreakouts();
}
//+------------------------------------------------------------------+
//| Range Breakout Logic |
//+------------------------------------------------------------------+
void CheckRangeBreakouts()
{
// Check for valid breakout candle
if(IsFullBodyCandle(0))
{
// Bullish breakout
if(Close[0] > initialRangeHigh && !rangeBroken)
{
OpenTrade(OP_BUY);
rangeBroken = true;
}
// Bearish breakout
else if(Close[0] < initialRangeLow && !rangeBroken)
{
OpenTrade(OP_SELL);
rangeBroken = true;
}
}
}
//+------------------------------------------------------------------+
//| Trade Management |
//+------------------------------------------------------------------+
void OpenTrade(int cmd)
{
double lots = CalculateLots();
int ticket = OrderSend(_Symbol, cmd, lots,
cmd == OP_BUY ? Ask : Bid,
3, 0, 0, "NewsBreakout", 0);
if(ticket > 0)
{
double sl = cmd == OP_BUY ? Bid - StopLossPoints*Point : Ask + StopLossPoints*Point;
double tp = cmd == OP_BUY ? Bid + TakeProfitPoints*Point : Ask - TakeProfitPoints*Point;
OrderModify(ticket, 0, sl, tp, 0);
}
}
//+------------------------------------------------------------------+
//| Money Management |
//+------------------------------------------------------------------+
double CalculateLots()
{
double riskAmount = AccountBalance() * RiskPercent / 100;
double tickValue = MarketInfo(_Symbol, MODE_TICKVALUE);
return NormalizeDouble(riskAmount / (StopLossPoints * tickValue), 2);
}
//+------------------------------------------------------------------+
//| News Handling Functions (Placeholder - Requires Implementation) |
//+------------------------------------------------------------------+
bool IsNewsEvent()
{
// Requires integration with news API/calendar
return false;
}
datetime ConvertCSTToServer(int hour, int minute)
{
// CST to GMT+2 conversion (requires DST handling)
return StrToTime(TimeToStr(TimeCurrent() - (8 * 3600) + (hour * 3600) + (minute * 60)));
}
//+------------------------------------------------------------------+
//| Additional Required Functions |
//+------------------------------------------------------------------+
bool IsFullBodyCandle(int bar)
{
double body = MathAbs(Close[bar] - Open[bar]);
double range = High[bar] - Low[bar];
return (range > 0) && (body/range >= 0.7);
}
void ManageOpenPositions()
{
for(int i = OrdersTotal()-1; i >= 0; i--)
{
if(OrderSelect(i, SELECT_BY_POS))
{
if(OrderProfit() >= BreakEvenPoints*Point)
{
if(OrderStopLoss() != OrderOpenPrice())
OrderModify(OrderTicket(), OrderOpenPrice(), OrderOpenPrice(), OrderTakeProfit(), 0);
}
}
}
}
```
**Important Notes:**
1. **News Integration Required:** The `IsNewsEvent()` function needs integration with an economic calendar API (e.g., Forex Factory, FXCM API). This is not implemented here due to platform limitations.
2. **Time Zone Handling:** The `ConvertCSTToServer()` function assumes a fixed 8-hour offset. You may need to adjust for daylight saving time changes.
3. **Range Calculation:** The EA calculates the initial range using the first 5-minute bars of the trading day.
4. **Risk Management:** Position sizing automatically calculates based on 1% risk and 25-point stop loss.
5. **Order Management:** Implements break-even functionality at 50 points profit.
For a complete implementation, you would need to:
1. Integrate a news feed API
2. Implement proper timezone conversion with DST handling
3. Add error handling for order operations
4. Implement the counter-trend trading logic described
5. Add comprehensive logging and debugging features
Répondu
1
Évaluation
Projets
513
19%
Arbitrage
34
44%
/
32%
En retard
34
7%
Chargé
2
Évaluation
Projets
71
37%
Arbitrage
4
25%
/
75%
En retard
1
1%
Gratuit
Publié : 1 code
3
Évaluation
Projets
1
0%
Arbitrage
1
0%
/
100%
En retard
0
Gratuit
4
Évaluation
Projets
0
0%
Arbitrage
1
0%
/
100%
En retard
0
Gratuit
5
Évaluation
Projets
35
20%
Arbitrage
5
40%
/
40%
En retard
0
Gratuit
Publié : 1 code
6
Évaluation
Projets
13
15%
Arbitrage
13
23%
/
46%
En retard
3
23%
Gratuit
Publié : 32 articles
7
Évaluation
Projets
9
56%
Arbitrage
0
En retard
0
Gratuit
8
Évaluation
Projets
439
54%
Arbitrage
22
50%
/
14%
En retard
30
7%
Chargé
9
Évaluation
Projets
8
13%
Arbitrage
3
0%
/
33%
En retard
2
25%
Gratuit
Publié : 1 code
10
Évaluation
Projets
244
74%
Arbitrage
7
100%
/
0%
En retard
1
0%
Gratuit
Publié : 1 article
11
Évaluation
Projets
265
29%
Arbitrage
0
En retard
3
1%
Travail
Publié : 2 codes
12
Évaluation
Projets
46
24%
Arbitrage
34
9%
/
85%
En retard
10
22%
Gratuit
13
Évaluation
Projets
289
35%
Arbitrage
18
22%
/
61%
En retard
43
15%
Gratuit
14
Évaluation
Projets
39
23%
Arbitrage
14
0%
/
93%
En retard
4
10%
Gratuit
15
Évaluation
Projets
499
67%
Arbitrage
5
40%
/
0%
En retard
4
1%
Gratuit
Publié : 8 codes
16
Évaluation
Projets
1
0%
Arbitrage
1
0%
/
100%
En retard
0
Gratuit
17
Évaluation
Projets
2
0%
Arbitrage
2
50%
/
50%
En retard
0
Gratuit
Commandes similaires
SETJEO'S GOLD EA
30 - 200 USD
double GetTodayProfit() { double profit = 0; datetime today = StringToTime(TimeToString(TimeCurrent(), TIME_DATE)); HistorySelect(today, TimeCurrent()); for(int i = HistoryDealsTotal() - 1; i >= 0; i--) { ulong ticket = HistoryDealGetTicket(i); if(HistoryDealGetString(ticket, DEAL_SYMBOL) == _Symbol) { profit += HistoryDealGetDouble(ticket, DEAL_PROFIT); } } return profit; }
I have an expert advisor's investor login. I want you to study it and make me the exact same EA. There should be absolutely no differences or mistakes. You should have great observation skills for this aswell
I am looking for a developer to create an Expert Advisor (EA) for MetaTrader 5. Requirements: Trade XAUUSD (Gold) Automatically open and close trades Include Stop Loss and Take Profit settings Adjustable lot size and risk percentage Work on MT5 Allow me to change settings from the EA inputs Include backtesting support Source code preferred
CustomMT5 webhook receiver using WebRequest
30 - 50 USD
Build new custom webhook receiver from scratch: Build a complete MT5 webhook receiver using WebRequest, plus full execution logic. No third-party dependency, full control. includes a small Python script that sits on VPS, receives the TradingView webhook directly, and writes each alert to a text file. EA reads that file and executes. with custom TP SL BE and trail sl
I have build a trading view indicator which monitors trades. The strategy is based on OB, it buys and sells bullish and bearish OB. Also valid re enters on the retest of orderblocks only if TP is hit the first time. I’m looking for someone to develop me a EA which works on the same logic and buys and sells of the same logic as my Indicator. I currently have my indicator firing signals into a telegram channel so I
I am looking for an experienced MQL5 developer to code a simple grid trading strategy into an Expert Advisor. The strategy logic is already defined, and I am looking for someone with strong MQL5 development experience to implement it accurately and efficiently. If you are interested and have relevant experience, please get in touch so we can discuss the project details
HFT / Latency Arbitrage / Scalper needed
30 - 5000 USD
I am looking for an experienced MQL5 or MQL4 developer with a strong background in low-latency algorithmic trading, market data integration, arbitrage and execution optimization. The project involves developing a high-performance HFT Expert Advisor (EA) for XAUUSD or US30 on IC Markets that is designed for robust execution in both demo and live environments. The EA may use market data feeds (such as lmax,one zero or
Hft gold ea live account ic market
30 - 3000 USD
I am looking for an experienced MQL5 or MQL4 developer with a strong understanding of high-frequency trading (HFT) concepts who can explain how certain HFT-style strategies have historically been able to pass proprietary firm evaluations while also being profitable on demo accounts and capable of transitioning successfully to live trading. I am interested in understanding the legitimate trading logic, execution
السلام عليكم، مطلوب مطور محترف وخبير في لغة MQL5 لتطوير مستشار خبير (Expert Advisor) مخصص للتداول تلقائياً على معدن الذهب (XAUUSD) ليعمل على منصة MetaTrader 5. الشروط المطلوبة: الاعتماد على استراتيجية ذكية لإدارة المخاطر (تحتوي على Stop Loss و Take Profit تلقائي وديناميكي). إمكانية دمج خوارزميات تحليل ذكية (أو الربط مع بايثون إذا لزم الأمر لتنفيذ منطق الذكاء الاصطناعي). توفير خاصية الـ Trailing Stop (ملاحقة
I need an expert advisor for fast excursion of trades. So that I can up my skills, I need it to have a good balance and need you to at least to price the the bot below $50
Informations sur le projet
Budget
30 - 200 USD