MT TRADING BOT

Specifiche

//+------------------------------------------------------------------+ //| 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(); } //+------------------------------------------------------------------+

Con risposta

1
Sviluppatore 1
Valutazioni
(3)
Progetti
3
0%
Arbitraggio
1
0% / 100%
In ritardo
0
Gratuito
2
Sviluppatore 2
Valutazioni
(10)
Progetti
15
27%
Arbitraggio
0
In ritardo
3
20%
Gratuito
3
Sviluppatore 3
Valutazioni
Progetti
2
0%
Arbitraggio
4
25% / 50%
In ritardo
1
50%
Gratuito
4
Sviluppatore 4
Valutazioni
Progetti
0
0%
Arbitraggio
0
In ritardo
0
Gratuito
5
Sviluppatore 5
Valutazioni
(2)
Progetti
3
0%
Arbitraggio
0
In ritardo
0
Gratuito
6
Sviluppatore 6
Valutazioni
(298)
Progetti
478
40%
Arbitraggio
105
40% / 24%
In ritardo
82
17%
Caricato
Pubblicati: 2 codici
7
Sviluppatore 7
Valutazioni
Progetti
0
0%
Arbitraggio
0
In ritardo
0
Gratuito
8
Sviluppatore 8
Valutazioni
(1)
Progetti
1
0%
Arbitraggio
3
0% / 100%
In ritardo
1
100%
Gratuito
9
Sviluppatore 9
Valutazioni
Progetti
0
0%
Arbitraggio
0
In ritardo
0
Gratuito
10
Sviluppatore 10
Valutazioni
Progetti
0
0%
Arbitraggio
0
In ritardo
0
Gratuito
11
Sviluppatore 11
Valutazioni
Progetti
0
0%
Arbitraggio
0
In ritardo
0
Gratuito
12
Sviluppatore 12
Valutazioni
(33)
Progetti
36
33%
Arbitraggio
5
0% / 80%
In ritardo
0
In elaborazione
Pubblicati: 2 codici
Ordini simili
A good trend predicting indicator is the one which can identify the trend change as soon as it happens on the chart. when a new candle is formed it should tell whether its going to go up or down. I have already seen a lot of repainting trend predictors so if your indicator is repainting then please don't bother contacting. I would like to see the demo version and then if satisfied , I would want the source code too
Hey, I am looking for an experienced MQL5 developer to build a price-action EA for MT5 - XAUUSD and EURUSD on the 30M timeframe. Features required: Pattern recognition based on 3-candle structures and wick ratios. Proportional dynamic lot sizing based on account equity tiers. Time filters, Friday hard-close safeguard, and MT5 native calendar news filter (CPI/PPI lockout). FTMO risk controls (max spread, daily
Platform MetaTrader 5 (MT5) MQL5 Source Code Required Compatible with Exness MT5 both standard and cent accounts/ICMarket accounts Works on EUR/USD only (initial version) ⸻ Objective Develop a fully automated AI Expert Advisor based on ICT Smart Money Concepts (SMC). The EA must only execute high-probability trades that satisfy all required conditions before opening a position. The EA must avoid overtrading and
Bonjour, je recherche un développeur MQL5 expérimenté pour créer un Expert Advisor pour MetaTrader 5 basé sur une stratégie de trading intégrant des principes de gestion des risques rigoureux et d'intelligence financière. Le robot doit être capable de gérer plusieurs paires de devises et d'optimiser automatiquement les entrées et sorties en fonction de conditions de marché prédéfinies."
MT4/MT5 HFT EA us30 30 - 3000 USD
Hello everybody, I'm looking for an experienced MQL4/MQL5 developer to optimize a High-Frequency Trading (HFT) Expert Advisor for both MT4 and MT5. The EA performs consistently and profitably on demo accounts, but when it is run on Raw and Standard live accounts under what appear to be the same trading conditions, it begins generating losses. I do not have the original source code (.mq4/.mq5); I only have the
I'm looking for an experienced NinjaTrader 8 (C#) developer to build a fully automated futures trading strategy. Please apply only if you have proven experience developing and testing NinjaTrader strategies. Project Overview Develop a fully automated NinjaTrader 8 strategy. Designed for Apex funded and evaluation accounts. Primary instruments: NQ/MNQ Futures (with flexibility to support other futures later). Trading
Hello I need to purchase the source code of an already built profitable mt5 EA with proven track recordIf you have something similar and you are open to selling the source code please apply to this post Please note I am not looking for a dev to build the product from scratch , but need something that is already built and have at least one year worth of track record
I need an Expert Advisor for MT5 on XAUUSD 1min timeframe using SMC concepts. STRATEGY RULES: SELL: 1. Identify previous day High/Low as liquidity 2. Entry only during London-NY session: 15:00-19:00 GMT+3 or broker clock. 3. If price sweeps previous day High and closes back below it 4. Check for bearish 1min FVG below sweep candle 5. Wait for BOS - lower low 6. Entry: Sell/buy at 50% of the FVG 7. SL: 10 pips above
Code An Loss Rate 90-100% MT5 EA , that can blow a 100 USD account a day ,with fixed TP of 3000 points and SL of 3000 For better Rate Calculations get an strategy that can lead to so
Shooter razor 30+ USD
Makes it takes trades by it self buy and sell, it must use the higher signals, also when I press stop it must not pick any trades I want it to take trades automatically when I press start also close by it self

Informazioni sul progetto

Budget
30+ USD