Bot fils

Python Asesores Expertos Python

Tarea técnica

import MetaTrader5 as mt5
import time
import pandas as pd

mt5.initialize()

SYMBOL = "EURUSD"
MAX_SPREAD = 0.00008 # 0.8 pip

def is_good_market():
    tick = mt5.symbol_info_tick(SYMBOL)
    spread = tick.ask - tick.bid
    if spread > MAX_SPREAD:
        print(f"Spread trop haut: {spread} - SKIP")
        return False
    return True

def get_trend():
    rates = mt5.copy_rates(SYMBOL, mt5.TIMEFRAME_M1, 0, 250)
    df = pd.DataFrame(rates)
    df['ema20'] = df['close'].ewm(span=20).mean()
    df['ema200'] = df['close'].ewm(span=200).mean()
    last = df.iloc[-1]
    return "BUY" if last['ema20'] > last['ema200'] else "SELL"

while True:
    if is_good_market():
        trend = get_trend()
        if trend == "BUY":
            request = {
                "action": mt5.TRADE_ACTION_DEAL,
                "symbol": SYMBOL,
                "volume": 0.01,
                "type": mt5.ORDER_TYPE_BUY,
                "price": mt5.symbol_info_tick(SYMBOL).ask,
                "sl": mt5.symbol_info_tick(SYMBOL).ask - 0.0010,
                "tp": mt5.symbol_info_tick(SYMBOL).ask + 0.0005,
                "deviation": 10,
            }
            mt5.order_send(request)
            time.sleep(60) # 1 trade par minute max - règle HFT retail
    time.sleep(0.1) # check chaque 100ms

Archivos adjuntos:

Han respondido

1
Desarrollador 1
Evaluación
Proyectos
0
0%
Arbitraje
0
Caducado
0
Libre
2
Desarrollador 2
Evaluación
(550)
Proyectos
838
61%
Arbitraje
33
27% / 45%
Caducado
24
3%
Libre
Ha publicado: 1 ejemplo
Solicitudes similares
Bonjour, Je recherche un développeur expérimenté en Python + MetaTrader5 pour créer un Bot Scanner. OBJECTIF DU BOT: Scanner n'importe quel graphique MT5 : Forex, Indices Synthétiques, Indices, Actions, Métaux, Crypto. Détecter uniquement des FIGURES CHARTISTES sans indicateur. Envoyer une alerte instantanée sur Telegram ou par mails avec : Paire, Timeframe, Nom de la Figure, fiabilité en % , Capture d'écran du

Información sobre el proyecto

Presupuesto
35+ USD
Plazo límite de ejecución
de 1 a 50 día(s)

Cliente

Encargos realizados2
Número de arbitrajes0