Şartname

Code pour créer un robot 



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

// SYMBOLS
string symbols[3] = {"Volatility 10 Index","Volatility 25 Index","Volatility 75 Index"};
string bestSymbol = "";

// VARIABLES
double startBalance;
int tradeCount = 0;
int lossStreak = 0;
bool tradingStopped = false;
bool profitMode = false;
datetime lastDay;

// PARAMÈTRES
double lotSize;
int stopLoss;
int takeProfit;
int trailingStop = 80;

//+------------------------------------------------------------------+
// RESET JOUR
void ResetDaily()
{
   datetime now = TimeCurrent();
   if(TimeDay(now) != TimeDay(lastDay))
   {
      startBalance = AccountInfoDouble(ACCOUNT_BALANCE);
      tradeCount = 0;
      lossStreak = 0;
      tradingStopped = false;
      profitMode = false;
      lastDay = now;
   }
}

//+------------------------------------------------------------------+
double GetProfitPercent()
{
   double balance = AccountInfoDouble(ACCOUNT_BALANCE);
   return ((balance - startBalance) / startBalance) * 100.0;
}

//+------------------------------------------------------------------+
// IA MEILLEUR INDICE
string GetBestSymbol()
{
   double bestScore = 0;
   string selected = symbols[0];

   for(int i=0; i<3; i++)
   {
      string sym = symbols[i];

      double range = iHigh(sym, PERIOD_M5, 0) - iLow(sym, PERIOD_M5, 0);
      double ema10 = iMA(sym, PERIOD_M5, 10, 0, MODE_EMA, PRICE_CLOSE, 0);
      double ema20 = iMA(sym, PERIOD_M5, 20, 0, MODE_EMA, PRICE_CLOSE, 0);

      double trend = MathAbs(ema10 - ema20);

      double score = range + trend;

      if(score > bestScore)
      {
         bestScore = score;
         selected = sym;
      }
   }

   return selected;
}

//+------------------------------------------------------------------+
// SCALPING V75
bool IsScalpingMode(string sym)
{
   if(sym == "Volatility 75 Index")
   {
      double range = iHigh(sym, PERIOD_M1, 0) - iLow(sym, PERIOD_M1, 0);
      return (range > 200 * _Point);
   }
   return false;
}

//+------------------------------------------------------------------+
// ANTI FAKE BREAKOUT
bool IsValidEntry(string sym)
{
   double rsi = iRSI(sym, PERIOD_M1, 14, PRICE_CLOSE, 0);

   double high0 = iHigh(sym, PERIOD_M1, 0);
   double low0 = iLow(sym, PERIOD_M1, 0);

   double range = high0 - low0;

   if(range < 100 * _Point) return false;
   if(range > 400 * _Point) return false;
   if(rsi > 75 || rsi < 25) return false;

   return true;
}

//+------------------------------------------------------------------+
// MARKET MAKER TRAP
bool IsMarketTrap(string sym)
{
   double high0 = iHigh(sym, PERIOD_M1, 0);
   double low0 = iLow(sym, PERIOD_M1, 0);
   double close0 = iClose(sym, PERIOD_M1, 0);
   double open0 = iOpen(sym, PERIOD_M1, 0);

   double range = high0 - low0;
   double body = MathAbs(close0 - open0);

   if(range > 350 * _Point && body < (range * 0.3))
      return true;

   return false;
}

//+------------------------------------------------------------------+
// SUPPORT / RESISTANCE
bool NearSupportResistance(string sym)
{
   double high = iHigh(sym, PERIOD_M15, iHighest(sym, PERIOD_M15, MODE_HIGH, 20, 0));
   double low = iLow(sym, PERIOD_M15, iLowest(sym, PERIOD_M15, MODE_LOW, 20, 0));

   double price = SymbolInfoDouble(sym, SYMBOL_BID);

   double zone = 150 * _Point;

   if(MathAbs(price - high) < zone || MathAbs(price - low) < zone)
      return true;

   return false;
}

