⏱️ 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
等级
(623)
项目
980
47%
仲裁
32
38% / 34%
逾期
96
10%
工作中
发布者: 6 代码
2
开发者 2
等级
(18)
项目
22
9%
仲裁
4
50% / 50%
逾期
1
5%
已载入
3
开发者 3
等级
(29)
项目
33
15%
仲裁
13
8% / 69%
逾期
0
繁忙
4
开发者 4
等级
(5)
项目
4
0%
仲裁
2
50% / 50%
逾期
2
50%
空闲
5
开发者 5
等级
(8)
项目
11
0%
仲裁
6
33% / 67%
逾期
2
18%
空闲
6
开发者 6
等级
(15)
项目
34
24%
仲裁
4
0% / 50%
逾期
2
6%
工作中
7
开发者 7
等级
(1)
项目
2
0%
仲裁
2
0% / 0%
逾期
0
工作中
8
开发者 8
等级
(2)
项目
2
0%
仲裁
0
逾期
0
空闲
9
开发者 9
等级
(15)
项目
18
6%
仲裁
8
38% / 38%
逾期
2
11%
工作中
10
开发者 10
等级
(540)
项目
621
33%
仲裁
36
39% / 53%
逾期
11
2%
繁忙
11
开发者 11
等级
(8)
项目
11
9%
仲裁
3
33% / 33%
逾期
4
36%
已载入
12
开发者 12
等级
(4)
项目
3
33%
仲裁
2
0% / 100%
逾期
0
空闲
13
开发者 13
等级
(2627)
项目
3339
67%
仲裁
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
等级
(248)
项目
254
30%
仲裁
0
逾期
3
1%
空闲
发布者: 2 代码
18
开发者 18
等级
(25)
项目
29
21%
仲裁
20
10% / 50%
逾期
8
28%
工作中
19
开发者 19
等级
(2)
项目
3
0%
仲裁
1
0% / 100%
逾期
0
工作中
20
开发者 20
等级
(294)
项目
470
39%
仲裁
102
40% / 24%
逾期
78
17%
繁忙
发布者: 2 代码
21
开发者 21
等级
项目
0
0%
仲裁
0
逾期
0
空闲
22
开发者 22
等级
项目
0
0%
仲裁
0
逾期
0
空闲
23
开发者 23
等级
项目
0
0%
仲裁
0
逾期
0
空闲
相似订单
BitsoFx 40 - 10000 USD
//+------------------------------------------------------------------+ //| Simple Robo Trader MT5 | //| Works on any pair & timeframe | //+------------------------------------------------------------------+ #property strict // Input settings input double LotSize = 0.01; input int FastMA = 10; input int SlowMA = 30; input int RSIPeriod = 14; input int StopLoss = 200; // in points input int TakeProfit = 400;// in
-I am looking for an experienced MQL5 developer to build a custom MT5 Expert Advisor based on a clear, rule-based trading logic. This project is focused on structure, discipline, and long-term robustness rather than aggressive or experimental approaches. The EA will be based on a single coherent logic and must follow strict execution rules, with clean and professional MQL5 code suitable for controlled testing and
Create an automated trading robot that can execute trades on my behalf without requiring manual intervention.The robot should be able to monitor market conditions, execute trades, manage risk, optimize performance
Должность: Пользовательский советник MT5 для стратегии пробоя максимумов/минимумов на свечных графиках. Описание/требования к должности: Здравствуйте! Мне нужен пользовательский советник (Expert Advisor, EA) для MetaTrader 5 , основанный на простой стратегии пробоя свечей. Советник должен строго соответствовать следующим правилам: 1. Условия покупки: Откройте ордер на покупку , когда текущая цена закроется выше
I will develop a custom MetaTrader 5 Expert Advisor based on the client’s provided trading rules. The EA will include proper entry and exit logic, stop loss and take profit handling and stable risk management. The code will be clean, non-repainting, MT5 compliant, and delivered with full source files. "Risk Disclosure : Trading in financial markets involves risk, and results depend on market conditions, broker
I need a professional developer to build a Telegram-to-MetaTrader trade copier system. Project overview: - A Telegram bot will read trade signals from a Telegram channel - Trades will be automatically executed on MT4 and/or MT5 accounts - The system must support copying trades to multiple MetaTrader accounts - Execution should work even when the user is offline Functional requirements: - Structured signal format
Nhân bản vô tính 30 - 70 USD
Tôi có 1 mt4 được chia sẻ, bạn có ai giúp tôi sao chép chiến lược của mỗi cái này không? Đặc biệt: _ phù hợp tài khoản vốn nhỏ _ vào nhiều lệnh _ không có tính năng né tin nhưng dù có tin ra thì vẫn giao dịch an toàn. I have an MT4 trading platform that was shared with me. Can anyone help me copy the trading strategies for each of these platforms? Specifically: _ Suitable for small capital accounts _ Allows for
I want recovery zone system to attach with any other ea on chart to manage per trade by zone recovery strategy with management of sl tp to cover in profits or neutral
Monthly >Previous month High and Low.High is Resistance and Low is Support level Daily > Demand and supply zones. Demand Below Support Level and Supply Above Resistance Level. 4HOUR >Up-Tren,Down-Trend and Cosolodation >Market Structure CHOCH,BOS >3 phase movement HH,HL and LL,LH. Entry
Hello great developers, I need a very fast and hardworking deliver who know both back end and front end of trade copier system. I need a web based trade copier application, i already create the website aspect, only need the copier to be included. I actually have a limited time, and no room for unprofessional developers, kindly send your applications if you can actually get it done in the space of 2 days and my budget

项目信息

预算
50+ USD