İş Gereklilikleri
//+------------------------------------------------------------------+
//| XAUUSD Automated Forex Robot |
//| Enhanced Version with Error Handling and Improvements |
//+------------------------------------------------------------------+
input int FastMA = 10; // Fast moving average period
input int SlowMA = 50; // Slow moving average period
input int RSI_Period = 14; // RSI period
input double Overbought = 70; // RSI overbought level
input double Oversold = 30; // RSI oversold level
input double RiskPercent = 1.0; // Risk per trade as a percentage of account equity
input double ATRMultiplier = 2.0; // ATR multiplier for stop-loss
input double TrailingStop = 300; // Trailing stop in points
input double MinLotSize = 0.01; // Minimum lot size
input double LotStep = 0.01; // Lot size increment
input int ATR_Period = 14; // ATR period
input int MaxSlippage = 3; // Maximum slippage in points
input int MAGIC_NUMBER = 123456; // Unique identifier for trades
input string TradeComment = "XAUUSD Bot"; // Trade comment
//+------------------------------------------------------------------+
//| OnTick Function - Main Logic |
//+------------------------------------------------------------------+
void OnTick() {
// Calculate indicators
static double fastMA, slowMA, rsi, atr;
fastMA = iMA(NULL, 0, FastMA, 0, MODE_EMA, PRICE_CLOSE, 0);
slowMA = iMA(NULL, 0, SlowMA, 0, MODE_EMA, PRICE_CLOSE, 0);
rsi = iRSI(NULL, 0, RSI_Period, PRICE_CLOSE, 0);
atr = iATR(NULL, 0, ATR_Period, 0);
// Check for existing trades
bool buyOpen = IsTradeOpen(OP_BUY);
bool sellOpen = IsTradeOpen(OP_SELL);
// Entry logic
if (fastMA > slowMA && rsi > Oversold && rsi < 50 && !buyOpen) {
// Buy Signal
double sl = Bid - ATRMultiplier * atr;
double tp = Bid + ATRMultiplier * atr * 2;
double lotSize = CalculateLotSize(sl);
OpenTrade(OP_BUY, lotSize, sl, tp);
}
if (fastMA < slowMA && rsi < Overbought && rsi > 50 && !sellOpen) {
// Sell Signal
double sl = Ask + ATRMultiplier * atr;
double tp = Ask - ATRMultiplier * atr * 2;
double lotSize = CalculateLotSize(sl);
OpenTrade(OP_SELL, lotSize, sl, tp);
}
// Exit logic (Close trades when conditions reverse)
if (buyOpen && (fastMA < slowMA || rsi >= Overbought)) {
CloseTrade(OP_BUY);
}
if (sellOpen && (fastMA > slowMA || rsi <= Oversold)) {
CloseTrade(OP_SELL);
}
// Manage Trailing Stop
ManageTrailingStop();
}
//+------------------------------------------------------------------+
//| Calculate Lot Size Based on Risk |
//+------------------------------------------------------------------+
double CalculateLotSize(double stopLossPrice) {
double accountEquity = AccountEquity();
double riskAmount = (RiskPercent / 100) * accountEquity;
double stopLossDistance = MathAbs(Bid - stopLossPrice);
double lotSize = riskAmount / (stopLossDistance * MarketInfo(Symbol(), MODE_TICKVALUE));
// Adjust lot size to broker limits
lotSize = MathMax(lotSize, MinLotSize);
lotSize = NormalizeDouble(MathFloor(lotSize / LotStep) * LotStep, 2);
return lotSize;
}
//+------------------------------------------------------------------+
//| Open Trade Function |
//+------------------------------------------------------------------+
void OpenTrade(int tradeType, double lotSize, double stopLoss, double takeProfit) {
double price = tradeType == OP_BUY ? Ask : Bid;
int ticket = OrderSend(Symbol(), tradeType, lotSize, price, MaxSlippage, stopLoss, takeProfit, TradeComment, MAGIC_NUMBER, 0, Blue);
if (ticket < 0) {
int errorCode = GetLastError();
Print("Error opening trade: ", errorCode, ". Retrying...");
Sleep(1000); // Retry after 1 second
ticket = OrderSend(Symbol(), tradeType, lotSize, price, MaxSlippage, stopLoss, takeProfit, TradeComment, MAGIC_NUMBER, 0, Blue);
if (ticket < 0) {
Print("Failed to open trade after retry. Error: ", GetLastError());
}
} else {
Print("Trade opened: ", ticket);
}
}
//+------------------------------------------------------------------+
//| Close Trade Function |
//+------------------------------------------------------------------+
void CloseTrade(int tradeType) {
for (int i = OrdersTotal() - 1; i >= 0; i--) {
if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) {
if (OrderSymbol() == Symbol() && OrderType() == tradeType && OrderMagicNumber() == MAGIC_NUMBER) {
int ticket = OrderClose(OrderTicket(), OrderLots(), tradeType == OP_BUY ? Bid : Ask, MaxSlippage, Red);
if (ticket < 0) {
Print("Error closing trade: ", GetLastError());
} else {
Print("Trade closed: ", ticket);
}
}
}
}
}
//+------------------------------------------------------------------+
//| Manage Trailing Stop Function |
//+------------------------------------------------------------------+
void ManageTrailingStop() {
for (int i = OrdersTotal() - 1; i >= 0; i--) {
if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) {
if (OrderSymbol() == Symbol() && OrderMagicNumber() == MAGIC_NUMBER) {
double newStopLoss;
if (OrderType() == OP_BUY) {
newStopLoss = Bid - TrailingStop * Point;
if (newStopLoss > OrderStopLoss()) {
OrderModify(OrderTicket(), OrderOpenPrice(), newStopLoss, OrderTakeProfit(), 0, Blue);
}
} else if (OrderType() == OP_SELL) {
newStopLoss = Ask + TrailingStop * Point;
if (newStopLoss < OrderStopLoss()) {
OrderModify(OrderTicket(), OrderOpenPrice(), newStopLoss, OrderTakeProfit(), 0, Blue);
}
}
}
}
}
}
//+------------------------------------------------------------------+
//| Check if Trade Exists |
//+------------------------------------------------------------------+
bool IsTradeOpen(int tradeType) {
for (int i = OrdersTotal() - 1; i >= 0; i--) {
if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) {
if (OrderSymbol() == Symbol() && OrderType() == tradeType && OrderMagicNumber() == MAGIC_NUMBER) {
return true;
}
}
}
return false;
}
Yanıtlandı
1
Derecelendirme
Projeler
192
58%
Arabuluculuk
10
80%
/
0%
Süresi dolmuş
0
Çalışıyor
Yayınlandı: 1 kod
2
Derecelendirme
Projeler
313
28%
Arabuluculuk
33
27%
/
64%
Süresi dolmuş
10
3%
Serbest
3
Derecelendirme
Projeler
38
21%
Arabuluculuk
5
0%
/
60%
Süresi dolmuş
0
Serbest
4
Derecelendirme
Projeler
505
19%
Arabuluculuk
32
44%
/
31%
Süresi dolmuş
34
7%
Yüklendi
5
Derecelendirme
Projeler
20
10%
Arabuluculuk
4
50%
/
50%
Süresi dolmuş
5
25%
Serbest
6
Derecelendirme
Projeler
628
54%
Arabuluculuk
30
53%
/
23%
Süresi dolmuş
6
1%
Yüklendi
7
Derecelendirme
Projeler
8
13%
Arabuluculuk
3
0%
/
33%
Süresi dolmuş
2
25%
Serbest
Yayınlandı: 1 kod
8
Derecelendirme
Projeler
13
23%
Arabuluculuk
7
0%
/
71%
Süresi dolmuş
3
23%
Çalışıyor
9
Derecelendirme
Projeler
105
60%
Arabuluculuk
0
Süresi dolmuş
0
Serbest
10
Derecelendirme
Projeler
6
17%
Arabuluculuk
0
Süresi dolmuş
3
50%
Serbest
11
Derecelendirme
Projeler
2
0%
Arabuluculuk
5
0%
/
80%
Süresi dolmuş
1
50%
Serbest
12
Derecelendirme
Projeler
134
66%
Arabuluculuk
36
25%
/
56%
Süresi dolmuş
22
16%
Serbest
Yayınlandı: 10 kod
13
Derecelendirme
Projeler
486
75%
Arabuluculuk
6
67%
/
17%
Süresi dolmuş
0
Çalışıyor
14
Derecelendirme
Projeler
165
24%
Arabuluculuk
23
9%
/
78%
Süresi dolmuş
16
10%
Çalışıyor
15
Derecelendirme
Projeler
634
33%
Arabuluculuk
39
41%
/
49%
Süresi dolmuş
11
2%
Yüklendi
16
Derecelendirme
Projeler
1
0%
Arabuluculuk
1
0%
/
100%
Süresi dolmuş
0
Serbest
17
Derecelendirme
Projeler
0
0%
Arabuluculuk
0
Süresi dolmuş
0
Serbest
Yayınlandı: 1 kod
18
Derecelendirme
Projeler
81
43%
Arabuluculuk
27
11%
/
70%
Süresi dolmuş
8
10%
Serbest
19
Derecelendirme
Projeler
0
0%
Arabuluculuk
0
Süresi dolmuş
0
Çalışıyor
Benzer siparişler
Hello, good day to you Developers, I am looking for someone that can deliver on a project with the following requirements: The job I am about to give out will involve "Tradingview" and "Metatrader 5" Tradingview: for analysis, as the Strategy uses one second charts/candles, Metatrader 5: for executing and managing the trades. For this EA to work well for the project's aims, SPEED of execution is of upmost
Application. I undertake not to communicate with Applicants anywhere else except this Application, including third-party messengers, personal correspondence or emails. I understand that violators will be banned from publishing Orders in the Freelance service
Hi, I need a simple MT5 EA. Based on my simple trading strategy I'm going to discuss with you If you have experience in this kindly bid for this project Thanks
An Expert KBFX
30+ USD
Fill orders first execution and real time trading, my strategy is that wait for clean confirmation before entering the market and fill orders for a snappier entrance,then execute trade after making profit on the position
EA specifically for XAUUSD scalping
30 - 100 USD
I am looking for a professionally developed Buy Stop / Sell Stop EA specifically for XAUUSD scalping that has already proven to be profitable in the live market (real account), not just backtests or demo results . Requirements: • Strategy: Buy Stop / Sell Stop pending order–based scalping • Instrument: XAUUSD (Gold) • Performance: Verified live profitability with consistent results • Risk Management: Strong risk
Project Overview I am looking to acquire high-quality, algorithmic trading strategies or specialized strategy testers developed in MQL5 . My primary focus is on the underlying logic and code architecture rather than historical performance (Track Record/Myfxbook). I require full ownership of the source code (.mq5) for further research, optimization, and scaling. Requirements & Scope I am interested in systems that
MosesRobot
100+ USD
"I am looking for an expert developer to build a custom Forex Expert Advisor based on my specific strategy. Requirements: Full Source Code (.mq5) must be delivered. I retain 100% Intellectual Property and ownership of the bot. Must include a Risk Management module (Fixed Lot or % of balance). Must include a Trailing Stop and Break-even feature. Bot must be compatible with the MT5 Strategy Tester for 99% quality
I am searching for a fully developed and already profitable Expert Advisor focused on XAUUSD scalping. I am not looking for a custom build or experimental system. The EA must already be trading successfully on a real live account. What I am looking for: • At least 6 months of verified live results • Daily drawdown controlled within 10% • Around 13% or more average monthly return • Clean risk management approach with
// @version= 5 indicator ( "Gold Plus" , overlay = true , max_labels_count = 500 ) // ===== COLORS ===== buyColor = #00ff00 sellColor = #ff0000 smartBuy = #0099ff smartSell = #ff9900 // ===== INPUTS ===== sigsensiviti = input.float ( 2.5 , "Sensitivity" , group = "Main Settings" ) signaltype = input.string ( "All Signals" , "Signals" , [ "All Signals" , "Smart Signals" ] , group = "Main Settings" ) factor = 11
I need a custom MT5 trade copier that can copy trades from one master account to 10 slave accounts in real time. Some slave accounts may share the same broker, while others will be on different brokers. Requirements: Copy all trades from the master account to slave accounts: Entries Stop Loss (SL) Take Profit (TP) Trade modifications Trade closing Handle multiple currency pairs simultaneously. Risk management: Option
Proje bilgisi
Bütçe
100+ USD