Deriv पर MT5 के लिए AI के साथ Expert Advisor कैसे बनाएँ
Expert Advisors (EAs) trading bots हैं जो MetaTrader 5 पर चलते हैं। AI के साथ, आप sophisticated EAs बना सकते हैं MQL5 जाने बिना — बस strategy describe करें और AI complete code generate करता है।
Deriv integrated MT5 देता है — तो आप platform पर सीधे EAs बना, test, और run कर सकते हैं, Forex, synthetic indices (V75), और अधिक तक access के साथ।
Expert Advisor क्या है?
यह MQL5 में लिखा एक program है जो MetaTrader 5 के अंदर चलता है। यह कर सकता है:
- Indicators (RSI, MACD, EMAs, आदि) का उपयोग करके market analyze
- Positions automatically open और close
- Stop loss, take profit, और trailing stops manage
- Human intervention के बिना 24/7 चलना
- Historical data के साथ Backtest
Deriv पर MT5 क्यों उपयोग करें?
- ✅ Synthetic indices (V75, Crash/Boom) तक access — 24/7
- ✅ CFDs के माध्यम से Forex, commodities, और crypto
- ✅ $10,000 (~₹8,30,000) virtual funds के साथ Demo account
- ✅ Strategy Tester में Built-in Backtesting
- ✅ MT5 के लिए Official Deriv support
- ✅ EA server-side चलता है — आपके PC को on रखने की ज़रूरत नहीं (VPS के साथ)
Deriv पर MT5 Setting up
Deriv account बनाएँ
deriv.com पर जाएँ और अपना account बनाएँ (मुफ्त)।
Deriv MT5 enable करें
Trader’s Hub में → “CFDs” section → Deriv MT5 के बगल में “Get” click करें → MT5 account बनाएँ (demo या live)।
MT5 Download करें
अपने system के लिए MetaTrader 5 download करें (Windows, Mac, Wine के माध्यम से Linux)। या browser में सीधे MT5 web version का उपयोग करें।
Login करें
Deriv द्वारा प्रदान किए गए MT5 credentials का उपयोग करें (login, password, server)। Deriv server “Deriv-Demo” या “Deriv-Server” है।
AI के साथ EA बनाना
यहाँ है पूरी process:
AI को strategy describe करें
ChatGPT या Claude खोलें और नीचे दिए गए prompt का उपयोग करें।
🤖 Complete EA generate करने के लिए Prompt
MQL5 code copy करें
AI complete EA generate करता है (~200-300 lines)। सारा code copy करें।
MetaEditor खोलें
MT5 में → “Tools” menu → “MetaQuotes Language Editor” (या F4 दबाएँ)। एक नई file बनाएँ: File → New → Expert Advisor।
Paste और compile करें
Default code delete करें। AI code paste करें। “Compile” (F7) click करें। यदि errors हैं, messages वापस AI में paste करें और fix माँगें।
Strategy Tester में Test करें
MT5 में → View → Strategy Tester। अपना EA, asset (V75), period (1 साल) चुनें, और backtest run करें। Report analyze करें।
Demo account पर Run करें
EA को asset chart पर drag करें। “AutoTrading” enable करें (top button)। EA automatically trading शुरू कर देता है।
Sample EA — ready code
//+------------------------------------------------------------------+
//| EA EMA Cross + RSI — AI-generated |
//| IA Trader Pro — iatraderpro.com/ |
//| WARNING: Use only on a DEMO account! |
//+------------------------------------------------------------------+
#property copyright "IA Trader Pro"
#property version "1.00"
#property strict
// Input parameters
input int EMA_Fast = 9; // Fast EMA period
input int EMA_Slow = 21; // Slow EMA period
input int RSI_Period = 14; // RSI period
input int RSI_Lower = 40; // RSI minimum for buy
input int RSI_Upper = 60; // RSI maximum for sell
input double RiskPercent = 2.0; // Risk per trade (%)
input int StopLoss = 200; // Stop Loss in points
input int TakeProfit = 400; // Take Profit in points
input int TrailingStop = 100; // Trailing Stop in points
input int MagicNumber = 12345; // Magic number
// Indicator handles
int handleEmaFast, handleEmaSlow, handleRsi;
//+------------------------------------------------------------------+
//| Initialization |
//+------------------------------------------------------------------+
int OnInit()
{
handleEmaFast = iMA(_Symbol, PERIOD_CURRENT, EMA_Fast, 0, MODE_EMA, PRICE_CLOSE);
handleEmaSlow = iMA(_Symbol, PERIOD_CURRENT, EMA_Slow, 0, MODE_EMA, PRICE_CLOSE);
handleRsi = iRSI(_Symbol, PERIOD_CURRENT, RSI_Period, PRICE_CLOSE);
if(handleEmaFast == INVALID_HANDLE || handleEmaSlow == INVALID_HANDLE || handleRsi == INVALID_HANDLE)
{
Print("❌ Error creating indicators");
return INIT_FAILED;
}
Print("✅ EA IA Trader Pro started successfully");
return INIT_SUCCEEDED;
}
//+------------------------------------------------------------------+
//| Deinitialization |
//+------------------------------------------------------------------+
void OnDeinit(const int reason)
{
IndicatorRelease(handleEmaFast);
IndicatorRelease(handleEmaSlow);
IndicatorRelease(handleRsi);
Print("EA stopped. Reason: ", reason);
}
//+------------------------------------------------------------------+
//| Main tick |
//+------------------------------------------------------------------+
void OnTick()
{
// Check if there's an open position
if(PositionsTotal() > 0)
{
// Apply trailing stop
ApplyTrailingStop();
return;
}
// Get indicator values
double emaFast[], emaSlow[], rsi[];
CopyBuffer(handleEmaFast, 0, 0, 3, emaFast);
CopyBuffer(handleEmaSlow, 0, 0, 3, emaSlow);
CopyBuffer(handleRsi, 0, 0, 2, rsi);
ArraySetAsSeries(emaFast, true);
ArraySetAsSeries(emaSlow, true);
ArraySetAsSeries(rsi, true);
// Crossover up (buy signal)
bool crossUp = emaFast[1] <= emaSlow[1] && emaFast[0] > emaSlow[0];
bool crossDown = emaFast[1] >= emaSlow[1] && emaFast[0] < emaSlow[0];
double lot = CalculateLot();
// BUY signal
if(crossUp && rsi[0] > RSI_Lower && rsi[0] < 70)
{
double price = SymbolInfoDouble(_Symbol, SYMBOL_ASK);
double sl = price - StopLoss * _Point;
double tp = price + TakeProfit * _Point;
MqlTradeRequest req = {};
MqlTradeResult res = {};
req.action = TRADE_ACTION_DEAL;
req.symbol = _Symbol;
req.volume = lot;
req.type = ORDER_TYPE_BUY;
req.price = price;
req.sl = sl;
req.tp = tp;
req.magic = MagicNumber;
req.comment = "IA Trader Pro BUY";
if(OrderSend(req, res))
Print("🟢 BUY: ", lot, " lots @ ", price);
else
Print("❌ Buy error: ", res.retcode);
}
// SELL signal
if(crossDown && rsi[0] < RSI_Upper && rsi[0] > 30)
{
double price = SymbolInfoDouble(_Symbol, SYMBOL_BID);
double sl = price + StopLoss * _Point;
double tp = price - TakeProfit * _Point;
MqlTradeRequest req = {};
MqlTradeResult res = {};
req.action = TRADE_ACTION_DEAL;
req.symbol = _Symbol;
req.volume = lot;
req.type = ORDER_TYPE_SELL;
req.price = price;
req.sl = sl;
req.tp = tp;
req.magic = MagicNumber;
req.comment = "IA Trader Pro SELL";
if(OrderSend(req, res))
Print("🔴 SELL: ", lot, " lots @ ", price);
else
Print("❌ Sell error: ", res.retcode);
}
}
//+------------------------------------------------------------------+
//| Calculate lot based on risk |
//+------------------------------------------------------------------+
double CalculateLot()
{
double balance = AccountInfoDouble(ACCOUNT_BALANCE);
double riskAmount = balance * RiskPercent / 100.0;
double tickValue = SymbolInfoDouble(_Symbol, SYMBOL_TRADE_TICK_VALUE);
double lot = riskAmount / (StopLoss * tickValue);
double minLot = SymbolInfoDouble(_Symbol, SYMBOL_VOLUME_MIN);
double maxLot = SymbolInfoDouble(_Symbol, SYMBOL_VOLUME_MAX);
double lotStep = SymbolInfoDouble(_Symbol, SYMBOL_VOLUME_STEP);
lot = MathFloor(lot / lotStep) * lotStep;
lot = MathMax(minLot, MathMin(maxLot, lot));
return lot;
}
//+------------------------------------------------------------------+
//| Trailing Stop |
//+------------------------------------------------------------------+
void ApplyTrailingStop()
{
for(int i = PositionsTotal() - 1; i >= 0; i--)
{
if(PositionGetSymbol(i) != _Symbol) continue;
if(PositionGetInteger(POSITION_MAGIC) != MagicNumber) continue;
double openPrice = PositionGetDouble(POSITION_PRICE_OPEN);
double currentSL = PositionGetDouble(POSITION_SL);
double bid = SymbolInfoDouble(_Symbol, SYMBOL_BID);
double ask = SymbolInfoDouble(_Symbol, SYMBOL_ASK);
long type = PositionGetInteger(POSITION_TYPE);
if(type == POSITION_TYPE_BUY)
{
double newSL = bid - TrailingStop * _Point;
if(newSL > currentSL && newSL > openPrice)
{
MqlTradeRequest req = {};
MqlTradeResult res = {};
req.action = TRADE_ACTION_SLTP;
req.position = PositionGetInteger(POSITION_TICKET);
req.symbol = _Symbol;
req.sl = newSL;
req.tp = PositionGetDouble(POSITION_TP);
OrderSend(req, res);
}
}
else if(type == POSITION_TYPE_SELL)
{
double newSL = ask + TrailingStop * _Point;
if(newSL < currentSL && newSL < openPrice)
{
MqlTradeRequest req = {};
MqlTradeResult res = {};
req.action = TRADE_ACTION_SLTP;
req.position = PositionGetInteger(POSITION_TICKET);
req.symbol = _Symbol;
req.sl = newSL;
req.tp = PositionGetDouble(POSITION_TP);
OrderSend(req, res);
}
}
}
}
✅ यह EA करता है:
EMA 9/21 crossover + RSI filter → automatic buy/sell → 200pt stop loss → 400pt take profit (1:2) → 100pt trailing stop → 2% risk पर lot sized → max 1 position। Deriv MT5 पर compile और run करने के लिए तैयार।
AI के साथ Power up
basic EA चलाने के बाद, AI से add करने को कहें:
- Time filter: “Trade only between 08:00 and 17:00 GMT”
- Multi-timeframe: “Confirm direction on the H1 timeframe before trading on M5”
- MACD as filter: “Only buy if MACD histogram is positive”
- Auto-breakeven: “Move SL to entry price when profit reaches 100 points”
- Chart dashboard: “Show a panel with indicator status, last trade, P&L”
🚀 MT5 पर EAs चलाने के लिए, अपना मुफ्त Deriv MT5 account बनाएँ:
Deriv MT5 Account बनाएँ →📚 Related
→ Deriv Bot: No-Code Bots
→ Python + Deriv API
→ Traders के लिए 5 AI Prompts (EA prompt शामिल)
→ Deriv Review 2026