//+------------------------------------------------------------------+
// MULTI TF
bool MultiTFConfirm(string sym)
{
   double ema10_M1 = iMA(sym, PERIOD_M1, 10, 0, MODE_EMA, PRICE_CLOSE, 0);
   double ema20_M1 = iMA(sym, PERIOD_M1, 20, 0, MODE_EMA, PRICE_CLOSE, 0);

   double ema10_M5 = iMA(sym, PERIOD_M5, 10, 0, MODE_EMA, PRICE_CLOSE, 0);
   double ema20_M5 = iMA(sym, PERIOD_M5, 20, 0, MODE_EMA, PRICE_CLOSE, 0);

   double ema10_M15 = iMA(sym, PERIOD_M15, 10, 0, MODE_EMA, PRICE_CLOSE, 0);
   double ema20_M15 = iMA(sym, PERIOD_M15, 20, 0, MODE_EMA, PRICE_CLOSE, 0);

   bool buyTrend =
      (ema10_M1 > ema20_M1) &&
      (ema10_M5 > ema20_M5) &&
      (ema10_M15 > ema20_M15);

   bool sellTrend =
      (ema10_M1 < ema20_M1) &&
      (ema10_M5 < ema20_M5) &&
      (ema10_M15 < ema20_M15);

   return (buyTrend || sellTrend);
}

//+------------------------------------------------------------------+
// TRAILING
void ManageTrailing(string sym)
{
   if(PositionSelect(sym))
   {
      double tp = PositionGetDouble(POSITION_TP);

      if(PositionGetInteger(POSITION_TYPE) == POSITION_TYPE_BUY)
      {
         double price = SymbolInfoDouble(sym, SYMBOL_BID);
         trade.PositionModify(sym, price - trailingStop * _Point, tp);
      }

      if(PositionGetInteger(POSITION_TYPE) == POSITION_TYPE_SELL)
      {
         double price = SymbolInfoDouble(sym, SYMBOL_ASK);
         trade.PositionModify(sym, price + trailingStop * _Point, tp);
      }
   }
}

Code pour créer un robot suite 

//+------------------------------------------------------------------+

bool StopConditions()

{

   double profit = GetProfitPercent();


   if(profit <= -5.0) return true;

   if(tradeCount >= 3) return true;

   if(lossStreak >= 2) return true;


   return false;

}


//+------------------------------------------------------------------+

void OnTick()

{

   ResetDaily();


   if(tradingStopped) return;


   double balance = AccountInfoDouble(ACCOUNT_BALANCE);

   lotSize = 0.01;

   stopLoss = 120;

   takeProfit = 140;


   double profit = GetProfitPercent();


   if(profit >= 2.0 && !profitMode)

   {

      profitMode = true;

      SendNotification("💰 Profit sécurisé");

   }


   if(StopConditions())

   {

      tradingStopped = true;

      SendNotification("🚫 STOP");

      return;

   }


   bestSymbol = GetBestSymbol();

   string sym = bestSymbol;


   ManageTrailing(sym);


   double lot = profitMode ? lotSize * 0.5 : lotSize;


   if(IsScalpingMode(sym))

   {

      stopLoss = 80;

      takeProfit = 100;

   }


   double ema10 = iMA(sym, PERIOD_M1, 10, 0, MODE_EMA, PRICE_CLOSE, 0);

   double ema20 = iMA(sym, PERIOD_M1, 20, 0, MODE_EMA, PRICE_CLOSE, 0);

   double rsi = iRSI(sym, PERIOD_M1, 14, PRICE_CLOSE, 0);


   double ask = SymbolInfoDouble(sym, SYMBOL_ASK);

   double bid = SymbolInfoDouble(sym, SYMBOL_BID);


   if(!PositionSelect(sym)

      && IsValidEntry(sym)

      && !IsMarketTrap(sym)

      && NearSupportResistance(sym)

      && MultiTFConfirm(sym))

   {

      if(ema10 > ema20 && rsi > 55)

      {

         trade.Buy(lot, sym, ask,

                   bid - stopLoss * _Point,

                   bid + takeProfit * _Point);


         tradeCount++;

         SendNotification("📈 BUY " + sym);

      }


      if(ema10 < ema20 && rsi < 45)

      {

         trade.Sell(lot, sym, bid,

                    ask + stopLoss * _Point,

                    ask - takeProfit * _Point);


         tradeCount++;

         SendNotification("📉 SELL " + sym);

      }

   }

}


