Specification
//+------------------------------------------------------------------+
//| 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;
}
Responded
1
Rating
Projects
133
43%
Arbitration
10
80%
/
0%
Overdue
0
Free
2
Rating
Projects
213
27%
Arbitration
11
27%
/
45%
Overdue
5
2%
Working
3
Rating
Projects
24
8%
Arbitration
1
0%
/
100%
Overdue
0
Free
4
Rating
Projects
405
18%
Arbitration
25
48%
/
28%
Overdue
23
6%
Busy
5
Rating
Projects
20
10%
Arbitration
3
67%
/
33%
Overdue
5
25%
Free
6
Rating
Projects
522
53%
Arbitration
25
56%
/
24%
Overdue
6
1%
Working
7
Rating
Projects
5
20%
Arbitration
1
0%
/
0%
Overdue
1
20%
Free
8
Rating
Projects
8
0%
Arbitration
5
0%
/
80%
Overdue
1
13%
Working
9
Rating
Projects
66
64%
Arbitration
0
Overdue
0
Working
10
Rating
Projects
1
0%
Arbitration
0
Overdue
1
100%
Working
11
Rating
Projects
2
0%
Arbitration
1
0%
/
0%
Overdue
1
50%
Free
12
Rating
Projects
134
66%
Arbitration
36
25%
/
56%
Overdue
22
16%
Free
13
Rating
Projects
399
71%
Arbitration
4
100%
/
0%
Overdue
0
Loaded
14
Rating
Projects
104
15%
Arbitration
4
25%
/
25%
Overdue
8
8%
Loaded
15
Rating
Projects
586
33%
Arbitration
32
41%
/
41%
Overdue
9
2%
Busy
16
Rating
Projects
0
0%
Arbitration
1
0%
/
100%
Overdue
0
Free
17
Rating
Projects
0
0%
Arbitration
0
Overdue
0
Free
18
Rating
Projects
78
44%
Arbitration
22
14%
/
64%
Overdue
8
10%
Free
Similar orders
ONE ORDER EXPERT ADVISOR MT5 (for STOCKS) - Magic number: - Max spread (points): - Max slippage (points): The EA open an order every day at an specific time: - Open Hour: - Open Min: The EA close the order every day at an specific time: - Close Hour: - Close Min: .............................................................................................................................. The orders will have a
Looking for Profitable Ready Made EA
30 - 40 USD
I am interested in purchasing profitable, ready-made Expert Advisors (EAs) for resale purposes. Below are the details of what I am looking for: Profitability: Proven track record of consistent performance with verified results over a minimum of 6 month . Compatibility: Works with MetaTrader 4/5 Ease of Use: User-friendly with minimal configuration required. Documentation: Includes a detailed user guide/manual
The EA is for renting, $1000 dollars for rent, 12 months access on multiple accounts license permission, granted 4 weeks trial before purchase, excludes source code, works on any brokers,works on $12 or more account capital, also for prop firm trading, access to guidance any time. On gold and on mt4
Coding mt4 and pine script code
30+ USD
Multi-Time Frame 50 EMA Cross Alert // Alert Condition for All Three Time Frames Aligning alertcondition(ma_15m_cross and ma_1h_cross and ma_4h_cross, title="50 EMA Cross All Time Frames", message="50 EMA crossed price on 15m, 1h, and 4h at the same time!")
Need to Integrate ATR Volatility with Signals Generated . Have a look at the picture attached , One of the condition is based on Moving Average Cross . NO Trading time (Filter) to be added : This will stop the expert to take any trades during the specified timings
Trade Opening Conditions: The EA will detect buy (green arrow) and sell (red arrow) signals from a specified custom indicator. Lot Size and Take Profit Configuration: Example of configurable lot sizes and associated take profits (TP): Entry 1: Lot size 0.20 – TP1 Entry 2: Lot size 0.30 – TP2 Entry 3: Lot size 0.20 – TP3 Entry 4: Lot size 0.10 – TP4 Entry 5: Lot size 0.50 – TP5 All trades should have their stop losses
serious inquires only must have at least 5 years of programming experience with C++ must be able to speak English well **meeting is required - to increase transparency ** simple breakout strategy
Price is not negotiable, 250USD is the max. I am looking for a developer with knowledge about SQL Databases, MQL5/MQL4, PHP and/or any website design. You will modify an already existing MT5 Expert advisor that will send data every X Seconds to the SQL database, and it will show on the website. The idea is one main admin dashboard where I can monitor all trading accounts with all the data included on the list below
I need a HIGH FREQUENCY TRADING (HFT) EA, that can be used to trade on live accounts of IC Market broker. The EA has to be highly profitable, giving a daily profit. Also, I want to set up a limit on the EA to avoid getting hyperactive ( According to MetaQuotes guidelines, an account is considered hyperactive when it exceeds 2,000 server messages per day.) I need something like this in this video;
MT5 EA
100 - 700 USD
We are in search for an MT5 EA that can work on small deposit accounts of capital minimum $200 (negotiable). The EA should be designed for our rebate/IB system of the brokers. We require the system to have enough operations completed by each day where the lots all add up to 0.50-1.00 lots each day. Its important the system is profitable as well and can scoop around 10-15% minimum gains each month. If you have
Project information
Budget
100+ USD
Customer
Placed orders1
Arbitrage count0