⏱️ Urgent project – looking for an experienced developer to finalize MT4 bot (deadline: Tuesday)

指定

"""
Fast Multi-Pair RSI Trading Bot
Supports:
- BTCUSDT
- XAUUSD
- GBPUSD

Opens fast buy or sell trades based on RSI signals
Closes trades after 5, 10, or 15 minutes
"""

import asyncio
import time
from dataclasses import dataclass, field
from typing import Dict, List, Optional
import pandas as pd
import numpy as np

# ===== RSI calculation ===== #
def compute_rsi(close: pd.Series, period: int = 14) -> pd.Series:
    delta = close.diff()
    gain = delta.clip(lower=0)
    loss = -delta.clip(upper=0)
    avg_gain = gain.ewm(alpha=1 / period, adjust=False).mean()
    avg_loss = loss.ewm(alpha=1 / period, adjust=False).mean()
    rs = avg_gain / avg_loss
    return 100 - (100 / (1 + rs))

# ===== Position structure ===== #
@dataclass
class Position:
    id: str
    symbol: str
    side: str
    entry_price: float
    size: float
    opened_at: float
    duration_min: int

# ===== Config ===== #
@dataclass
class BotConfig:
    symbols: List[str] = field(default_factory=lambda: ["BTCUSDT", "XAUUSD", "GBPUSD"])
    rsi_period: int = 14
    rsi_oversold: int = 30
    rsi_overbought: int = 70
    durations_min: List[int] = field(default_factory=lambda: [5, 10, 15])
    account_equity: float = 2000.0
    risk_pct: float = 0.5
    lot_size: Optional[float] = None
    paper: bool = True

# ===== Trading Bot ===== #
class MultiPairRSIBot:
    def __init__(self, cfg: BotConfig):
        self.cfg = cfg
        self.data: Dict[str, pd.DataFrame] = {sym: pd.DataFrame() for sym in cfg.symbols}
        self.positions: Dict[str, Dict[str, Position]] = {sym: {} for sym in cfg.symbols}
        self._id = 0

    # ========== Fake 1-minute feed for PAPER mode ========== #
    def get_fake_ohlcv(self, symbol):
        now = int(time.time()) * 1000
        df = self.data[symbol]

        last_close = df["close"].iloc[-1] if not df.empty else 1000 + np.random.rand() * 10
        change = np.random.normal(0, 0.0008)
        close = last_close * (1 + change)
        high = max(last_close, close)
        low = min(last_close, close)

        return (now, last_close, high, low, close, 0)

    # ========== Append new candle ========== #
    def append_candle(self, symbol, ohlc):
        ts, o, h, l, c, v = ohlc
        row = {"timestamp": pd.to_datetime(ts, unit="ms"),
               "open": o, "high": h, "low": l, "close": c, "volume": v}
        self.data[symbol] = pd.concat([self.data[symbol], pd.DataFrame([row])], ignore_index=True)
        if len(self.data[symbol]) > 2000:
            self.data[symbol] = self.data[symbol].iloc[-2000:]

    # ========== Timeframe aggregation ========== #
    def to_tf(self, symbol, minutes):
        df = self.data[symbol]
        if df.empty:
            return pd.DataFrame()
        df["bucket"] = df["timestamp"].dt.floor(f"{minutes}T")
        out = df.groupby("bucket").agg({
            "open": "first",
            "high": "max",
            "low": "min",
            "close": "last",
            "volume": "sum"
        }).reset_index().rename(columns={"bucket": "timestamp"})
        return out

    # ========== Position sizing ========== #
    def get_size(self, price):
        if self.cfg.lot_size:
            return self.cfg.lot_size
        risk_amount = self.cfg.account_equity * (self.cfg.risk_pct / 100)
        return round(risk_amount / price, 4)

    # ========== Check RSI signals and enter trades ========== #
    async def process_signals(self, symbol):
        for dur in self.cfg.durations_min:
            df = self.to_tf(symbol, dur)
            if len(df) < self.cfg.rsi_period + 2:
                continue

            df["rsi"] = compute_rsi(df["close"], self.cfg.rsi_period)

            prev = df["rsi"].iloc[-2]
            last = df["rsi"].iloc[-1]
            price = df["close"].iloc[-1]

            # BUY: RSI cross up
            if prev <= self.cfg.rsi_oversold and last > prev:
                size = self.get_size(price)
                await self.open_position(symbol, "buy", price, size, dur)

            # SELL: RSI cross down
            if prev >= self.cfg.rsi_overbought and last < prev:
                size = self.get_size(price)
                await self.open_position(symbol, "sell", price, size, dur)

    # ========== Open position ========== #
    async def open_position(self, symbol, side, price, size, duration):
        self._id += 1
        pid = f"{symbol}_{self._id}"
        print(f"[{symbol}] OPEN {side.upper()} @ {price:.2f} | {duration}m | size {size}")

        pos = Position(
            id=pid,
            symbol=symbol,
            side=side,
            entry_price=price,
            size=size,
            opened_at=time.time(),
            duration_min=duration
        )
        self.positions[symbol][pid] = pos

    # ========== Close expired trades ========== #
    async def close_expired(self, symbol):
        now = time.time()
        to_close = []

        for pid, pos in self.positions[symbol].items():
            if (now - pos.opened_at) / 60 >= pos.duration_min:
                to_close.append(pid)

        for pid in to_close:
            await self.close_position(symbol, pid)

    # ========== Close position ========== #
    async def close_position(self, symbol, pid):
        pos = self.positions[symbol][pid]
        last_price = self.data[symbol]["close"].iloc[-1]
        pnl = (last_price - pos.entry_price) * pos.size if pos.side == "buy" else (pos.entry_price - last_price) * pos.size

        print(f"[{symbol}] CLOSE {pos.side.upper()} @ {last_price:.2f} | PnL = {pnl:.3f}")
        self.cfg.account_equity += pnl
        del self.positions[symbol][pid]

    # ========== Main loop ========== #
    async def start(self):
        print("Starting multi-pair RSI bot...")
        print("Symbols:", self.cfg.symbols)

        while True:
            try:
                for symbol in self.cfg.symbols:

                    # new candle
                    ohlcv = self.get_fake_ohlcv(symbol)
                    self.append_candle(symbol, ohlcv)

                    # signal scan
                    await self.process_signals(symbol)

                    # manage trades
                    await self.close_expired(symbol)

            except Exception as e:
                print("Error:", e)

            await asyncio.sleep(1)

