code python script for run on MT5 by using MetaTrader for Python and JSON variable 1. get data bar using MetaTrader for Python get H1 bar information datetime,openprice,highprice,lowprice,closeprice,tickvolume 2. create JSON data with put variable datetime,openprice,highprice,lowprice,closeprice,tickvolume (using JSON template and replace varible to filed in JSON 3. post JSON to web service 4. get respond from web service return with JSON data 5. read JSON data (return from web service) convert to variable datetime,openprice,highprice,lowprice,closeprice,tickvolume import urllib2 # If you are using Python 3+, import urllib instead of urllib2 import json data = { "Inputs": { "input1": { "ColumnNames": ["PassengerClass", "Gender", "Age", "SiblingSpouse", "ParentChild", "FarePrice", "PortEmbarkation"], "Values": [ [ "1", "female", "0", "0", "0", "0", "C" ], [ "1", "female", "0", "0", "0", "0", "C" ], ] }, }, "GlobalParameters": { } } body = str.encode(json.dumps(data)) url = 'https://ussouthcentral.services.azureml.net/workspaces/852a506a05ab41868939caa8f97d3a57/services/c052c781636540b4a2530c5b753cb947/execute?api-version=2.0&details=true' api_key = 'abc123' # Replace this with the API key for the web service headers = {'Content-Type':'application/json', 'Authorization':('Bearer '+ api_key)} req = urllib2.Request(url, body, headers) try: response = urllib2.urlopen(req) # If you are using Python 3+, replace urllib2 with urllib.request in the above code: # req = urllib.request.Request(url, body, headers) # response = urllib.request.urlopen(req) result = response.read() print(result) except urllib2.HTTPError, error: print("The request failed with status code: " + str(error.code)) # Print the headers - they include the requert ID and the timestamp, which are useful for debugging the failure print(error.info()) print(json.loads(error.read()))