Volatility 100, print every 2 ticks - Python
Hi everybody,
I would like to make this code print every 2 ticks. However, when adding durations, the code does not read.
How can I print every 2 ticks?
import websocket import json def on_open(ws): json_data = json.dumps({'ticks':'R_100', 'duration': 2}) 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()
Tagged:
Comments
@luiz_hvac If you only want to print every second tick you will need to handle that in your code. There is no parameter that you can send to the API to only get ever second tick.
something like should work,