Specification
import MetaTrader5 as mt5
import datetime
import time
# Configure your trading symbols and parameters
TRADING_SYMBOLS = ["EURUSD", "USDJPY"]
TRADE_VOLUME = 0.1
STOP_LOSS = 50 # in points
TAKE_PROFIT = 100 # in points
# Initialize connection to MetaTrader 5
if not mt5.initialize():
print("Initialize() failed:", mt5.last_error())
quit()
def get_current_symbols():
now = datetime.datetime.now()
# If it's Saturday or Sunday between 9am and 9pm, only trade EUR/USD and USD/JPY
if now.weekday() == 5 or now.weekday() == 6: # Saturday = 5, Sunday = 6
if 9 <= now.hour < 21:
return ["EURUSD", "USDJPY"]
return TRADING_SYMBOLS
def get_position(symbol):
positions = mt5.positions_get(symbol=symbol)
return positions[0] if positions else None
def close_position(position):
order_type = mt5.ORDER_TYPE_SELL if position.type == mt5.ORDER_TYPE_BUY else mt5.ORDER_TYPE_BUY
close_request = {
"action": mt5.TRADE_ACTION_DEAL,
"symbol": position.symbol,
"volume": position.volume,
"type": order_type,
"position": position.ticket,
"price": mt5.symbol_info_tick(position.symbol).bid if order_type == mt5.ORDER_TYPE_BUY else mt5.symbol_info_tick(position.symbol).ask,
"deviation": 20,
"magic": 123456,
"comment": "Auto close loss",
"type_time": mt5.ORDER_TIME_GTC,
"type_filling": mt5.ORDER_FILLING_IOC,
}
result = mt5.order_send(close_request)
return result
def open_trade(symbol, order_type):
price = mt5.symbol_info_tick(symbol).ask if order_type == mt5.ORDER_TYPE_BUY else mt5.symbol_info_tick(symbol).bid
sl = price - STOP_LOSS * 0.0001 if order_type == mt5.ORDER_TYPE_BUY else price + STOP_LOSS * 0.0001
tp = price + TAKE_PROFIT * 0.0001 if order_type == mt5.ORDER_TYPE_BUY else price - TAKE_PROFIT * 0.0001
request = {
"action": mt5.TRADE_ACTION_DEAL,
"symbol": symbol,
"volume": TRADE_VOLUME,
"type": order_type,
"price": price,
"sl": sl,
"tp": tp,
"deviation": 20,
"magic": 123456,
"comment": "Auto trade",
"type_time": mt5.ORDER_TIME_GTC,
"type_filling": mt5.ORDER_FILLING_IOC,
}
result = mt5.order_send(request)
return result
def simple_strategy(symbol):
# Simple logic: open buy if price is above 50-MA
rates = mt5.copy_rates_from_pos(symbol, mt5.TIMEFRAME_M5, 0, 100)
if rates is None or len(rates) < 50:
return
closes = [bar.close for bar in rates]
ma50 = sum(closes[-50:]) / 50
last_close = closes[-1]
position = get_position(symbol)
if position:
# Close if loss is more than X points
profit = position.profit
if profit < -10: # Close if loss is more than $10
print(f"Closing loss on {symbol}")
close_position(position)
else:
if last_close > ma50:
print(f"Opening BUY trade for {symbol}")
open_trade(symbol, mt5.ORDER_TYPE_BUY)
elif last_close < ma50:
print(f"Opening SELL trade for {symbol}")
open_trade(symbol, mt5.ORDER_TYPE_SELL)
def main_loop():
try:
while True:
symbols = get_current_symbols()
for symbol in symbols:
simple_strategy(symbol)
time.sleep(60) # Wait 1 minute before checking again
except KeyboardInterrupt:
print("Bot stopped by user.")
finally:
mt5.shutdown()
if __name__ == "__main__":
main_loop()
Responded
1
Rating
Projects
551
40%
Arbitration
30
57%
/
3%
Overdue
57
10%
Working
Published: 11 codes
2
Rating
Projects
403
28%
Arbitration
40
40%
/
50%
Overdue
1
0%
Free
3
Rating
Projects
512
19%
Arbitration
33
45%
/
30%
Overdue
34
7%
Busy
4
Rating
Projects
24
8%
Arbitration
9
33%
/
33%
Overdue
1
4%
Loaded
5
Rating
Projects
460
26%
Arbitration
140
20%
/
59%
Overdue
100
22%
Working
6
Rating
Projects
15
20%
Arbitration
1
100%
/
0%
Overdue
0
Free
7
Rating
Projects
2
0%
Arbitration
4
25%
/
50%
Overdue
1
50%
Free
8
Rating
Projects
3
33%
Arbitration
2
0%
/
100%
Overdue
0
Free
9
Rating
Projects
9
22%
Arbitration
0
Overdue
0
Free
10
Rating
Projects
36
33%
Arbitration
5
0%
/
80%
Overdue
0
Working
Published: 2 codes
11
Rating
Projects
559
35%
Arbitration
80
31%
/
44%
Overdue
203
36%
Free
12
Rating
Projects
243
74%
Arbitration
7
100%
/
0%
Overdue
1
0%
Free
Published: 1 article
13
Rating
Projects
3
0%
Arbitration
1
100%
/
0%
Overdue
0
Free
Similar orders
Martingaling with trade cycle
30 - 50 USD
I want a martingale + moving average cross ea. The second trade must be taken when the step is met and the moving averages are crossing The ea must have a manual step input. A manual multiply input and manual moving average input
Project Overview We have a highly optimized, production-ready custom cTrader cBot built for a fast-paced Renko breakout strategy (specifically trading XAUUSD/Gold). The core system architecture, structural mapping, and breakout logic are flawless. We are seeking an expert C# algorithmic developer for a targeted engagement to refine the execution mechanics and add an advanced trade management module. This is not a
SNIPER X AI
30 - 200 USD
I really need a developer Who can help me to create my SNIPER X AI - Elite AI Trading System Overview SNIPER X AI BOT is an AI-assisted trading system for Forex, Crypto, Stocks, Indices, and Gold. Currency: USD,RAND,KWD, POUND,EURO Core Features AI Scalping, Sniper Entries, Auto Buy/Sell, Smart Risk Management, Telegram Alerts, Mobile Monitoring, VPS Deployment. Supported Platforms MetaTrader 4, MetaTrader 5, Exness
Emmanuel bot
30 USD
No thank you just choose for me I need to be automatically buy and sell and take a profit only that is enough for me thank you so much my name is Emmanuel kabale
Limzy
30+ USD
//+------------------------------------------------------------------+ //| HighPerformanceEA.mq5 | //| Copyright 2026, AI Developer | //| https://www.mql5.com | //+------------------------------------------------------------------+ #property copyright "Copyright 2026" #property link " https://www.mql5.com " #property version "1.00" #property strict //
I need an experienced MQL5 developer to build a professional XAUUSD scalping Expert Advisor. The trading logic is already fully defined and will be shared privately with selected developers. Requirements Fast execution suitable for scalping Dynamic lot sizing Strict risk management Clean and optimized MQL5 code Compatible with MetaTrader 5 Additional Rules No repainting logic No delayed execution Avoid duplicate
Prepare expert for xauusd live chart [ expert is not executing xauusd trades , just printing the logic on the chart ] . Deletion and cleaning code ( subject to if required ) . Integration of candles with present logic, Since expert is coming out from an arbitration subject : Before project start , review the code if it is clean and ready for the developer to continue with previous developer's technical debt -thereby
Hello, I am looking for an experienced developer who can build a professional EA suitable for long-term prop firm account passing and account management. I am NOT interested in risky strategies such as martingale, grid, or aggressive recovery systems. My main priorities are: very low and stable drawdown, strong and consistent risk management, strict news filter, long-term sustainability, realistic and stable monthly
Need a Profitable with a good trading system or strategy. would test the product first Looking for a professional MT5 Expert Advisor based on smart strategies. The EA should include session filters, risk management, trailing stop, multi-pair support, and low drawdown protection. I need a consistent, high-probability automated trading system optimized for long-term profitability and funded account compliance
Junior EA
30+ USD
1. EA for MT5, hedging allowed. 2. Entry: 50 EMA crosses 200 EMA on H1. Buy on bullish cross, sell on bearish. 3. SL: 100 pips, TP: 200 pips. No trailing stop. 4. Lot size: 0.01 fixed. Max 3 trades at once. 5. Trade only 08:00-18:00 GMT. No trades if spread > 20 points. 6. Inputs: EMA periods, SL, TP, lot size, start/end time
Project information
Budget
50 - 200 USD
Deadline
from 7 to 10 day(s)