Mrwin

Şartname


//+------------------------------------------------------------------+
//|             NATHANIEL SMART TRADER EA v1.0                       |
//|             MetaTrader 5 - MQL5                                  |
//|             EMA + RSI + ATR + Risk Management                    |
//+------------------------------------------------------------------+
#property copyright "Nathaniel"
#property version   "1.00"
#property strict

#include <Trade/Trade.mqh>
CTrade trade;

//--- Trading settings
input double RiskPercent       = 1.0;
input double RiskReward        = 2.0;
input int    FastEMA           = 20;
input int    SlowEMA           = 50;
input int    RSIPeriod         = 14;
input int    ATRPeriod         = 14;
input double ATRMultiplier     = 2.0;
input int    MaxSpreadPoints   = 30;
input ulong  MagicNumber       = 20261128;
input int    SlippagePoints    = 20;

//--- Indicator handles
int fastHandle, slowHandle, rsiHandle, atrHandle;
datetime lastBarTime = 0;

//+------------------------------------------------------------------+
//| Initialization                                                   |
//+------------------------------------------------------------------+
int OnInit()
{
   trade.SetExpertMagicNumber(MagicNumber);
   trade.SetDeviationInPoints(SlippagePoints);

   fastHandle = iMA(_Symbol,_Period,FastEMA,0,MODE_EMA,PRICE_CLOSE);
   slowHandle = iMA(_Symbol,_Period,SlowEMA,0,MODE_EMA,PRICE_CLOSE);
   rsiHandle  = iRSI(_Symbol,_Period,RSIPeriod,PRICE_CLOSE);
   atrHandle  = iATR(_Symbol,_Period,ATRPeriod);

   if(fastHandle == INVALID_HANDLE ||
      slowHandle == INVALID_HANDLE ||
      rsiHandle == INVALID_HANDLE ||
      atrHandle == INVALID_HANDLE)
   {
      Print("Indicator initialization failed.");
      return INIT_FAILED;
   }

   Print("Nathaniel Smart Trader EA initialized.");
   return INIT_SUCCEEDED;
}

//+------------------------------------------------------------------+
//| Release indicators                                               |
//+------------------------------------------------------------------+
void OnDeinit(const int reason)
{
   IndicatorRelease(fastHandle);
   IndicatorRelease(slowHandle);
   IndicatorRelease(rsiHandle);
   IndicatorRelease(atrHandle);
}

//+------------------------------------------------------------------+
//| Calculate position size based on risk                            |
//+------------------------------------------------------------------+
double CalculateLot(double entry, double stopLoss,
                    ENUM_ORDER_TYPE orderType)
{
   double balance = AccountInfoDouble(ACCOUNT_BALANCE);
   double riskMoney = balance * RiskPercent / 100.0;

   double profit = 0;

   if(!OrderCalcProfit(orderType,_Symbol,1.0,
                       entry,stopLoss,profit))
      return 0;

   double lossPerLot = MathAbs(profit);

   if(lossPerLot <= 0)
      return 0;

   double lot = riskMoney / lossPerLot;

   double minLot = SymbolInfoDouble(_Symbol,SYMBOL_VOLUME_MIN);
   double maxLot = SymbolInfoDouble(_Symbol,SYMBOL_VOLUME_MAX);
   double step   = SymbolInfoDouble(_Symbol,SYMBOL_VOLUME_STEP);

   if(step <= 0)
      return 0;

   lot = MathFloor(lot / step) * step;
   lot = MathMin(lot,maxLot);

   if(lot < minLot)
      return 0;

   int digits = 0;
   double temp = step;

   while(temp < 1.0 && digits < 8)
   {
      temp *= 10.0;
      digits++;
   }

   return NormalizeDouble(lot,digits);
}

//+------------------------------------------------------------------+
//| Check if symbol already has an open position                     |
//+------------------------------------------------------------------+
bool HasOpenPosition()
{
   return PositionSelect(_Symbol);
}

