Specifiche
//+------------------------------------------------------------------+
//| 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;
}
Con risposta
1
Valutazioni
Progetti
188
57%
Arbitraggio
10
80%
/
0%
In ritardo
0
Gratuito
Pubblicati: 1 codice
2
Valutazioni
Progetti
300
28%
Arbitraggio
33
24%
/
61%
In ritardo
9
3%
In elaborazione
3
Valutazioni
Progetti
38
21%
Arbitraggio
5
0%
/
60%
In ritardo
0
Gratuito
4
Valutazioni
Progetti
499
19%
Arbitraggio
33
42%
/
30%
In ritardo
32
6%
Caricato
5
Valutazioni
Progetti
20
10%
Arbitraggio
4
50%
/
50%
In ritardo
5
25%
Gratuito
6
Valutazioni
Progetti
621
53%
Arbitraggio
29
55%
/
24%
In ritardo
6
1%
Caricato
7
Valutazioni
Progetti
8
13%
Arbitraggio
3
0%
/
33%
In ritardo
2
25%
Gratuito
Pubblicati: 1 codice
8
Valutazioni
Progetti
13
23%
Arbitraggio
7
0%
/
71%
In ritardo
3
23%
In elaborazione
9
Valutazioni
Progetti
105
60%
Arbitraggio
0
In ritardo
0
Gratuito
10
Valutazioni
Progetti
6
17%
Arbitraggio
0
In ritardo
3
50%
Gratuito
11
Valutazioni
Progetti
2
0%
Arbitraggio
5
0%
/
80%
In ritardo
1
50%
Gratuito
12
Valutazioni
Progetti
134
66%
Arbitraggio
36
25%
/
56%
In ritardo
22
16%
Gratuito
Pubblicati: 10 codici
13
Valutazioni
Progetti
483
75%
Arbitraggio
5
80%
/
0%
In ritardo
0
In elaborazione
14
Valutazioni
Progetti
157
21%
Arbitraggio
23
9%
/
78%
In ritardo
16
10%
In elaborazione
15
Valutazioni
Progetti
619
33%
Arbitraggio
36
36%
/
53%
In ritardo
11
2%
Caricato
16
Valutazioni
Progetti
1
0%
Arbitraggio
1
0%
/
100%
In ritardo
0
Gratuito
17
Valutazioni
Progetti
0
0%
Arbitraggio
0
In ritardo
0
Gratuito
Pubblicati: 1 codice
18
Valutazioni
Progetti
81
43%
Arbitraggio
27
11%
/
70%
In ritardo
8
10%
Gratuito
19
Valutazioni
Progetti
0
0%
Arbitraggio
0
In ritardo
0
In elaborazione
Ordini simili
Modifiedea
30+ USD
Please my robot doesn’t open trades and I also believe it the ma crossover and others please I want the ma crossover to be fixed.also add trade directions to parameter for both, only sell, or only buys. Please also correct the balance drawdown and equity drawdown if it’s not working.the ea would be carefully tested for assessment l. Also source code will be handed before Payment. Only 30bucks for budget
I need an MT4/MT5 EA modification. Requirements: 1. Equity protection based on DAILY and TOTAL drawdown 2. Automatically close all trades when limit is hit 3. Disable trading after drawdown hit 4. Email notification when: - Daily loss limit reached - Total loss limit reached 5. EA must work on multiple accounts simultaneously 6. Clean and error-free code 7. Compatible with MT5 (or MT4 mention yours)
Profitable MT5 bot on XAUUSD
70+ USD
If you have profitable strategy or profitable EA on the gold pair without martingale / Hedge, then share me the EA with expiry time to back test and to test on the live market. Platform: MT5 pair: Gold Non-Martingale, No Hedging. Need Source Code
I have a working Python backtester for my “DC-WAD Donchian” strategy. I need a MetaTrader 5 Expert Advisor (MQL5) for live trading that matches the Python logic as closely as possible ( no lookahead ). ✅ Critical requirement (must accept) EA must be tick-driven for entries/exits (touch logic). Bar-close approximation is not acceptable . Timeframes Strategy runs on a single Setup Timeframe (HTF) (user input, e.g
EA-Halftrend-STRICT FILTER
50+ USD
This indicator will code into MT5 EA. Trade on live, demo and strategy tester. No repaint, no redraw and stable on chart. 1. Include all inputs variable and value, Lots size in points adjustable, TP in points true or false adjustable, SL in points true or false adjustable, close position on opposite signal true or false, Use pending order true or false, use BE points true or false, use slippage point true or false
I need mt4/mt5 EA Bot
30+ USD
can you help me with the strategy for my mt4 or mt5 bot? I am learning trading, while working and I was thinking this could be a good way to still earn from the market while learning. If I have someone like you to guide me on strategy and maintaining the trading bot going forward. I do not have anything setup, I am going to pay a ten to build the EA, I just need the mentorship and we can agree on a unique price to
Good day, I am searching the very high level expert, which could create the auto-trade robot and I would like to order the trading robot for GOLD XAU/USD auto-trade on MetaTrader. I could pay a lot for the institutional grade auto-trade robot, just contact me and let me know what level of the robot you could offer and we will negotiate the price
Looking to purchase a EA for Gold and US30 with source Requirements: must have proper built in Risk Management Must yield good profit factor and recovery Factor Must work on any Broker Must have less than 15% drawdown Year over Year Z-Score should be high Consecutive Profits Must Outweigh Consecutive losses atleast 3/1 Must be able to work on accounts from 100USD and up Testing must be based off of real Tick Values
Ready Made Ninjatrader
100+ USD
I’m looking for a NinjaTrader 8 developer to build or customize a fully automated futures strategy . Goals: Target ~$100/day (consistency over aggression) Long-term survivability (not scalping hype) Requirements: Trade ES/MES or NQ/MNQ Fixed risk per trade Daily profit & loss limits Time/session filters Break-even & trailing stop logic Full NT8 strategy (not indicator) Nice to have: Backtest + optimization
EA bot Fundednext prop firm
50 - 100 USD
Je cherche un développeur pour un bot Fundednext pour le passage de challenge jusqu'au trading quotidien après le passage.le robot va s'occuper du compte du début à la suite du compte de 15k chez Fundednext.après le passage aux challenges,le robot doit être capable de me fournir 6-10% mensuel de rendement de ce compte. Il doit être capable de passer le challenge dans un bref délai de 2-3 semaine ou soit 10-15 jours
Informazioni sul progetto
Budget
100+ USD