İş Gereklilikleri
//+------------------------------------------------------------------+ //| HamerrAI_BOT.mq4 | //| EMA crossover + ATR SL/TP, risk % lot sizing, trailing stop | //+------------------------------------------------------------------+ #property strict //--- inputs input int FastEMAPeriod = 9; input int SlowEMAPeriod = 21; input int ATRPeriod = 14; input double ATRMultiplier = 1.5; // SL = ATR * multiplier input double RiskPercent = 1.0; // risk per trade (% of balance) input double MaxSpreadPoints = 50; // in points (for 5-digit brokers 50 points = 5 pips) input int MagicNumber = 202501; input int MaxTrades = 2; input bool UseTrailingStop = true; input int TrailingStopPoints = 30; // in points input bool UseBreakEven = true; input int BreakEvenPoints = 20; // move to BE after this many points in profit input int TradeStartHour = 0; // allowed trading hours (local broker time) input int TradeEndHour = 23; input double MinLot = 0.01; input double MaxLot = 5.0; input int Slippage = 3; //--- globals datetime lastBarTime = 0; //+------------------------------------------------------------------+ //| Custom functions | //+------------------------------------------------------------------+ double GetATR(string symbol, int timeframe, int period, int shift) { // Average True Range using iATR return iATR(symbol, timeframe, period, shift); } double GetEMA(string symbol, int timeframe, int period, int shift) { // iMA with MODE_EMA return iMA(symbol, timeframe, period, 0, MODE_EMA, PRICE_CLOSE, shift); } int CountOpenTradesForMagic(int magic) { int count=0; for(int i=0;i<OrdersTotal();i++) { if(OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { if(OrderMagicNumber()==magic && OrderSymbol()==Symbol()) count++; } } return count; } double CalculateLotSize(double stopLossPips) { // Calculate lot size by RiskPercent of free margin / account balance double riskMoney = AccountBalance() * (RiskPercent/100.0); // value per point for 1 lot: double tickValue = MarketInfo(Symbol(), MODE_TICKVALUE); double tickSize = MarketInfo(Symbol(), MODE_TICKSIZE); double point = MarketInfo(Symbol(), MODE_POINT); // For MT4, SL in pips -> convert to points (pips * 10 for 5-digit) double slPoints = stopLossPips; if(point==0) point = MarketInfo(Symbol(), MODE_POINT); // approximate money per 1 lot per point: double valuePerPointPerLot = tickValue / tickSize * point; // approximate if(valuePerPointPerLot <= 0) valuePerPointPerLot = tickValue; // fallback double lots = 0.01; // Money risked for 1 lot = valuePerPointPerLot * slPoints * (1/point) // Simpler calculation using MODE_LOTSIZE, MODE_TICKVALUE info: double lotStep = MarketInfo(Symbol(), MODE_LOTSTEP); double lotMin = MarketInfo(Symbol(), MODE_MINLOT); double lotMax = MarketInfo(Symbol(), MODE_MAXLOT); if(lotStep<=0) lotStep = 0.01; if(lotMin<=0) lotMin = MinLot; if(lotMax<=0) lotMax = MaxLot; // Money risk for 1 lot (approx): double riskPerLot = (stopLossPips * MarketInfo(Symbol(), MODE_TICKVALUE) / MarketInfo(Symbol(), MODE_TICKSIZE)); if(riskPerLot<=0) riskPerLot = 1.0; lots = NormalizeDouble(riskMoney / riskPerLot, 2); // enforce limits if(lots < lotMin) lots = lotMin; if(lots > lotMax) lots = lotMax; // round to lot step double steps = MathRound(lots / lotStep); lots = steps * lotStep; if(lots < lotMin) lots = lotMin; return NormalizeDouble(lots, 2); } void ManageOpenTrades() { for(int i=OrdersTotal()-1;i>=0;i--) { if(!OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) continue; if(OrderMagicNumber() != MagicNumber || OrderSymbol() != Symbol()) continue; // trailing stop if(UseTrailingStop && OrderType()<=OP_SELL) { double currentPrice = (OrderType()==OP_BUY) ? Bid : Ask; double openPrice = OrderOpenPrice(); double profitPoints = 0; if(OrderType()==OP_BUY) profitPoints = (currentPrice - openPrice)/Point; else profitPoints = (openPrice - currentPrice)/Point; // break even if(UseBreakEven && profitPoints >= BreakEvenPoints) { double newSL; if(OrderType()==OP_BUY) { newSL = OrderOpenPrice() + BreakEvenPoints * Point; if(newSL > OrderStopLoss()) { bool res = OrderModify(OrderTicket(), OrderOpenPrice(), newSL, OrderTakeProfit(), 0, clrYellow); } } else { newSL = OrderOpenPrice() - BreakEvenPoints * Point; if(newSL < OrderStopLoss() || OrderStopLoss()==0) { bool res = OrderModify(OrderTicket(), OrderOpenPrice(), newSL, OrderTakeProfit(), 0, clrYellow); } } } if(profitPoints >= TrailingStopPoints) { double desiredSL; if(OrderType()==OP_BUY) { desiredSL = currentPrice - TrailingStopPoints * Point; if(desiredSL > OrderStopLoss()) OrderModify(OrderTicket(), OrderOpenPrice(), desiredSL, OrderTakeProfit(), 0, clrGreen); } else { desiredSL = currentPrice + TrailingStopPoints * Point; if(desiredSL < OrderStopLoss() || OrderStopLoss()==0) OrderModify(OrderTicket(), OrderOpenPrice(), desiredSL, OrderTakeProfit(), 0, clrGreen); } } } } } //+------------------------------------------------------------------+ //| Expert tick | //+------------------------------------------------------------------+ void OnTick() { // only run on new bar datetime currentBarTime = iTime(Symbol(), PERIOD_CURRENT, 0); if(currentBarTime == lastBarTime) { // still same bar -> only manage existing trades (trailing) ManageOpenTrades(); return; } lastBarTime = currentBarTime; // Time filter int hour = TimeHour(TimeCurrent()); if(hour < TradeStartHour || hour > TradeEndHour) return; // Spread check double spread = (Ask - Bid) / MarketInfo(Symbol(), MODE_POINT); if(spread > MaxSpreadPoints) return; // count existing our trades int openCount = CountOpenTradesForMagic(MagicNumber); if(openCount >= MaxTrades) { ManageOpenTrades(); return; } // Get EMA values: shift 1 is previous closed bar, shift 0 is current forming bar double emaFastPrev = GetEMA(Symbol(), PERIOD_CURRENT, FastEMAPeriod, 1); double emaSlowPrev = GetEMA(Symbol(), PERIOD_CURRENT, SlowEMAPeriod, 1); double emaFastCurr = GetEMA(Symbol(), PERIOD_CURRENT, FastEMAPeriod, 2); // note: shift orientation double emaSlowCurr = GetEMA(Symbol(), PERIOD_CURRENT, SlowEMAPeriod, 2); // Actually for safety let's use shift 1 and 2 to detect last closed-bar crossover double fast_now = GetEMA(Symbol(), PERIOD_CURRENT, FastEMAPeriod, 1); double slow_now = GetEMA(Symbol(), PERIOD_CURRENT, SlowEMAPeriod, 1); double fast_prev = GetEMA(Symbol(), PERIOD_CURRENT, FastEMAPeriod, 2); double slow_prev = GetEMA(Symbol(), PERIOD_CURRENT, SlowEMAPeriod, 2); // ATR for stop sizing (in points) double atr = GetATR(Symbol(), PERIOD_CURRENT, ATRPeriod, 1); if(atr<=0) atr = MarketInfo(Symbol(), MODE_POINT)*10; double slPips = NormalizeDouble((atr * ATRMultiplier)/MarketInfo(Symbol(), MODE_POINT),0); // Determine signal on the last closed bar bool buySignal = (fast_prev < slow_prev) && (fast_now > slow_now); bool sellSignal = (fast_prev > slow_prev) && (fast_now < slow_now); if(buySignal) { double sl = Ask - slPips * MarketInfo(Symbol(), MODE_POINT); double tp = Ask + slPips * MarketInfo(Symbol(), MODE_POINT) * 2.0; // default 2:1 RR double lots = CalculateLotSize(slPips / MarketInfo(Symbol(), MODE_POINT)); int ticket = OrderSend(Symbol(), OP_BUY, lots, Ask, Slippage, sl, tp, "EMA_ATR BUY", MagicNumber, 0, clrBlue); if(ticket<0) { Print("Buy order failed: ", GetLastError()); } } else if(sellSignal) { double sl = Bid + slPips * MarketInfo(Symbol(), MODE_POINT); double tp = Bid - slPips * MarketInfo(Symbol(), MODE_POINT) * 2.0; double lots = CalculateLotSize(slPips / MarketInfo(Symbol(), MODE_POINT)); int ticket = OrderSend(Symbol(), OP_SELL, lots, Bid, Slippage, sl, tp, "EMA_ATR SELL", MagicNumber, 0, clrRed); if(ticket<0) { Print("Sell order failed: ", GetLastError()); } } // manage trailing stops for existing trades ManageOpenTrades(); } //+------------------------------------------------------------------+
Yanıtlandı
1
Derecelendirme
Projeler
3
0%
Arabuluculuk
1
0%
/
100%
Süresi dolmuş
0
Serbest
2
Derecelendirme
Projeler
15
27%
Arabuluculuk
0
Süresi dolmuş
3
20%
Serbest
3
Derecelendirme
Projeler
2
0%
Arabuluculuk
4
25%
/
50%
Süresi dolmuş
1
50%
Serbest
4
Derecelendirme
Projeler
0
0%
Arabuluculuk
0
Süresi dolmuş
0
Serbest
5
Derecelendirme
Projeler
3
0%
Arabuluculuk
0
Süresi dolmuş
0
Serbest
6
Derecelendirme
Projeler
475
40%
Arabuluculuk
105
40%
/
24%
Süresi dolmuş
80
17%
Meşgul
Yayınlandı: 2 kod
7
Derecelendirme
Projeler
0
0%
Arabuluculuk
0
Süresi dolmuş
0
Serbest
8
Derecelendirme
Projeler
1
0%
Arabuluculuk
3
0%
/
100%
Süresi dolmuş
1
100%
Serbest
9
Derecelendirme
Projeler
0
0%
Arabuluculuk
0
Süresi dolmuş
0
Serbest
10
Derecelendirme
Projeler
0
0%
Arabuluculuk
0
Süresi dolmuş
0
Serbest
11
Derecelendirme
Projeler
0
0%
Arabuluculuk
0
Süresi dolmuş
0
Serbest
12
Derecelendirme
Projeler
35
34%
Arabuluculuk
5
0%
/
80%
Süresi dolmuş
0
Çalışıyor
Yayınlandı: 2 kod
Benzer siparişler
A perfect indicator
30 - 80 USD
Merge nearby zones yes/no Alert on/off Label on/off Show only current relevant zones near price yes/no Distance filter from current price Zone transparency Colors Preferred Output on Chart: I want the indicator to show only: the strongest nearby support zones under price the strongest nearby resistance zones above price major higher timeframe zones clean chart view I do not want excessive clutter. Entry Assistance
Project Title: Custom XAUUSD Support & Resistance Indicator Platform Required: MT5 preferred. If possible, also provide TradingView Pine Script version later. Main Goal: I want a custom indicator made specifically for XAUUSD (Gold) only. The indicator should automatically detect and draw strong support and resistance zones where price has a high probability of reacting, rejecting, or reversing. It must update
1. IF price forms: - Higher highs + higher lows → TREND = BUY - Lower highs + lower lows → TREND = SELL ELSE → NO TRADE 2. IF: - Trend = BUY - Price retraces to support zone - Bullish engulfing candle forms - TDI green crosses above red (optional) THEN: - Execute BUY 3. IF: - Trend = SELL - Price retraces to resistance - Bearish engulfing forms - TDI confirms THEN: - Execute SELL 4. Risk per trade = 1% of account Lot
Hello, I am looking for a professional trading system including: 1- Trading Bot (Expert Advisor): - Good profit performance - High security and strong risk management - Works efficiently during high market volatility (news and strong movements) - Works on all pairs (Forex + Gold) 2- Signal Indicator: - Provides clear Buy and Sell signals - Includes Take Profit and Stop Loss - No repaint (signals must not change or
Yakubu Jnr Ai Bots
30+ USD
This is yakubu Jnr trading bots I create the trading robots to help my self and others traders to be successful please you can join my live trading bots or subscribe to my trading robots
Nyasco
30+ USD
Faster robot with less losses which can be used for a long term earning money every day creating a bot for more than thousands of people to earn billions of money
Apply with a screen of your work . Symbol Specific Logic . Live Chart Optimization Check the Core logic . [back tests as well] Change points to pips . Create buffer for the zone
Tengo una estrategia basada en divergencia para el oro sobre todo en tf m1 Basado en divergencia con stoch .. confirmando la entrada con ciertos parameteos de entrada Es mejor conversarlo para dar mejor los detalles Cuando entrar, porque o todas las divergencias se debe tomar para entrar en compras o ventas He adjuntado un ejemplo La confrmacion más exacta es el cruce de esos parámetros de stoch edebajo de level de
I already have a fully developed MT5 Expert Advisor with all required prop firm features, including: Risk management Daily loss & max drawdown limits Spread & slippage filters News filter Trade management system The EA structure is complete. 👉 What I need is a professional developer to replace ONLY the entry logic with a high-quality, rule-based trading strategy. 🚨 STRICT REQUIREMENT (READ CAREFULLY): I am NOT
Proje bilgisi
Bütçe
30+ USD