//+------------------------------------------------------------------+
//| Main trading function                                            |
//+------------------------------------------------------------------+
void OnTick()
{
   // Check spread
   double ask = SymbolInfoDouble(_Symbol,SYMBOL_ASK);
   double bid = SymbolInfoDouble(_Symbol,SYMBOL_BID);

   if(ask <= 0 || bid <= 0)
      return;

   double spread = (ask-bid)/_Point;

   if(spread > MaxSpreadPoints)
      return;

   // Only one open position per symbol
   if(HasOpenPosition())
      return;

   // Trade once per new candle
   datetime currentBar = iTime(_Symbol,_Period,0);

   if(currentBar == 0 || currentBar == lastBarTime)
      return;

   lastBarTime = currentBar;

   // Indicator buffers
   double fast[], slow[], rsi[], atr[];

   ArraySetAsSeries(fast,true);
   ArraySetAsSeries(slow,true);
   ArraySetAsSeries(rsi,true);
   ArraySetAsSeries(atr,true);

   if(CopyBuffer(fastHandle,0,0,3,fast) < 3 ||
      CopyBuffer(slowHandle,0,0,3,slow) < 3 ||
      CopyBuffer(rsiHandle,0,0,3,rsi) < 3 ||
      CopyBuffer(atrHandle,0,0,3,atr) < 3)
      return;

   // Use completed candles
   double fastPrevious = fast[2];
   double fastCurrent  = fast[1];

   double slowPrevious = slow[2];
   double slowCurrent  = slow[1];

   double currentRSI = rsi[1];
   double currentATR = atr[1];

   if(currentATR <= 0)
      return;

   int digits = (int)SymbolInfoInteger(_Symbol,SYMBOL_DIGITS);

   // BUY condition: bullish EMA crossover + RSI confirmation
   bool buySignal =
      fastPrevious <= slowPrevious &&
      fastCurrent > slowCurrent &&
      currentRSI > 50;

   // SELL condition: bearish EMA crossover + RSI confirmation
   bool sellSignal =
      fastPrevious >= slowPrevious &&
      fastCurrent < slowCurrent &&
      currentRSI < 50;

   // BUY ORDER
   if(buySignal)
   {
      double entry = ask;
      double sl = NormalizeDouble(
         entry - currentATR*ATRMultiplier,digits);

      double tp = NormalizeDouble(
         entry + (entry-sl)*RiskReward,digits);

      double lot = CalculateLot(entry,sl,ORDER_TYPE_BUY);

      if(lot > 0)
      {
         if(!trade.Buy(lot,_Symbol,0,sl,tp,
                       "Nathaniel Smart BUY"))
            Print("BUY failed: ",trade.ResultRetcodeDescription());
      }
   }

   // SELL ORDER
   if(sellSignal)
   {
      double entry = bid;
      double sl = NormalizeDouble(
         entry + currentATR*ATRMultiplier,digits);

      double tp = NormalizeDouble(
         entry - (sl-entry)*RiskReward,digits);

      double lot = CalculateLot(entry,sl,ORDER_TYPE_SELL);

      if(lot > 0)
      {
         if(!trade.Sell(lot,_Symbol,0,sl,tp,
                        "Nathaniel Smart SELL"))
            Print("SELL failed: ",trade.ResultRetcodeDescription());
      }
   }
}
//+------------------------------------------------------------------+

Yanıtlandı

