Create Code (python - Mql5 API) to Place and Close orders

MQL5 Sripts Diseño Python

Trabajo finalizado

Plazo de ejecución 1 día
Comentario del Ejecutor
Toxic client. The work is completed by the arbiter.

Tarea técnica

Hi

The objective of this job is to create or fix the next code (Mql5 APY Python) and be able to place orders base on the next conditions:

if:

pre == 0 do nothing

pre == 1 open long

pre == 2 close long

pre == 3 open short

pre == 4 close short


The way to validate the job is to implement the code in a JupyterLab notebook runing in a vps with windows and see the results when changing the pre values


In the next link you can find and copy the entire code: https://controlc.com/63fc1b87


On the next lines the code that I been working on but has an error and do not close the the orders, it open the order but it do not close them.... 


####### Order info symbol = "EURUSD" lot = 0.4 deviation = 20 ###### Clasification Model Predictions pre = 4 pre ##### Order info def send_order(symbol, lot, pre, position_id = None): if pre== 0: pass if pre==1 and position_id == None: request = { "action": mt5.TRADE_ACTION_DEAL, "symbol": symbol, "volume": lot, "type": mt5.ORDER_TYPE_BUY, "deviation": deviation, "magic": 100001, "comment": "EURUSD_5min", "type_time": mt5.ORDER_TIME_GTC, "type_filling": mt5.ORDER_FILLING_IOC} result = mt5.order_send(request) return result if pre==3 and position_id == None: request = { "action": mt5.TRADE_ACTION_DEAL, "symbol": symbol, "volume": lot, "type": mt5.ORDER_TYPE_SELL, "deviation": deviation, "magic": 100001, "comment": "EURUSD_5min", "type_time": mt5.ORDER_TIME_GTC, "type_filling": mt5.ORDER_FILLING_IOC} result = mt5.order_send(request) return result ############ Close Trades if pre==2 and position_id != None: request = { "position": position_id, "action": mt5.TRADE_ACTION_DEAL, "symbol": symbol, "volume": lot, "type": mt5.ORDER_TYPE_SELL, "deviation": deviation, "magic": 100001, "comment": "EURUSD_5min", "type_time": mt5.ORDER_TIME_GTC, "type_filling": mt5.ORDER_FILLING_IOC} result = mt5.order_send(request) return result if pre==4 and position_id != None: request = { "position": position_id, "action": mt5.TRADE_ACTION_DEAL, "symbol": symbol, "volume": lot, "type": mt5.ORDER_TYPE_BUY, "deviation": deviation, "magic": 100001, "comment": "EURUSD_5min", "type_time": mt5.ORDER_TIME_GTC, "type_filling": mt5.ORDER_FILLING_IOC} result = mt5.order_send(request) return result #### Placion Orders place_order = send_order(symbol, lot , pre) print(place_order) ##### Order Identification if len(mt5.positions_get()) != 0 : df_2 = mt5.positions_get() df_2 = pd.DataFrame(df_2) identifier = df_2.iat[0,7].astype(np.int64) elif len(mt5.positions_get()) == 0: identifier = None print(identifier) ##### Closing Orders close_order = send_order(symbol, lot, pre, position_id = identifier) print(close_order)


p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 13.0px 'Helvetica Neue'; color: #dca10d}

Han respondido

1
Desarrollador 1
Evaluación
(68)
Proyectos
78
27%
Arbitraje
13
31% / 62%
Caducado
15
19%
Libre
Ha publicado: 4 ejemplos
Solicitudes similares
Phahla fx boto 30+ USD
99.99% signal accuracy 10-15 trades distribution all currency trade and meta AI assistance on loss[advice] stop and start robot cyber security firewall protection activation code: 20060605TLP20 Please create a trading bot with any logo with the name elevation
Refine signal trigger execution . Optimize live chart performance . Ensure stable and clean code structure : Stable and clean code is important . Otherwise its a mess . Apply with as much accurate structure you foresee
Here is what I’m looking for: • Signal source: On-chain wallet address monitoring. I want to copy trade high win-rate meme coin wallets (smart money / profitable traders), not Telegram signals. • Market: Crypto (primarily meme coins). • Execution speed: Very important — I want as close to sub-second execution as possible. Low latency is a top priority. • Infrastructure: I’m open to self-hosted VPS or cloud setup if
This post is subject to developers response . Edit the post as you like . May be with me you can make a come back . So , , , Shift calculations . More to the calculation then you can comprehend is known . What else comes to your mind
I’m hiring an experienced MQL5 developer to finish and fix an existing project (NOT building from scratch). I have: An existing MT5 EA (.mq5 + .ex5) that is based on my TradingView logic A TradingView indicator version used for signals/alerts The EA works but has logic/consistency issues and needs improvements + cleanup Goal Make the EA reliable and consistent: Ensure entries/exits match the intended logic Fix
The indicator a bit inverted. But it doesn’t matter to me as long as the winrate make sense for investment. For brief details regarding the indicator. What should have been a sell, i inverted it into buy with sl and tp swapped(only change the name of sl and tp for visualisation , but the code still on right tp and sl) . And in script ive inverted the signal command code. But the trouble is the tp and sl cant be
Ai robot 30 - 50 USD
1️⃣ System Architecture An AI robot typically consists of the following subsystems: 🔹 1. Perception Layer Collects environmental data using: RGB / Depth cameras LiDAR Ultrasonic sensors IMUs (Inertial Measurement Units) Microphones Data is processed using: Computer Vision (e.g., object detection, SLAM) Signal processing Sensor fusion algorithms 🔹 2. Cognition / Intelligence Layer Implements AI models such as
Trailing Stop Based on Thresholds . Other Necessary Filters already Coded . Live Chart Only . The strategy already coded - needs a fresh new draft . To Start from Signal Trigger
What informtion would you need for Ninjatrader futures automated trading and how long would it take ? if anyone can give me answer i will be happy to discuss more about the project thanks fill free to bid to the project thanks
I’m seeking an experienced developer to create an AI-powered trading system integrated with MetaTrader 5. The scope includes delivering a fully functional MT5 module, an AI component a compatible language, and complete source code for both. This will focus exclusively on the core trading logic and AI integration UI elements or dashboards are not required. Apply only if you have proven experience with AI integrations

Información sobre el proyecto

Presupuesto
30 - 60 USD
Plazo límite de ejecución
de 1 a 2 día(s)