I Need This Killer Strategy To Be Turned Into An EA

Şartname

//+------------------------------------------------------------------+
//| Moving Average Crossover EA for MT5 |
//+------------------------------------------------------------------+
#include <Trade\Trade.mqh>
CTrade trade;

input int FastMAPeriod = 50;
input int SlowMAPeriod = 200;
input int StopLossPips = 50;
input int TakeProfitPips = 100;
input double RiskPercent = 2.0;

double lotSize;

//+------------------------------------------------------------------+
//| Calculate lot size based on 2% risk |
//+------------------------------------------------------------------+
double CalculateLotSize(double stopLossPoints)
{
   double riskAmount = AccountBalance() * RiskPercent / 100.0;
   double tickValue = SymbolInfoDouble(_Symbol, SYMBOL_TRADE_TICK_VALUE);
   double tickSize = SymbolInfoDouble(_Symbol, SYMBOL_TRADE_TICK_SIZE);
   double point = SymbolInfoDouble(_Symbol, SYMBOL_POINT);
   double contractSize = SymbolInfoDouble(_Symbol, SYMBOL_TRADE_CONTRACT_SIZE);

   double lossPerLot = stopLossPoints * point * contractSize / tickSize * tickValue;
   return NormalizeDouble(riskAmount / lossPerLot, 2);
}

//+------------------------------------------------------------------+
//| Expert Tick Function |
//+------------------------------------------------------------------+
void OnTick()
{
   // Get the current and previous MAs
   double maFastCurrent = iMA(_Symbol, _Period, FastMAPeriod, 0, MODE_EMA, PRICE_CLOSE, 0);
   double maFastPrevious = iMA(_Symbol, _Period, FastMAPeriod, 0, MODE_EMA, PRICE_CLOSE, 1);

   double maSlowCurrent = iMA(_Symbol, _Period, SlowMAPeriod, 0, MODE_EMA, PRICE_CLOSE, 0);
   double maSlowPrevious = iMA(_Symbol, _Period, SlowMAPeriod, 0, MODE_EMA, PRICE_CLOSE, 1);

   // Check for crossover
   if (maFastPrevious < maSlowPrevious && maFastCurrent > maSlowCurrent) // BUY Signal
   {
      if (PositionSelect(_Symbol) && PositionGetInteger(POSITION_TYPE) == POSITION_TYPE_SELL)
         trade.Close(_Symbol); // Close opposite position

      if (!PositionSelect(_Symbol)) // Only if no open position
      {
         double stopLoss = StopLossPips * _Point;
         double takeProfit = TakeProfitPips * _Point;
         lotSize = CalculateLotSize(StopLossPips * 10); // pip to point conversion

         trade.Buy(lotSize, _Symbol, SymbolInfoDouble(_Symbol, SYMBOL_ASK), stopLoss, takeProfit, "Buy on crossover");
      }
   }
   else if (maFastPrevious > maSlowPrevious && maFastCurrent < maSlowCurrent) // SELL Signal
   {
      if (PositionSelect(_Symbol) && PositionGetInteger(POSITION_TYPE) == POSITION_TYPE_BUY)
         trade.Close(_Symbol); // Close opposite position

      if (!PositionSelect(_Symbol)) // Only if no open position
      {
         double stopLoss = StopLossPips * _Point;
         double takeProfit = TakeProfitPips * _Point;
         lotSize = CalculateLotSize(StopLossPips * 10); // pip to point conversion

         trade.Sell(lotSize, _Symbol, SymbolInfoDouble(_Symbol, SYMBOL_BID), stopLoss, takeProfit, "Sell on crossover");
      }
   }
}

Yanıtlandı