1
Geliştirici 1
Derecelendirme
(319)
Projeler
574
35%
Arabuluculuk
84
31% / 44%
Süresi dolmuş
207
36%
Çalışıyor
2
Geliştirici 2
Derecelendirme
Projeler
0
0%
Arabuluculuk
0
Süresi dolmuş
0
Serbest
3
Geliştirici 3
Derecelendirme
Projeler
0
0%
Arabuluculuk
0
Süresi dolmuş
0
Serbest
4
Geliştirici 4
Derecelendirme
(1)
Projeler
2
0%
Arabuluculuk
0
Süresi dolmuş
0
Serbest
Yayınlandı: 19 kod
5
Geliştirici 5
Derecelendirme
Projeler
0
0%
Arabuluculuk
0
Süresi dolmuş
0
Serbest
6
Geliştirici 6
Derecelendirme
Projeler
0
0%
Arabuluculuk
0
Süresi dolmuş
0
Serbest
Yayınlandı: 2 kod
7
Geliştirici 7
Derecelendirme
Projeler
0
0%
Arabuluculuk
0
Süresi dolmuş
0
Serbest
Yayınlandı: 3 kod
8
Geliştirici 8
Derecelendirme
(1)
Projeler
1
100%
Arabuluculuk
0
Süresi dolmuş
0
Serbest
9
Geliştirici 9
Derecelendirme
(1)
Projeler
1
0%
Arabuluculuk
0
Süresi dolmuş
0
Serbest
Yayınlandı: 4 kod
Benzer siparişler
Mrwin 30+ USD
//+------------------------------------------------------------------+ //| NATHANIEL SMART TRADER EA v1.0 | //| MetaTrader 5 - MQL5 | //| EMA + RSI + ATR + Risk Management | //+------------------------------------------------------------------+ #property copyright "Nathaniel" #property version "1.00" #property strict #include <Trade/Trade.mqh> CTrade trade; //--- Trading settings input double RiskPercent = 1.0; input
--- I need an MT5 Expert Advisor (EA) for Forex trading. Strategy: - Trade when fast Moving Average (9) crosses above slow Moving Average (21) = BUY - Trade when fast Moving Average (9) crosses below slow Moving Average (21) = SELL - Only 1 trade at a time Settings I want to change: - Lot size - Stop Loss in pips - Take Profit in pips - Trailing Stop - Trading hours (Start and End time) Risk: - Close all trades at
ICC SMART STRUCTURE EA 50 - 100 USD
DEVELOPMENT REQUIREMENTS Project Title: ICC Smart Structure EA – MT5 Automated Trading System 1. Project Objective I want a fully automated Expert Advisor (EA) for MetaTrader 5 (MT5), based on my Indication–Correction–Continuation (ICC) trading strategy. The EA must identify market structure, Break of Structure (BOS), swing highs and lows, supply and demand zones, corrections and continuation entries across multiple
I want reading tradingviwer signal and want open mt5 account trades. Want reading stop loss size and take a profit size and when signalClosing ! This ea want cancel open trades
برمجة روبوت تداول MQL5 بهدف 50 نقطة مع إدارة مخاطر.مطلوب برمجة خبير تداول آلي يعمل على منصة MQL5، يركز على تحقيق هدف 50 نقطة مع إدارة صارمة للمخاطر وتحديد وقف الخسارة
Hello, I'm looking for a developer who can build an automated trading bot (Expert Advisor) for MetaTrader 5 (MT5). I want a smart trading robot that can scan the markets, identify high-probability trading opportunities, and automatically execute trades. Strategies and indicators I'd like included: RSI (75 overbought / 25 oversold). MACD crossover with strong momentum. 9/21 EMA crossover. 20/50 SMA crossover. Smart
Delete/Remove . Integrate Support & Resistance . Prop Firm Expert. (Expert is Active With a firm's account) . (Tick Volume) spikes specifically when price interacts with pre-defined Support and Resistance zones. [ required ]
I am looking for an experienced MQL5 developer to create a simple, well-organized Expert Advisor for MetaTrader 5. Requirements: - Provide complete and editable MQL5 source code. - Explain the EA's functionality and logic clearly. - Include configurable settings. - Include appropriate risk-control features. - Provide clear installation and testing instructions. - Ensure the code is clean and properly documented. I
PROJECT NAME: BALISA AI VERSION 1.0 I want to develop my own automated trading robot called Balisa AI for MetaTrader 5 (MT5). REQUIREMENTS: 1. The robot must support Forex and Gold (XAUUSD). 2. It must operate as an Expert Advisor (EA) on MT5. 3. It must automatically identify trading opportunities and execute buy and sell orders. 4. It must have Stop Loss and Take Profit. 5. It must include risk management to
🚀 THE AIRAK PHASE 3: SUBSCRIPTION, PAYMENT, LICENSING & AFFILIATE SYSTEM Project: THE AIRAK Trading Assistant Development Phase: Phase 3 Project Owner: Kayemba Joseph Platform: MetaTrader 5 (MT5) 1. PROJECT OBJECTIVE Phase 3 is intended to transform THE AIRAK into a subscription-based trading software business. The system should allow customers to register, purchase subscriptions, receive automatically activated

Proje bilgisi

Bütçe
30+ USD
Son teslim tarihi
from 1 to 365 gün

Müşteri

Verilmiş siparişler2
Arabuluculuk sayısı0