Can anyone put a sample Python based bot code?

I wanted to know how to process the json data & display in the plot after following code:

import websocket
import json

def on_open(ws):
json_data = json.dumps({'ticks':'R_100'})
ws.send(json_data)

def on_message(ws, message):
print('ticks update: %s' % message)

if name == "main":
apiUrl = "wss://ws.binaryws.com/websockets/v3?app_id=1089"
ws = websocket.WebSocketApp(apiUrl, on_message = on_message, on_open = on_open)
ws.run_forever()

Can anyone provide , explain with sample code?

Comments

Sign In or Register to comment.