1
Geliştirici 1
Derecelendirme
(144)
Projeler
186
41%
Arabuluculuk
24
58% / 21%
Süresi dolmuş
13
7%
Serbest
2
Geliştirici 2
Derecelendirme
(19)
Projeler
24
8%
Arabuluculuk
9
33% / 33%
Süresi dolmuş
1
4%
Yüklendi
3
Geliştirici 3
Derecelendirme
(382)
Projeler
493
23%
Arabuluculuk
59
56% / 25%
Süresi dolmuş
57
12%
Yüklendi
4
Geliştirici 4
Derecelendirme
(31)
Projeler
35
46%
Arabuluculuk
0
Süresi dolmuş
0
Serbest
Yayınlandı: 3 kod
5
Geliştirici 5
Derecelendirme
(4)
Projeler
3
33%
Arabuluculuk
1
0% / 100%
Süresi dolmuş
0
Serbest
6
Geliştirici 6
Derecelendirme
(274)
Projeler
403
28%
Arabuluculuk
40
40% / 50%
Süresi dolmuş
1
0%
Serbest
7
Geliştirici 7
Derecelendirme
(298)
Projeler
477
40%
Arabuluculuk
105
40% / 24%
Süresi dolmuş
81
17%
Yüklendi
Yayınlandı: 2 kod
8
Geliştirici 8
Derecelendirme
(206)
Projeler
333
35%
Arabuluculuk
66
12% / 58%
Süresi dolmuş
87
26%
Serbest
9
Geliştirici 9
Derecelendirme
(7)
Projeler
8
13%
Arabuluculuk
6
33% / 33%
Süresi dolmuş
0
Serbest
10
Geliştirici 10
Derecelendirme
Projeler
0
0%
Arabuluculuk
0
Süresi dolmuş
0
Serbest
11
Geliştirici 11
Derecelendirme
(10)
Projeler
19
42%
Arabuluculuk
7
0% / 57%
Süresi dolmuş
3
16%
Çalışıyor
12
Geliştirici 12
Derecelendirme
(7)
Projeler
11
0%
Arabuluculuk
5
0% / 80%
Süresi dolmuş
2
18%
Çalışıyor
13
Geliştirici 13
Derecelendirme
(1)
Projeler
0
0%
Arabuluculuk
4
0% / 75%
Süresi dolmuş
0
Serbest
14
Geliştirici 14
Derecelendirme
(16)
Projeler
35
23%
Arabuluculuk
4
0% / 50%
Süresi dolmuş
2
6%
Çalışıyor
15
Geliştirici 15
Derecelendirme
(4)
Projeler
3
0%
Arabuluculuk
3
33% / 67%
Süresi dolmuş
1
33%
Serbest
16
Geliştirici 16
Derecelendirme
(47)
Projeler
67
37%
Arabuluculuk
5
40% / 40%
Süresi dolmuş
1
1%
Serbest
17
Geliştirici 17
Derecelendirme
Projeler
0
0%
Arabuluculuk
0
Süresi dolmuş
0
Serbest
18
Geliştirici 18
Derecelendirme
(6)
Projeler
5
0%
Arabuluculuk
4
25% / 75%
Süresi dolmuş
2
40%
Serbest
19
Geliştirici 19
Derecelendirme
(574)
Projeler
945
47%
Arabuluculuk
309
58% / 27%
Süresi dolmuş
125
13%
Serbest
Benzer siparişler
I have a MT5 Hull MTF Indicator that I like. I would like someone to add: 1) Time of day function (with start time and end time) so that it does not send messages during my night time. Default Start=0900 Default End=2300 2) Add to the Message (sound and email): so that it is Symbol+Buy-Or-Sell+Ask-OrBid Price+TimeFrame1 "/" TimeFrame2 I will send the indicator to the developer. Thank you
i have built a indicator on trading view which is veryt good, its based on liquidity sweeps on stop losses. im looking for an someone with experience in trading and indicators that has worked on similar strategy indicators. it already wins lots of very good trades im looking to tighten up on uneccesary trades it may send to clean it up as i currently am testing it out running to signal channel and want it the best /
ART 1: NUMBER OF TRADES ALLOWED IN ONE DIRECTION: Maximum number of trades in one direction = ------------------------------ ------------------------------ ------------------------------ -------------- par PART 2 PARTIAL CLOSURE OF STOPLOSS: Total STOPLOSS =------ Pips 1a: Percentage of Stoploss =--% 1b Percentage of Lot size =--% 2a: Percentage oe of Lot size =--% f Stoploss =--% 2b
“} Final Trading Logic Requirements 1. Confirmation Timeframe The main confirmation timeframe must be M15. The indicator may show a Pending Setup during the active 15-minute candle, but the setup is not valid for entry yet. A valid trading signal must be confirmed only after the M15 candle closes. If the setup appears during the candle but disappears in the final seconds before candle close, no confirmed signal
MT5 Expert Advisor (EA) Acquisition Request – Proven XAUUSD Martingale / Grid EA I am looking to purchase a fully developed, actively traded, and proven MT5 Expert Advisor for XAUUSD (Gold) that uses Martingale, Grid, Averaging, Recovery, or Hybrid Recovery techniques. Mandatory Verification Requirement To be considered, please provide: - MT5 Investor Password (Read-Only Access) for verification - Account Number /
Looking to buy profitable MT4/MT5 Expert Advisors (EAs). Requirements: • Fully automated • 6+ months backtest • 100+ trades • No martingale or grid systems Send: • Backtest report • Max drawdown • Markets traded • Brief strategy summary Only original EAs developed by you. Long-term collaboration available
I am looking for an experienced MQL5 developer to create a custom indicator for MetaTrader 5. The project requirements and indicator logic will be shared privately with the selected candidate to protect the concept and implementation details. Requirements: Strong experience with MQL5 indicator development. Ability to create clean, efficient, and well-structured code. Experience with custom buffers, chart objects
DESCRIPTION: I require an experienced MQL5 developer to build a fully automated, multi‑engine, multi‑asset trend‑following trading system for MetaTrader 5. The system includes: Multiple TrendEngine instances (one per symbol) A PortfolioController that manages all engines Volatility‑regime detection Dual‑timeframe confirmation ATR‑based breakout logic ATR‑based stop management Micropyramiding Risk‑weighted satellites
Live chart [ expert is not executing trades on xauusd ] , Deleting Existing Parameter not in use , Live Chart Adjustments Only , No Need to Change anything else , expert will be live testing Throughout
Prepare expert for xauusd live chart [ expert is not executing trades on xauusd ] . Deletion and cleaning code . Trailing Stop Rule to follow the given method . Live Chart Only

Proje bilgisi

Bütçe
30+ USD