Spécifications

//+------------------------------------------------------------------+
//| ScalperEA.mq5 |
//+------------------------------------------------------------------+
#property copyright "Template"
#property version "1.00"
#property strict

input int FastEMA = 8;
input int SlowEMA = 21;
input int AtrPeriod = 14;
input double StopAtrMult = 1.2;
input double TpAtrMult = 1.0;
input double RiskPercent = 0.5; // percent account risk per trade
input int Magic = 123456;
input double Lots = 0.01;

double EMAFast[], EMASlow[], ATRArr[];

int OnInit()
{
  SetIndexBuffer(0, EMAFast);
  SetIndexBuffer(1, EMASlow);
  // nothing to set for ATR; we'll compute using iATR
  return(INIT_SUCCEEDED);
}

void OnTick()
{
  // get last two closed candles
  int shift = 1; // last closed bar
  double fast_prev = iMA(NULL, PERIOD_CURRENT, FastEMA, 0, MODE_EMA, PRICE_CLOSE, shift+1);
  double fast_last = iMA(NULL, PERIOD_CURRENT, FastEMA, 0, MODE_EMA, PRICE_CLOSE, shift);
  double slow_prev = iMA(NULL, PERIOD_CURRENT, SlowEMA, 0, MODE_EMA, PRICE_CLOSE, shift+1);
  double slow_last = iMA(NULL, PERIOD_CURRENT, SlowEMA, 0, MODE_EMA, PRICE_CLOSE, shift);
  double atr = iATR(NULL, PERIOD_CURRENT, AtrPeriod, shift);

  if (atr <= 0) return;

  // simple crossover signals
  if (fast_prev <= slow_prev && fast_last > slow_last)
  {
    // buy signal
    double entry = SymbolInfoDouble(_Symbol, SYMBOL_BID); // or use Ask for buy market entry
    double stop = entry - StopAtrMult * atr;
    double tp = entry + TpAtrMult * atr;
    double lots = Lots;
    // optionally compute lots from RiskPercent and stop distance
    // place market buy
    trade_buy(lots, stop, tp);
  }
  else if (fast_prev >= slow_prev && fast_last < slow_last)
  {
    // sell signal
    double entry = SymbolInfoDouble(_Symbol, SYMBOL_ASK);
    double stop = entry + StopAtrMult * atr;
    double tp = entry - TpAtrMult * atr;
    trade_sell(Lots, stop, tp);
  }
}

void trade_buy(double lots, double stop, double tp)
{
  MqlTradeRequest req;
  MqlTradeResult res;
  ZeroMemory(req);
  req.action = TRADE_ACTION_DEAL;
  req.symbol = _Symbol;
  req.volume = lots;
  req.type = ORDER_TYPE_BUY;
  req.price = SymbolInfoDouble(_Symbol, SYMBOL_ASK);
  req.sl = stop;
  req.tp = tp;
  req.deviation = 5;
  req.magic = Magic;
  OrderSend(req, res);
}

void trade_sell(double lots, double stop, double tp)
{
  MqlTradeRequest req;
  MqlTradeResult res;
  ZeroMemory(req);
  req.action = TRADE_ACTION_DEAL;
  req.symbol = _Symbol;
  req.volume = lots;
  req.type = ORDER_TYPE_SELL;
  req.price = SymbolInfoDouble(_Symbol, SYMBOL_BID);
  req.sl = stop;
  req.tp = tp;
  req.deviation = 5;
  req.magic = Magic;
  OrderSend(req, res);
}

Répondu