//+------------------------------------------------------------------+

void OnTradeTransaction(const MqlTradeTransaction &trans,

                        const MqlTradeRequest &request,

                        const MqlTradeResult &result)

{

   if(trans.type == TRADE_TRANSACTION_DEAL_ADD)

   {

      if(trans.profit < 0)

         lossStreak++;

      else

         lossStreak = 0;

   }

}


Yanıtlandı

1
Geliştirici 1
Derecelendirme
Projeler
0
0%
Arabuluculuk
0
Süresi dolmuş
0
Serbest
2
Geliştirici 2
Derecelendirme
(298)
Projeler
478
40%
Arabuluculuk
105
40% / 24%
Süresi dolmuş
82
17%
Yüklendi
Yayınlandı: 2 kod
3
Geliştirici 3
Derecelendirme
Projeler
0
0%
Arabuluculuk
0
Süresi dolmuş
0
Serbest
4
Geliştirici 4
Derecelendirme
Projeler
0
0%
Arabuluculuk
0
Süresi dolmuş
0
Serbest
Benzer siparişler
Hi, I want to develop a highly accurate, custom technical indicator for MetaTrader 5 (MT5) specifically tailored for 1-minute Binary Options trading (Quotex). I do NOT need an automated trading bot. I only need visual buy/sell arrows on the chart, an advanced alert system, and an on-chart performance statistics dashboard. The indicator must be 100% non-repainting. --- 1. STRATEGY CONFLUENCE LOGIC The indicator should
Create a bot that can trade and read indicators easy to read for first time users. Bot that can be used on a phone and connect to MT5. It should be easy to install or use on any device especially phone and laptop, preferably the bot that can run over night and controllable when needed
C'est un Expert Advisor (EA) MQL5 pour MetaTrader 5, conçu pour l' XAUUSD , combinant un filtre de tendance et une grille adaptative avec gestion de panier ("basket") et protections contre le drawdown. Version 1.00. Logique de trading Filtre de tendance (H4 par défaut) • EMA rapide (50) vs EMA lente (200) pour déterminer la direction (UP/DOWN) • Filtre ADX (période 14, seuil 18) pour éviter de trader en
My EA is semi Auto EA..with Master and slave concept Using Heiken Ashi +Heiken Smooth and Moving Average What to do?1. Remove some previous feature 2.Change some rules of 4 slave to pending Order 3. Check the coding is clean. 4. create panel dialog box
These are orderflow footprint indicator I would like to know if you can algorithmisie and build a stacked imbalance bot from them .. Kindlt let me know if you can do it and check the file before replying me
I have 2 trading view indicators by GainzAlgo that I want code to mt5 , could u advise? I need you to give me response if you can convert This
I currently sell a white-label XAUUSD EA, but the existing supplier owns the source code. I now need a new, independently developed EA and licensing system that my company fully owns and controls. I am not requesting decompilation or copying of proprietary code. Existing settings, presets and trading examples will be provided as reference. The developer must first identify any missing strategy rules before
I DO NOT need any programming or strategy development. I already have a working NinjaTrader 8 automated strategy based on a 3/5 EMA crossover. I need you to run my existing strategy through NinjaTrader Strategy Analyzer/Optimizer, test the existing adjustable parameters, and find robust settings with the best profit factor and lowest reasonable drawdown. I will provide the existing NinjaScript ZIP. I do not want the
I am looking to acquire an EXISTING and PROVEN MetaTrader 5 Expert Advisor. I am NOT looking for someone to develop a random new strategy from scratch. The objective is to find a robust EA with an existing track record, verify its performance and robustness, and purchase the MQL5 source code together with clearly defined commercial rights. MAIN REQUIREMENTS The EA should meet most or all of the following
Looking to acquire an existing, proven EA. Not looking for new strategy development. REQUIREMENTS — non-negotiable: Minimum 12 months verified LIVE history (Myfxbook or MQL5 Signals, real money — not demo, not backtest) Hard stop loss on EVERY trade, set at order placement NO martingale, NO grid, NO averaging into losers, NO lot multiplication after a loss Max historical drawdown under 30% Minimum 5 trades per

Proje bilgisi

Bütçe
30+ USD