Initial commit setup with docker
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
import socketio
|
||||
import time
|
||||
|
||||
# Connect to the trading bot container
|
||||
sio = socketio.Client()
|
||||
# Replace with the appropriate URL and port of your trading bot container
|
||||
sio.connect('http://trading_bot:8000')
|
||||
|
||||
# Handle events from the trading bot container
|
||||
|
||||
|
||||
@sio.event
|
||||
def connect():
|
||||
print('Connected to trading bot container')
|
||||
|
||||
|
||||
@sio.event
|
||||
def disconnect():
|
||||
print('Disconnected from trading bot container')
|
||||
|
||||
|
||||
@sio.event
|
||||
def send_trade_signal(signal):
|
||||
print(f'Received trade signal: {signal}')
|
||||
# Process the trade signal and execute trades through MetaTrader 5
|
||||
|
||||
|
||||
# Main loop to keep the script running
|
||||
while True:
|
||||
time.sleep(1)
|
||||
Reference in New Issue
Block a user