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

Tarea técnica

"""
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())

Han respondido

1
Desarrollador 1
Evaluación
(626)
Proyectos
984
47%
Arbitraje
33
36% / 36%
Caducado
97
10%
Trabaja
Ha publicado: 6 ejemplos
2
Desarrollador 2
Evaluación
(18)
Proyectos
22
9%
Arbitraje
6
33% / 50%
Caducado
1
5%
Trabaja
3
Desarrollador 3
Evaluación
(39)
Proyectos
44
25%
Arbitraje
13
8% / 69%
Caducado
1
2%
Ocupado
4
Desarrollador 4
Evaluación
(6)
Proyectos
5
0%
Arbitraje
2
50% / 50%
Caducado
2
40%
Libre
5
Desarrollador 5
Evaluación
(8)
Proyectos
11
0%
Arbitraje
7
29% / 71%
Caducado
2
18%
Libre
6
Desarrollador 6
Evaluación
(16)
Proyectos
35
23%
Arbitraje
4
0% / 50%
Caducado
2
6%
Trabaja
7
Desarrollador 7
Evaluación
(1)
Proyectos
2
0%
Arbitraje
2
0% / 50%
Caducado
0
Libre
8
Desarrollador 8
Evaluación
(2)
Proyectos
2
0%
Arbitraje
0
Caducado
0
Libre
9
Desarrollador 9
Evaluación
(16)
Proyectos
19
11%
Arbitraje
8
38% / 38%
Caducado
2
11%
Trabajando
10
Desarrollador 10
Evaluación
(550)
Proyectos
637
33%
Arbitraje
41
41% / 46%
Caducado
11
2%
Ocupado
11
Desarrollador 11
Evaluación
(12)
Proyectos
16
13%
Arbitraje
4
50% / 25%
Caducado
4
25%
Trabaja
12
Desarrollador 12
Evaluación
(4)
Proyectos
3
33%
Arbitraje
2
0% / 100%
Caducado
0
Libre
13
Desarrollador 13
Evaluación
(2644)
Proyectos
3360
68%
Arbitraje
77
48% / 14%
Caducado
342
10%
Libre
Ha publicado: 1 ejemplo
14
Desarrollador 14
Evaluación
(2)
Proyectos
3
0%
Arbitraje
0
Caducado
0
Libre
15
Desarrollador 15
Evaluación
(1)
Proyectos
0
0%
Arbitraje
1
0% / 100%
Caducado
0
Libre
16
Desarrollador 16
Evaluación
(1)
Proyectos
1
100%
Arbitraje
0
Caducado
0
Libre
17
Desarrollador 17
Evaluación
(253)
Proyectos
259
30%
Arbitraje
0
Caducado
3
1%
Libre
Ha publicado: 2 ejemplos
18
Desarrollador 18
Evaluación
(25)
Proyectos
29
21%
Arbitraje
20
10% / 50%
Caducado
8
28%
Trabaja
19
Desarrollador 19
Evaluación
(4)
Proyectos
5
0%
Arbitraje
1
0% / 100%
Caducado
1
20%
Libre
20
Desarrollador 20
Evaluación
(295)
Proyectos
474
39%
Arbitraje
103
41% / 23%
Caducado
79
17%
Ocupado
Ha publicado: 2 ejemplos
21
Desarrollador 21
Evaluación
Proyectos
0
0%
Arbitraje
0
Caducado
0
Libre
22
Desarrollador 22
Evaluación
Proyectos
0
0%
Arbitraje
0
Caducado
0
Libre
23
Desarrollador 23
Evaluación
Proyectos
0
0%
Arbitraje
0
Caducado
0
Libre
Solicitudes similares
Hello, I am looking for an experienced MT5 (MetaTrader 5) developer to create a simple and reliable Forex trading EA. Broker: Skyriss Platform: MT5 Requirements: • EA should work only on Forex pairs (EURUSD, GBPUSD, USDJPY, USDCHF) • Around 1–2 trades per day is enough • Proper risk management with Stop Loss (SL) and Take Profit (TP) • Prefer low-risk trading with 0.01–0.03 lot depending on balance • No martingale or
Looking for an experienced MQL5 developer to optimise and backtest my Expert Advisor (EA). The full requirements and EA file will be shared once accepted. You should have solid experience with strategy testing in MetaTrader 5 and be comfortable working with custom EAs. If this sounds like something you can help with, feel free to reach out and we can get started Developers with no reviews and no projects will be
hello, please take a moment to review my project. It is for Quanttower. it is very detailed in the instructions. Thank you, Just let me know if you can do it and the whats the cost and timeframe
Key Requirements: Source Account: Connect to a Master account using Investor (Read-only) Password. Destination Account: Execute trades on a Live Slave account with full trading access. Currency Focus: The system must handle Currency Pairs accurately, including symbol mapping (e.g., EURUSD to EURUSD.m) between different brokers. Stealth Features: Remove/Disable all trade comments. Assign custom Magic Numbers to the
I need a developer to start robot from scratch based on existing EA that is running live. I do not have the source file as my previous coder did not give it to me. What I do have is the investor password which is running the EA from the coder side but not from my end. I like someone to monitor the account and re create the same system for me
Project Overview: I am looking for a highly experienced MetaTrader 4 (MQL4) developer to build a sophisticated automated trading system. This is not a standard grid bot; it requires complex trade management, dynamic exposure rebalancing, and a custom "Salami" liquidation module for partial loss mitigation . Key Features to Implement: Virtual Grid & Dynamic Trend: Price-action-based grid triggers without pending
We are looking for a professional developer or trader who already has a proven profitable EA or strategy based mainly on price action logic. Important requirements: No Martingale No Grid No Micro-scalping Avoid heavy indicator-based strategies Strategy should be based mainly on price behavior / market structure We are not looking for aggressive systems that promise unrealistic returns. Our focus is on stable
I run an ea it makes good profits bit that one bad grid blows up the account. I want an EA which runs parallel to it which can intelligently close bad trades or grids. It shouldn't close recoverable trades but close very bad entries and grids. It can even close with hedging. The goal recover max and also not blow up the account
I am looking for an expert MQL5 developer to build a high-precision Hedging System between two different MT5 brokers running on the same local PC. Core Objective: Execute opposite (inverse) trades between a Master and Slave account (e.g., Master BUY = Slave SELL, Master SELL = Slave BUY). The Challenge: Standard "Trade Copiers" are insufficient as they cannot prevent single-legged exposure when using manual trading
I want robot that can help me trade and make some money so that I can be able to learn from it while I'm still in depot account now.Is how it gonna help me with some money

Información sobre el proyecto

Presupuesto
50+ USD