Spezifikation

Un Bot qui est adapté pour l'androïde 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 

Dateien:

Ähnliche Aufträge
Rim crazzack 30 - 300 USD
Je souhaite développer un robot de trading automatique capable de fonctionner uniquement lorsque je suis connecté à mon compte de trading. Le robot devra respecter les règles suivantes : Il peut ouvrir positions que lorsque je suis connecté. Il doit analyser les marchés en temps réel sur les unités de temps M1 (1 minute), M5 (5 minutes) et M15 (15 minutes). Il doit identifier des opportunités d'achat ou de vente en

Projektdetails

Budget
30+ USD
Ausführungsfristen
bis 200 Tag(e)

Kunde

Veröffentlichte Aufträge3
Anzahl der Schlichtungen0