NESESITO QUE ME HAGAN UN BOT CON ESTA INFORMACION EN PYTON

MQL5 Esperti Python

Specifiche


NESESITO QUE ME HAGAN UN BOT CON ESTA INFORMACION EN PYTON 









mport ccxt

import pandas as pd
import numpy as np
import ta

# Configuración de la API
exchange = ccxt.binance()  # Cambia a tu exchange preferido
symbol = 'BTC/USDT'  # Activo a operar
timeframe = '1h'  # Marco temporal
risk_percentage = 0.02  # Riesgo por operación
stop_loss_percentage = 0.02  # 2% stop loss
take_profit_percentage = 0.04  # 4% take profit

# Función para obtener datos históricos
def get_historical_data(symbol, timeframe):
    bars = exchange.fetch_ohlcv(symbol, timeframe)
    df = pd.DataFrame(bars, columns=['timestamp', 'open', 'high', 'low', 'close', 'volume'])
    df['timestamp'] = pd.to_datetime(df['timestamp'], unit='ms')
    return df

# Función para calcular indicadores
def calculate_indicators(df):
    df['RSI'] = ta.momentum.RSIIndicator(df['close']).rsi()
    df['MACD'] = ta.trend.MACD(df['close']).macd()
    df['Signal'] = ta.trend.MACD(df['close']).macd_signal()
    df['OBV'] = ta.volume.OnBalanceVolumeIndicator(df['close'], df['volume']).on_balance_volume()
    df['Stochastic'] = ta.momentum.StochasticOscillator(df['high'], df['low'], df['close']).stoch()
    return df

# Estrategia de Trading
def strategy(df):
    last_row = df.iloc[-1]
    
    # Condiciones de compra
    if (last_row['RSI'] < 30) and (last_row['MACD'] > last_row['Signal']):
        return 'buy'
    
    # Condiciones de venta
    elif (last_row['RSI'] > 70) and (last_row['MACD'] < last_row['Signal']):
        return 'sell'
    
    return 'hold'

# Función de gestión de riesgo
def calculate_position_size(balance, risk_percentage):
    return balance * risk_percentage

# Función para ejecutar ordenes con stop loss y take profit
def execute_order(signal, position_size):
    market_price = exchange.fetch_ticker(symbol)['last']
    
    if signal == 'buy':
        # Ejecutar orden de compra
        order = exchange.create_market_order(symbol, 'buy', position_size)
        # Calcular niveles de stop loss y take profit
        stop_loss_price = market_price * (1 - stop_loss_percentage)
        take_profit_price = market_price * (1 + take_profit_percentage)
        
        # Establecer stop loss
        exchange.create_order(symbol, 'stop_market', 'sell', position_size, stop_loss_price)
        # Establecer take profit
        exchange.create_limit_order(symbol, 'sell', position_size, take_profit_price)

    elif signal == 'sell':
        # Ejecutar orden de venta
        order = exchange.create_market_order(symbol, 'sell', position_size)
        # Calcular niveles de stop loss y take profit
        stop_loss_price = market_price * (1 + stop_loss_percentage)
        take_profit_price = market_price * (1 - take_profit_percentage)
        
        # Establecer stop loss
        exchange.create_order(symbol, 'stop_market', 'buy', position_size, stop_loss_price)
        # Establecer take profit
        exchange.create_limit_order(symbol, 'buy', position_size, take_profit_price)

# Loop principal del bot
def run_bot():
    balance = exchange.fetch_balance()['total']['USDT']  # Ajusta según tu activo
    df = get_historical_data(symbol, timeframe)
    df = calculate_indicators(df)
    
    signal = strategy(df)
    
    if signal in ['buy', 'sell']:
        position_size = calculate_position_size(balance, risk_percentage)
        execute_order(signal, position_size)

# Ejecutar el bot
if _name_ == "_main_":
    run_bot()

Con risposta

1
Sviluppatore 1
Valutazioni
(183)
Progetti
314
24%
Arbitraggio
21
38% / 5%
In ritardo
24
8%
Gratuito
Pubblicati: 3 codici
2
Sviluppatore 2
Valutazioni
(1)
Progetti
1
0%
Arbitraggio
1
0% / 0%
In ritardo
0
Gratuito
Ordini simili
Busco un programador con experiencia comprobable en MQL5 para desarrollar un Expert Advisor (EA) basado en una estrategia mecánica, tendencial y totalmente objetiva , llamada M-act . La lógica está documentada en un brief técnico completo (adjunto en .docx) que incluye reglas claras de entrada, stop, gestión de riesgo y take profits. Nota: El documento técnico completo (M-act_EA_Brief) puede ser enviado por mensaje
Desarrollo de robot que opere estrategia crt con liquidez order block fvg . Riesgo fijo a porcentaje 1 r breakeven automático y trailing stop a 1r todo configurable horarios de trading días activos riesgo TP fijo o trailing stop % todo configurable utilización de entradas y configuración no Martín gala. Cantidad de operaciones abiertas a la vez . Drawdown máximo debe ser testeado a 0.60% riesgo con beneficios en
Deseo que desarrollen una EA para MT5, que opere orderblock y breaker de 5,15 y 60 minutos, que refine e identifique ademas los bos y chof en 1 minuto para que ejecute la operacion por confirmacion, y que detecte la tendencia

Informazioni sul progetto

Budget
30+ USD