Şartname
"""
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())
Yanıtlandı
1
Derecelendirme
Projeler
1007
47%
Arabuluculuk
33
36%
/
36%
Süresi dolmuş
99
10%
Çalışıyor
Yayınlandı: 6 kod
2
Derecelendirme
Projeler
28
7%
Arabuluculuk
9
33%
/
33%
Süresi dolmuş
1
4%
Çalışıyor
3
Derecelendirme
Projeler
64
39%
Arabuluculuk
15
27%
/
60%
Süresi dolmuş
1
2%
Çalışıyor
4
Derecelendirme
Projeler
6
0%
Arabuluculuk
4
25%
/
75%
Süresi dolmuş
2
33%
Serbest
5
Derecelendirme
Projeler
11
0%
Arabuluculuk
8
25%
/
75%
Süresi dolmuş
2
18%
Serbest
6
Derecelendirme
Projeler
35
23%
Arabuluculuk
4
0%
/
50%
Süresi dolmuş
2
6%
Çalışıyor
7
Derecelendirme
Projeler
2
0%
Arabuluculuk
2
0%
/
50%
Süresi dolmuş
0
Serbest
8
Derecelendirme
Projeler
2
0%
Arabuluculuk
0
Süresi dolmuş
0
Serbest
9
Derecelendirme
Projeler
22
18%
Arabuluculuk
9
33%
/
44%
Süresi dolmuş
3
14%
Çalışıyor
Yayınlandı: 1 kod
10
Derecelendirme
Projeler
722
33%
Arabuluculuk
46
48%
/
41%
Süresi dolmuş
14
2%
Yüklendi
11
Derecelendirme
Projeler
32
38%
Arabuluculuk
4
50%
/
25%
Süresi dolmuş
5
16%
Çalışıyor
12
Derecelendirme
Projeler
3
33%
Arabuluculuk
2
0%
/
100%
Süresi dolmuş
0
Serbest
13
Derecelendirme
Projeler
3414
68%
Arabuluculuk
77
48%
/
14%
Süresi dolmuş
342
10%
Serbest
Yayınlandı: 1 kod
14
Derecelendirme
Projeler
3
0%
Arabuluculuk
0
Süresi dolmuş
0
Serbest
15
Derecelendirme
Projeler
0
0%
Arabuluculuk
1
0%
/
100%
Süresi dolmuş
0
Serbest
16
Derecelendirme
Projeler
1
100%
Arabuluculuk
0
Süresi dolmuş
0
Serbest
17
Derecelendirme
Projeler
269
29%
Arabuluculuk
2
50%
/
0%
Süresi dolmuş
3
1%
Çalışıyor
Yayınlandı: 2 kod
18
Derecelendirme
Projeler
33
27%
Arabuluculuk
20
10%
/
50%
Süresi dolmuş
11
33%
Serbest
19
Derecelendirme
Projeler
12
0%
Arabuluculuk
3
33%
/
33%
Süresi dolmuş
0
Serbest
20
Derecelendirme
Projeler
478
40%
Arabuluculuk
105
40%
/
24%
Süresi dolmuş
82
17%
Yüklendi
Yayınlandı: 2 kod
21
Derecelendirme
Projeler
0
0%
Arabuluculuk
0
Süresi dolmuş
0
Serbest
22
Derecelendirme
Projeler
0
0%
Arabuluculuk
0
Süresi dolmuş
0
Serbest
23
Derecelendirme
Projeler
0
0%
Arabuluculuk
0
Süresi dolmuş
0
Serbest
Benzer siparişler
MQL5 Developer
30+ USD
📄 وثيقة المواصفات الفنية لروبوت التداول (MQL5 EA Specification) 📌 1. ملخص المشروع والهدف * اسم المشروع: Gold Cent Grid-Hedge EA * المنصة: MetaTrader 5 (MQL5) * أداة التداول: الذهب (XAUUSD) * نوع الحساب: حساب سنت (Cent Account) * فكرة الاستراتيجية: تداول شبكة هيدج متوازنة (Grid-Hedging) تفتح صفقات تعزيز كل مسافة محددة، وتغلق الطرف الأكثر ربحاً عند تحقيق هدف مالّي مجمع بالدولار/السنت لإعادة هيكلة التوازن. ⚙️ 2
Converting MT4 to MT5
30+ USD
Hi developer I want to convert my mt4 EA to mt5 EA . I have a mt4 ea with source code. i want developer to copy same mt4 code and create mt5 EA
Gold hunter v5
30+ USD
*TITLE:* 5 Trades EA - EMA20/50 + RSI - Safe for Small Account *SPECIFICATION:* I need MT5 EA - Source Code .mq5 *Logic:* Buy: EMA20 > EMA50 and RSI(14) 45-70 Sell: EMA20 < EMA50 and RSI(14) 30-55 Timeframe M15, Symbol XAUUSD and all Forex *Trade Management:* Max 5 trades at same time. Fixed lot 0.01. No martingale. No lot increase. Distance between trades 150 points. Do not open all 5 at same price. Max 5 total
I need an Expert Advisor (EA) developed for MetaTrader 5 (MT5) tailored for trading on Exness accounts. Account & Server Details: Trading Platform: MetaTrader 5 (MT5) Broker: Exness Execution Type: Market / Pending Orders Account Type: [Specify: Standard / Pro / Raw Spread / Zero] Target Instruments: [Specify pairs, e.g., XAUUSD, EURUSD, BTCUSD] Strategy Requirements: Entry Rules: [Insert your buy/sell entry
Monthly Report: August 2026 World PEACE Multi FX Algo generated a total realized profit of approximately 31,966 JPY during August. The provider account is normally operated with approximately 200,000 JPY of capital. Compared with this standard operating amount, the realized profit for August was approximately 15.98%. Please note that this is not a compounded monthly return. Realized profits are withdrawn regularly
MARTINGALE TRADING BOT (AND STRATEGY OPTIMIZED SETFILES)
500 - 1000 USD
I’m looking for an experienced developer who can build a Martingale trading bot. I’m willing to pay a fair price for the right developer. I have an example trading account that demonstrates exactly how I want the bot to operate. The strategy is straightforward: the bot trades continuously using a Martingale system. The only exception is that it should automatically pause trading during high-impact news events or
This is a Tradingview project. Would you be able to make this? With a win rate and profit factor and percentage made and profit made and max dd reached. How many modifications would I be able to do? Could there be a table that shows win percentage profit factor and trading window where trades shouldn’t be placed and follows the rules of the pdf How long would it take and would it work on ninjatrader also
Account size 50$ to 100$ or 5000USC to 10000USC ( Account $ Size may not matter ) Max Leverage 1000-2000 Min Lot 0.01 [ if averaging possible ] Averaging + Shift TP Faster Required if Trend Direction is Clear Account Protection Maxx Profit Max Loss Key Based Activation News Filter Need Expert to handle this to avoid false entry [ Developer can suggest extra additional filters inputs here ] as i mentioned I have no
Build a Forex Multi-Basket Trading Bot for OANDA (Python v20 REST API Only) MANDATORY DEVELOPER REQUIREMENTS (PLEASE READ BEFORE APPLYING): Do not apply for this project unless you meet the following strict professional criteria: 1. Deep Mathematical & Quantitative Background: You must thoroughly understand statistical distributions, rolling standard deviations (σ), calculating matrix medians, and dynamic Z-score
I need an AI based mt5 EA which self learns and improves on its previous mistakes. The EA must be able to utilize numerous trade set ups like; 1. CRT, 2. liquidity sweep reversal at selected higher timeframe where a candle sweeps previous candle high and closes lower or sweeps previous candle low and closes higher, 3. SMC where it trades on OB, CHoCH, BOS. 4. Support and resistance. It should trade any currency pair
Proje bilgisi
Bütçe
50+ USD