//+------------------------------------------------------------------+
//| Simple Robo Trader MT5 |
//| Works on any pair & timeframe |
//+------------------------------------------------------------------+
#property strict
// Input settings
input double LotSize = 0.01;
input int FastMA = 10;
input int SlowMA = 30;
input int RSIPeriod = 14;
input int StopLoss = 200; // in points
input int TakeProfit = 400;// in points
// Indicator handles
int fastMAHandle;
int slowMAHandle;
int rsiHandle;
//+------------------------------------------------------------------+
int OnInit()
{
fastMAHandle = iMA(_Symbol, _Period, FastMA, 0, MODE_EMA, PRICE_CLOSE);
slowMAHandle = iMA(_Symbol, _Period, SlowMA, 0, MODE_EMA, PRICE_CLOSE);
rsiHandle = iRSI(_Symbol, _Period, RSIPeriod, PRICE_CLOSE);
return(INIT_SUCCEEDED);
}
//+------------------------------------------------------------------+
void OnTick()
{
if(PositionsTotal() > 0) return;
double fastMA[2], slowMA[2], rsi[1];
CopyBuffer(fastMAHandle, 0, 0, 2, fastMA);
CopyBuffer(slowMAHandle, 0, 0, 2, slowMA);
CopyBuffer(rsiHandle, 0, 0, 1, rsi);
// BUY Condition
if(fastMA[1] < slowMA[1] && fastMA[0] > slowMA[0] && rsi[0] > 50)
{
BuyTrade();
}
// SELL Condition
if(fastMA[1] > slowMA[1] && fastMA[0] < slowMA[0] && rsi[0] < 50)
{
SellTrade();
}
}
//+------------------------------------------------------------------+
void BuyTrade()
{
double price = SymbolInfoDouble(_Symbol, SYMBOL_ASK);
double sl = price - StopLoss * _Point;
double tp = price + TakeProfit * _Point;
MqlTradeRequest req;
MqlTradeResult res;
ZeroMemory(req);
req.action = TRADE_ACTION_DEAL;
req.symbol = _Symbol;
req.volume = LotSize;
req.type = ORDER_TYPE_BUY;
req.price = price;
req.sl = sl;
req.tp = tp;
req.deviation = 10;
OrderSend(req, res);
}
//+------------------------------------------------------------------+
void SellTrade()
{
double price = SymbolInfoDouble(_Symbol, SYMBOL_BID);
double sl = price + StopLoss * _Point;
double tp = price - TakeProfit * _Point;
MqlTradeRequest req;
MqlTradeResult res;
ZeroMemory(req);
req.action = TRADE_ACTION_DEAL;
req.symbol = _Symbol;
req.volume = LotSize;
req.type = ORDER_TYPE_SELL;
req.price = price;
req.sl = sl;
req.tp = tp;
req.deviation = 10;
OrderSend(req, res);
}
Benzer siparişler
I have a Telegram signal bot that trades SPX 0DTE options. Each signal includes: entry time, strike, entry price range, stop (~45% of entry), stepped targets (T1..T10, each step ~50% of entry), and a cancel rule. I have the full archive of its signals and its daily chart images (6 support/resistance lines). Task: Build a Python bot that produces the same entries as the original bot in real time and sends them to
Hello, I am interested in developing a professional MT5 Expert Advisor similar in functionality and technical sophistication to your reference product, Institutional SMC Robot: https://www.mql5.com/en/market/product/187011 I want to develop my own independent EA based on advanced Smart Money Concepts (SMC), with a strong focus on institutional price action, liquidity and market structure. The key functionalities I
Title: MT5 Expert Advisor (Trading Bot) Development: SMA/EMA + Smart Money Concepts Strategy Description (सीधा कॉपी-पेस्ट करें): I am an experienced trader and need a developer to build a custom trading bot (Expert Advisor) for MetaTrader 5 (MT5). My trading background: Strong knowledge of SMA and EMA (trend and crossover strategies) Full understanding of Smart Money Concepts (order blocks, liquidity, market
MarketMind Breakout Pro XAUUSD H1 — Donchian Breakout EA Project type: Personal EA development and backtesting Platform: MetaTrader 5 Instrument: XAUUSD Timeframe: H1 Strategy: Donchian Channel breakout with EMA 200 Project overview This project evaluates a Donchian breakout trading strategy for XAUUSD on the H1 timeframe. The system uses channel-based breakout conditions and an EMA 200 trend filter. Historical
Hi, I need NinjaTrader 8 Strategy Analyzer backtests on two of my strategies, each over 1 year AND 3 years of data. Please quote the full job. Common settings: NT8 Strategy Analyzer, MCL (Micro WTI Crude Oil) continuous front-month contract (MCL ##-##), 5-minute bars, 1yr + 3yr of the most recent data, $2.50 round-turn commission per contract. Deliverables per run: full Strategy Analyzer summary (net profit, profit