指定

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;

   }

}


応答済み

1
開発者 1
評価
プロジェクト
0
0%
仲裁
0
期限切れ
0
類似した注文
I am looking for a professional MT5/MT4 developer to build a fully automated Expert Advisor based on a custom trading system called "Armani Gold EA 3.0". The strategy is designed specifically for XAUUSD (Gold) and combines: - Smart Money Concepts (SMC) - Fair Value Gap (FVG) - Order Blocks (OB) - Liquidity Sweep logic - Fibonacci retracement zones (50%–61.8%) - Momentum confirmation using MACD and Bollinger Bands -
I need someone to recreate this indicator for mt5 for $60 it has to be non repaint ,I've been trying to code this indicator so if someone can do it my contact is , sebokomorobi6@gmail.com ,or 073 923 0151 you can contact the number on Whatsapp no calls allowed
Bonjour j’ai besoin d’un expert capable de me creer un robot de trading lié à un canal télégramme qui sera en mesure de détecter les signaux dans un canal télégramme et les exécuter sur mon compte de trading
Hi Im working with a Crypto trading company and we want to branch out with our indicator, i'm researching the bot automation and need some hands on board. i i want to hear your opinion about the indicator that i would like you to build. in the PDF i explain the whole indicator and how it need to look like. happy to hear form you
The ea must repeat all orders until closed manually by a 'close all button' needed on panel EA must start at specific time / day and enter 'at market' - should be easy to code :) INPUTS REQUIRED: Pair ___ - Lot Size____ - Type ____ ( buy / sell) - Distance between trades in points______ - TP for each trade in points_____ - Maximum spread in Pips _____ - Time and day to
I want someone to hold a session for me and explain in details on how to implement them in. I would really appreciate your guidance on how to properly set up GoCharting and get access to CME futures data
Mani 30 - 50 USD
Title: MT5 Martingale EA (Based on Stop Loss of Previous Trade) Description: Hello, I need a simple and efficient MT5 Expert Advisor based on a martingale logic. Main Logic: The EA should work with trades placed manually or by another EA (including limit orders). When a trade hits Stop Loss, the EA must automatically open a new trade in the same direction. The lot size of the new trade should be multiplied
Existing EA 30 USD
I’m looking to acquire an existing, profitable Expert Advisor (EA) with full source code to add to our client investment portfolio. To be clear, this is not a request to develop or design a new strategy. If you already have an EA that is proven, consistent, and production-ready, I’m open to reviewing it immediately. Please apply only if you meet all the requirements below. Submissions without a proper introduction or
Wealthy bot 50 - 200 USD
‎Build a mobile-based trading bot system integrated with MetaTrader 5 that specializes in high-frequency “machine gun” style trading on synthetic indices (crash 50 and Crash 300). ‎ ‎The bot must continuously scan the market in real-time using M1 and M5 timeframes and execute frequent trades based on probability, not prediction. Its core function is to detect early signs of potential reversals by analyzing combined
EA Script editor 30 - 35 USD
I need someone who will help me with a script that supports / cancels out negative positions. So that with a deposit of 600 euros, it doesn't close 300 euros. More info on pv

プロジェクト情報

予算
30+ USD

依頼者

出された注文1
裁定取引数0