# ========== Launch Example ========== #
async def main():
    cfg = BotConfig(
        symbols=["BTCUSDT", "XAUUSD", "GBPUSD"],
        account_equity=3000.0,
        paper=True,
        lot_size=None
    )
    bot = MultiPairRSIBot(cfg)

    task = asyncio.create_task(bot.start())
    await asyncio.sleep(60 * 5) # run 5 minutes demo
    task.cancel()

if __name__ == "__main__":
    asyncio.run(main())

反馈

1
开发者 1
等级
(635)
项目
1005
47%
仲裁
33
36% / 36%
逾期
99
10%
工作中
发布者: 6 代码
2
开发者 2
等级
(21)
项目
27
7%
仲裁
9
33% / 33%
逾期
1
4%
工作中
3
开发者 3
等级
(48)
项目
58
34%
仲裁
15
27% / 60%
逾期
1
2%
工作中
4
开发者 4
等级
(7)
项目
6
0%
仲裁
4
25% / 75%
逾期
2
33%
空闲
5
开发者 5
等级
(8)
项目
11
0%
仲裁
8
25% / 63%
逾期
2
18%
工作中
6
开发者 6
等级
(16)
项目
35
23%
仲裁
4
0% / 50%
逾期
2
6%
工作中
7
开发者 7
等级
(1)
项目
2
0%
仲裁
2
0% / 50%
逾期
0
空闲
8
开发者 8
等级
(2)
项目
2
0%
仲裁
0
逾期
0
空闲
9
开发者 9
等级
(17)
项目
21
14%
仲裁
8
38% / 38%
逾期
3
14%
已载入
10
开发者 10
等级
(611)
项目
711
33%
仲裁
45
49% / 42%
逾期
14
2%
工作中
11
开发者 11
等级
(22)
项目
29
34%
仲裁
4
50% / 25%
逾期
5
17%
工作中
12
开发者 12
等级
(4)
项目
3
33%
仲裁
2
0% / 100%
逾期
0
空闲
13
开发者 13
等级
(2672)
项目
3408
68%
仲裁
77
48% / 14%
逾期
342
10%
空闲
发布者: 1 代码
14
开发者 14
等级
(2)
项目
3
0%
仲裁
0
逾期
0
空闲
15
开发者 15
等级
(1)
项目
0
0%
仲裁
1
0% / 100%
逾期
0
空闲
16
开发者 16
等级
(1)
项目
1
100%
仲裁
0
逾期
0
空闲
17
开发者 17
等级
(258)
项目
267
30%
仲裁
0
逾期
3
1%
工作中
发布者: 2 代码
18
开发者 18
等级
(29)
项目
33
27%
仲裁
20
10% / 50%
逾期
11
33%
空闲
19
开发者 19
等级
(10)
项目
12
0%
仲裁
3
33% / 33%
逾期
1
8%
空闲
20
开发者 20
等级
(298)
项目
478
40%
仲裁
105
40% / 24%
逾期
82
17%
已载入
发布者: 2 代码
21
开发者 21
等级
项目
0
0%
仲裁
0
逾期
0
空闲
22
开发者 22
等级
项目
0
0%
仲裁
0
逾期
0
空闲
23
开发者 23
等级
项目
0
0%
仲裁
0
逾期
0
空闲
相似订单
I have an MT4 custom indicator (.ex4) that I use regularly, and I would like an identical MT5 version. Important: I do not have the source code (.mq4). I only have the compiled MT4 indicator. I am looking for an experienced MQL developer who can recreate the indicator's functionality and appearance for MT5 by analyzing its behavior. The MT5 version should match the MT4 version as closely as possible, including
Mac200 50+ USD
I need a Trend following Bot. Here we took entries by looking at two indicator which are 200 period ema and 12 26 9 MacD. Rules for entry exit are: Buy trade: When market is above 200 ema and MacD Line cross over the signal line and this cross over happened below the zero line of MacD indicator. We simply put Buy trade. Sell trade: When market is below 200 ema and MacD line crosses below the signal line and this
Iconic Boy 300 - 400 USD
Am looking for a bot to trade .so that I can be able to trade and become very successful and make some profit so that I cannot sleep on a empty stomach
I am looking for an experienced MQL5 developer who can help me convert my manual trading strategy into a fully automated Expert Advisor (EA) for MetaTrader 5. The project should begin with a detailed discussion of my manual trading strategy. Before starting the actual EA development, the developer must understand and analyze the complete trading logic and determine how the strategy can be converted into clear
Hello Traders and Investors, I am a professional algorithmic trading developer specialized in building high-quality Expert Advisors (EAs), Indicators, Scripts, and Trade Management Tools for MetaTrader 4 and MetaTrader 5. With extensive experience in financial markets and trading automation, I can transform your trading ideas into reliable and efficient solutions with clean, optimized, and well-structured code. My
Supply and Demand EA 50 - 250 USD
I need a SnD EA. Prefer coder who has previous experience coding SnD EA. PO are based on (CHoCH or BoS) and 3EMA, order block (from my TradingView indicator), area based on Fibonacci. SL options are based on fix pips or zone size; CL is based on candle closing. TP1 and TP2 options are based on fix pips or fix ratio. Canceling PO is based on market structure or Fibonacci. Money management are based on fix volume or
Hi MQL5 Community, With over 10 years of live market experience as a Quantitative & Trading System Developer, I specialize in building robust, highly scalable Expert Advisors (EAs), custom indicators, and automated architectures. I’ve recently put together a comprehensive showcase demonstrating my flagship Modular Multi-Engine Architecture , designed to bring institutional-grade logic and real-time telemetry into
I need a developer that can make my trading strategies into a working perfect EA Robot working on Mt5. Candlestick pattern confirmation through PDH, PDL, PWH, PWL, Liquidities, HTF OB
I need a trading bot specially for XAU, high profit gain. Requirements bot analyzes the market places trades closes with 2 to 3 profit per trades daily profit should be 50 to 100 dollars
Привіт. Шукаю когось, хто б застосував мій код як бота . Я торгую індексом Aus_200 SFE (не XJO). Бот базується на MACD входу/виходу, RSI, стохастиці та vwap. Як тільки роботу приймуть, мені потрібно внести кілька коректив; однак, нічого суттєвого. Дякую

项目信息

预算
50+ USD