指定

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

反馈

1
开发者 1
等级
(621)
项目
972
47%
仲裁
32
38% / 34%
逾期
96
10%
工作中
发布者: 6 代码
2
开发者 2
等级
(102)
项目
154
20%
仲裁
22
9% / 77%
逾期
14
9%
工作中
3
开发者 3
等级
项目
0
0%
仲裁
0
逾期
0
空闲
4
开发者 4
等级
(268)
项目
396
27%
仲裁
38
39% / 50%
逾期
1
0%
空闲
5
开发者 5
等级
(1)
项目
1
0%
仲裁
0
逾期
0
工作中
6
开发者 6
等级
项目
1
0%
仲裁
0
逾期
0
空闲
7
开发者 7
等级
项目
2
0%
仲裁
4
25% / 50%
逾期
1
50%
空闲
8
开发者 8
等级
项目
0
0%
仲裁
0
逾期
0
空闲
9
开发者 9
等级
项目
0
0%
仲裁
0
逾期
0
空闲
10
开发者 10
等级
(31)
项目
35
34%
仲裁
3
0% / 67%
逾期
0
已载入
发布者: 2 代码
11
开发者 11
等级
(246)
项目
253
30%
仲裁
0
逾期
3
1%
空闲
发布者: 2 代码
12
开发者 12
等级
项目
0
0%
仲裁
0
逾期
0
工作中
13
开发者 13
等级
(2)
项目
2
0%
仲裁
0
逾期
0
空闲
14
开发者 14
等级
(5)
项目
7
0%
仲裁
3
33% / 33%
逾期
3
43%
已载入
15
开发者 15
等级
(1)
项目
0
0%
仲裁
4
0% / 75%
逾期
0
工作中
16
开发者 16
等级
(128)
项目
167
39%
仲裁
8
50% / 0%
逾期
29
17%
已载入
17
开发者 17
等级
(5)
项目
8
13%
仲裁
3
0% / 33%
逾期
2
25%
空闲
发布者: 1 代码
18
开发者 18
等级
(4)
项目
5
0%
仲裁
1
100% / 0%
逾期
1
20%
工作中
19
开发者 19
等级
(2)
项目
1
100%
仲裁
2
0% / 100%
逾期
0
空闲
20
开发者 20
等级
项目
0
0%
仲裁
0
逾期
0
空闲
21
开发者 21
等级
项目
0
0%
仲裁
0
逾期
0
空闲
22
开发者 22
等级
(6)
项目
8
38%
仲裁
0
逾期
1
13%
空闲
发布者: 1 代码
相似订单
I have a perfectly working EA that always gets altered, I need special security features implemented, and I already have a great idea of what I need. Super easy, codes already work, just need tweaking here and there. Cybersecurity proficiency would be a positive
Omnix Fx+ 30+ USD
🎯 What is OMNIX FX+? OMNIX FX+ V3.0 is a next-generation Expert Advisor (EA) specifically designed to trade gold (XAUUSD) on the M1 timeframe, combining artificial intelligence , advanced risk management , and adaptive strategies to maximize your profitability while protecting your capital. ✨ Key Features 🧠 Machine Learning Adaptive RSI : The system learns from each trade to automatically optimize entry ranges
Hi all, I've got an EA that shows promising results. I need it properly back-tested and optimized, with multiple datasets, in a complete, rigorous methodical way. Proper, professional backtesting with python and whatever other best tools and practices are considered best and thorough optimization is required, with results presented in a concise way, and the best performing input .sets returned to me. I'm not looking
MT4 EA for Kill switch 30 - 200 USD
MT4 EA for automatic kill switch for unrealized p&l mt4 and disable autoTrading button we have EA which does not stop when Drawdowns are high. we need one more EA to monitor and stop this EA
I would like to create an indicator for my strategy on trading view , my strategy involves a liquidity sweep , wick or candle body closure , this needs to happen inside a higher time frame pd array such as a fair value gap that’s atleast 5m + and there needs to be an inversion fair value gap for my entry , I want the fair value gaps on all time frames so I can see them all on the 1 minute chart but i want the fair
I need a MT5 Expert Advisor. Market: XAUUSD Timeframe: M15 Strategy: - Trade only during London and New York sessions - Trend filter using EMA - Entry on breakout of recent high/low - Fixed Stop Loss and Take Profit Risk Management: - Risk per trade: 0.5% – 1% - Max 3 trades per day - Stop trading after daily loss limit Requirements: - Inputs must be adjustable - Clean and commented MQL5 source code - No martingale -
Hi guys looking for a reversal indicator (including a strategy for it) that places signals on chart (will attach screenshots below for reference and have a look at them before applying) Signals must he placed at candle close without shift and not repaint. Since I'm offering a high budget I want everything to run smoothly in these steps 1. Send screenahots of it 2. I'll give you feedback what to change or we'll skip
Trade profit 100+ USD
I’m going back to the house to see the new one I ems want you too and I’ll let you know if you need it or if it is still in a question and if I sim it in the morning then I’ll call it when you are in a minute and I ems call no nana is going to call you to get
can you help me with making a simple tradingview/script that draws boxes labeling consolidation areas according to my specifications? IF anyone can help with this kindly do well to bid to this so we can discuss more about the project thanka
Looking for an experienced MQL5 developer to optimize and backtest an existing MT5 Expert Advisor . Symbol: Gold (XAUUSD) Timeframe: M1 Task: Parameter optimization + performance analysis Deliverables: Optimized settings and backtest results

项目信息

预算
30 - 500 USD

客户

所下订单2
仲裁计数0