1
Développeur 1
Évaluation
(624)
Projets
981
47%
Arbitrage
32
38% / 34%
En retard
96
10%
Travail
Publié : 6 codes
2
Développeur 2
Évaluation
(103)
Projets
163
23%
Arbitrage
23
9% / 78%
En retard
16
10%
Travail
3
Développeur 3
Évaluation
(1)
Projets
0
0%
Arbitrage
2
0% / 100%
En retard
0
Gratuit
4
Développeur 4
Évaluation
(270)
Projets
399
27%
Arbitrage
39
41% / 49%
En retard
1
0%
Gratuit
5
Développeur 5
Évaluation
(1)
Projets
1
0%
Arbitrage
2
0% / 0%
En retard
0
Travail
6
Développeur 6
Évaluation
(2)
Projets
3
0%
Arbitrage
1
0% / 100%
En retard
0
Travail
7
Développeur 7
Évaluation
Projets
2
0%
Arbitrage
4
25% / 50%
En retard
1
50%
Gratuit
8
Développeur 8
Évaluation
Projets
0
0%
Arbitrage
0
En retard
0
Gratuit
9
Développeur 9
Évaluation
Projets
0
0%
Arbitrage
0
En retard
0
Gratuit
10
Développeur 10
Évaluation
(32)
Projets
35
34%
Arbitrage
5
0% / 80%
En retard
0
Travail
Publié : 2 codes
11
Développeur 11
Évaluation
(249)
Projets
255
30%
Arbitrage
0
En retard
3
1%
Gratuit
Publié : 2 codes
12
Développeur 12
Évaluation
(1)
Projets
0
0%
Arbitrage
1
0% / 100%
En retard
0
Gratuit
13
Développeur 13
Évaluation
(4)
Projets
3
33%
Arbitrage
2
0% / 100%
En retard
0
Gratuit
14
Développeur 14
Évaluation
(11)
Projets
14
14%
Arbitrage
5
20% / 20%
En retard
4
29%
Chargé
15
Développeur 15
Évaluation
(1)
Projets
0
0%
Arbitrage
5
0% / 80%
En retard
0
Gratuit
16
Développeur 16
Évaluation
(128)
Projets
167
39%
Arbitrage
9
44% / 0%
En retard
29
17%
Chargé
17
Développeur 17
Évaluation
(5)
Projets
8
13%
Arbitrage
3
0% / 33%
En retard
2
25%
Gratuit
Publié : 1 code
18
Développeur 18
Évaluation
(4)
Projets
7
0%
Arbitrage
3
33% / 33%
En retard
3
43%
Travail
19
Développeur 19
Évaluation
(3)
Projets
1
100%
Arbitrage
3
0% / 100%
En retard
0
Gratuit
20
Développeur 20
Évaluation
Projets
0
0%
Arbitrage
0
En retard
0
Gratuit
21
Développeur 21
Évaluation
Projets
0
0%
Arbitrage
0
En retard
0
Gratuit
22
Développeur 22
Évaluation
(29)
Projets
28
64%
Arbitrage
0
En retard
1
4%
Travail
Publié : 5 codes
Commandes similaires
Algo Trading Rebot/ EA 30 - 100 USD
I would like someone Who can design an EA for me. I will give him the Required Details and Trading Plan How it should Work. its going to be a Simple EA System Around Moving Averages Crossover. I will Provide Him the Moving Averages Settings and How It should execute trades and Exit them
The EA should focus on high-speed scalping on the 1-minute timeframe or every tick execution and must perform incredibly well on demo accounts with consistent profitability. EA Requirements: Platform: MetaTrader 5 (MT5) Trading style: Scalping (1-minute or tick-based execution) Dynamic lot size increase system (auto lot multiplier or equity-based lot adjustment) Should work efficiently even on minimum equity (as low
Scope Build a new EA from scratch implementing my provided strategy rules exactly. Deterministic, one logical action per tick (close OR place OR modify OR delete). Two-sided system (BUY + SELL). Includes stacking/maintenance, hygiene (pending correction), reduction closes, breakeven close logic, and a final termination/unwind mode. Iteration workflow (LOCKED / UNLOCKED) . Developer must maintain two copies/branches
I need a AI signal generating bot for forex trading that use the latest ai technology to track real time forex market, analyse and give signals. The bot should operate such that when i put it in a chart it will analyse the market, after several minutes it will display whether the trade is buying or selling. It should display the one minute, five minute,15minute, 30 minute, one hour, 4 hours and daily time frame
Hello I want to convert my tradingview indicators into Ninja trader can anyone help me with it it is urgent and I will like to discuss more about it to you if you can help me Kindly do well to bid on it
📌 JOB DESCRIPTION – FULLY AUTOMATED TRADING SYSTEM I am looking for an experienced developer to build a fully automated end-to-end trading system for MetaTrader 5. This is not an indicator-based bot and not a discretionary or black-box AI system. The system must follow a strict, deterministic rule-based trading framework that is already defined. 🎯 PROJECT GOAL Build a system where: A backend continuously evaluates
Task Title Implement Martingale Lot Scaling Sync Between Master and Slave MT4 Trade Copier Background I am using a local master–slave trade copier setup with: 1 Master MT4 4 Slave MT4 terminals Trades are currently copied correctly (entry, direction, symbol, SL/TP). Lot size handling currently copies either: the exact master lot, or a fixed base lot defined on the slave (e.g., always 0.01 or 1.0). Problem When the
Julismorfx-Bot 150 - 300 USD
Hello, I am looking for an MT5 Expert Advisor based on a reversal trading strategy . The EA must follow strict risk management and be suitable for prop firm rules . Key requirements: • Platform: MT5 • Pairs: USDJPY, GBPUSD, XAUUSD (multi-pair) • Strategy: Reversal only (H4 context + M15 entry) • Fixed risk per trade (default 0.5%, max 1%) • One trade per pair, max 2 trades total • Every trade must have Stop Loss and
I need a fully automated end-to-end system where a backend continuously runs my deterministic CORE EDGE validator on live market data, generates numeric JSON trade tickets (GO) or alert levels (NO-GO), and automatically pushes those instructions to the MT5 EA for execution. There are no manual signals. ROLE SPLIT (IMPORTANT) Backend (analysis & decision engine): Continuously evaluates live data using my CORE EDGE
I am looking for a bot that has been created and tested and confirmed profitable in a live market for Gold. The bot must be profitable and be verifiable on real account and have a low drawdown. The developer will send a demo of the EA which I can test for myself. I am looking for more of an experienced developer. Please no EA on demo account

Informations sur le projet

Budget
30 - 500 USD