-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathutility.py
79 lines (66 loc) · 25.5 KB
/
utility.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
import time
import datetime
import json
import matplotlib.pylab as plt
import config
class utility():
# input date fromat is like 2010/12/01
@staticmethod
def parse_date(date):
return int(time.mktime(datetime.datetime.strptime(date, "%Y/%m/%d").timetuple()))
@staticmethod
def timestamp_to_date(timestamp):
return datetime.datetime.utcfromtimestamp(timestamp).strftime("%Y/%m/%d")
@staticmethod
def timeframe_to_timestamp():
timestamp = 0
timeframe = config.TIMEFRAME
if timeframe=="1":
timestamp = 1*60
elif timeframe=="5":
timestamp = 5*60
elif timeframe=="10":
timestamp = 10*60
elif timeframe=="30":
timestamp = 30*60
elif timeframe=="H":
timestamp = 60*60
elif timeframe=="D":
timestamp = 60*24*60
return timestamp
@staticmethod
def analyze_profit(trades, money):
money_change,time_change = money
money_change = [x for _, x in sorted(zip(time_change,money_change), key=lambda pair: pair[0])]
time_change = sorted(time_change)
final_money_change_list = []
final_money_change = 1000
for i in range(len(time_change)):
time_change[i] = utility().timestamp_to_date(time_change[i])
final_money_change += money_change[i]*100
final_money_change_list.append(final_money_change)
total_profit = 0
total_trade_num = 0
for trade_name, trade in trades.items():
if trade.num!=0:
total_profit += trade.profit
total_trade_num += trade.num
print(trade_name + " " + "number of trades: " + str(trade.num) + ", profit: " + str(trade.profit))
print("total profit = " + str(total_profit) + ", total number of trade = " + str(total_trade_num))
plt.plot(time_change, final_money_change_list)
plt.show()
@staticmethod
def get_all_pairs_list(pairs_json=None):
pairs = '''[{"description": "FXPRO Canadian Dollar vs Swiss Franc CADCHF", "displaySymbol": "CAD/CHF", "symbol": "FXPRO:1061"}, {"description": "FXPRO Silver Ounce vs Euro XAGEUR", "displaySymbol": "XAG/EUR", "symbol": "FXPRO:1109"}, {"description": "FXPRO Silver Ounce vs US Dollar XAGUSD", "displaySymbol": "XAG/USD", "symbol": "FXPRO:42"}, {"description": "FXPRO Gold Ounce vs Euro XAUEUR", "displaySymbol": "XAU/EUR", "symbol": "FXPRO:1108"}, {"description": "FXPRO Australian Dollar vs Canadian Dollar AUDCAD", "displaySymbol": "AUD/CAD", "symbol": "FXPRO:18"}, {"description": "FXPRO Gold Ounce vs US Dollar XAUUSD", "displaySymbol": "XAU/USD", "symbol": "FXPRO:41"}, {"description": "FXPRO Gold Grams vs US Dollar XAUUSDgr", "displaySymbol": "GAU/USD", "symbol": "FXPRO:1110"}, {"description": "FXPRO Australia 200 Spot Index #AUS200", "displaySymbol": "ASX200/AUD", "symbol": "FXPRO:1274"}, {"description": "FXPRO Platinum Ounce vs US Dollar XPTUSD", "displaySymbol": "XPT/USD", "symbol": "FXPRO:1297"}, {"description": "FXPRO BitcoinCash vs US Dollar BCHUSD", "displaySymbol": "BCH/USD", "symbol": "FXPRO:1314"}, {"description": "FXPRO Canadian Dollar vs Japanese Yen CADJPY", "displaySymbol": "CAD/JPY", "symbol": "FXPRO:15"}, {"description": "FXPRO Australian Dollar vs Swiss Franc AUDCHF", "displaySymbol": "AUD/CHF", "symbol": "FXPRO:1038"}, {"description": "FXPRO Euro Stoxx 50 Spot Index #Euro50", "displaySymbol": "Euro50/EUR", "symbol": "FXPRO:1103"}, {"description": "FXPRO Bitcoin vs US Dollar BTCUSD", "displaySymbol": "BTC/USD", "symbol": "FXPRO:1310"}, {"description": "FXPRO Swiss Franc vs Japanese Yen CHFJPY", "displaySymbol": "CHF/JPY", "symbol": "FXPRO:13"}, {"description": "FXPRO Australian Dollar vs Danish Krone AUDDKK", "displaySymbol": "AUD/DKK", "symbol": "FXPRO:1289"}, {"description": "FXPRO Brent (UK) Spot Oil BRENT", "displaySymbol": "XBR/USD", "symbol": "FXPRO:1117"}, {"description": "FXPRO France CAC 40 Spot Index #France40", "displaySymbol": "France40/EUR", "symbol": "FXPRO:1104"}, {"description": "FXPRO FTSE China A50 Spot Index #ChinaA50", "displaySymbol": "ChinaA50/USD", "symbol": "FXPRO:1100"}, {"description": "FXPRO Ethereum vs US Dollar ETHUSD", "displaySymbol": "ETH/USD", "symbol": "FXPRO:1311"}, {"description": "FXPRO Euro vs Canadian Dollar EURCAD", "displaySymbol": "EUR/CAD", "symbol": "FXPRO:17"}, {"description": "FXPRO Australian Dollar vs Japanese Yen AUDJPY", "displaySymbol": "AUD/JPY", "symbol": "FXPRO:11"}, {"description": "FXPRO Germany 30 (DAX) Spot Index #Germany30", "displaySymbol": "Germany30/EUR", "symbol": "FXPRO:1106"}, {"description": "FXPRO China H Shares Spot Index #ChinaHShar", "displaySymbol": "China_HShar/HKD", "symbol": "FXPRO:1115"}, {"description": "FXPRO Litecoin vs US Dollar LTCUSD", "displaySymbol": "LTC/USD", "symbol": "FXPRO:1312"}, {"description": "FXPRO Euro vs Swiss Franc EURCHF", "displaySymbol": "EUR/CHF", "symbol": "FXPRO:10"}, {"description": "FXPRO Australian Dollar vs New Zealand Dollar AUDNZD", "displaySymbol": "AUD/NZD", "symbol": "FXPRO:1060"}, {"description": "FXPRO Japan 225 Spot Index #Japan225", "displaySymbol": "Japan225/USD", "symbol": "FXPRO:1293"}, {"description": "FXPRO France 120 Spot Index #France120", "displaySymbol": "France120/EUR", "symbol": "FXPRO:1098"}, {"description": "FXPRO Ripple vs US Dollar XRPUSD", "displaySymbol": "XRP/USD", "symbol": "FXPRO:1315"}, {"description": "FXPRO Euro vs British Pound EURGBP", "displaySymbol": "EUR/GBP", "symbol": "FXPRO:9"}, {"description": "FXPRO Australian Dollar vs Polish Zloty AUDPLN", "displaySymbol": "AUD/PLN", "symbol": "FXPRO:1290"}, {"description": "FXPRO FTSE 100 Spot Index #UK100", "displaySymbol": "UK100/GBP", "symbol": "FXPRO:1105"}, {"description": "FXPRO Germany Technology 30 Spot Index #GerTech30", "displaySymbol": "GerTech30/EUR", "symbol": "FXPRO:1093"}, {"description": "FXPRO Euro vs Japanese Yen EURJPY", "displaySymbol": "EUR/JPY", "symbol": "FXPRO:3"}, {"description": "FXPRO Australian Dollar vs Singapore Dollar AUDSGD", "displaySymbol": "AUD/SGD", "symbol": "FXPRO:1085"}, {"description": "FXPRO US Dow Jones 30 Spot Index #US30", "displaySymbol": "US30/USD", "symbol": "FXPRO:1287"}, {"description": "FXPRO Germany 50 Mid Cap Spot Index #Germany50", "displaySymbol": "Germany50/EUR", "symbol": "FXPRO:1096"}, {"description": "FXPRO Euro vs US Dollar EURUSD", "displaySymbol": "EUR/USD", "symbol": "FXPRO:1"}, {"description": "FXPRO Australian Dollar vs US Dollar AUDUSD", "displaySymbol": "AUD/USD", "symbol": "FXPRO:5"}, {"description": "FXPRO US Nasdaq 100 Spot Index #USNDAQ100", "displaySymbol": "US_NDAQ100/USD", "symbol": "FXPRO:1107"}, {"description": "FXPRO British Pound vs Canadian Dollar GBPCAD", "displaySymbol": "GBP/CAD", "symbol": "FXPRO:1040"}, {"description": "FXPRO Swiss Franc vs Polish Zloty CHFPLN", "displaySymbol": "CHF/PLN", "symbol": "FXPRO:1086"}, {"description": "FXPRO US S&P 500 Spot Index #USSPX500", "displaySymbol": "USSPX500/USD", "symbol": "FXPRO:1288"}, {"description": "FXPRO Netherlands 25 Spot Index #Holland25", "displaySymbol": "Holland25/EUR", "symbol": "FXPRO:1094"}, {"description": "FXPRO British Pound vs Swiss Franc GBPCHF", "displaySymbol": "GBP/CHF", "symbol": "FXPRO:40"}, {"description": "FXPRO Swiss Franc vs Singapore Dollar CHFSGD", "displaySymbol": "CHF/SGD", "symbol": "FXPRO:1291"}, {"description": "FXPRO Hong Kong 50 Spot Index #HongKong50", "displaySymbol": "HongKong50/HKD", "symbol": "FXPRO:1114"}, {"description": "FXPRO British Pound vs Japanese Yen GBPJPY", "displaySymbol": "GBP/JPY", "symbol": "FXPRO:7"}, {"description": "FXPRO Euro vs Australian Dollar EURAUD", "displaySymbol": "EUR/AUD", "symbol": "FXPRO:14"}, {"description": "FXPRO British Pound vs US Dollar GBPUSD", "displaySymbol": "GBP/USD", "symbol": "FXPRO:2"}, {"description": "FXPRO Euro vs Czech Koruna EURCZK", "displaySymbol": "EUR/CZK", "symbol": "FXPRO:1080"}, {"description": "FXPRO US Dollar vs Canadian Dollar USDCAD", "displaySymbol": "USD/CAD", "symbol": "FXPRO:8"}, {"description": "FXPRO Euro vs Danish Krone EURDKK", "displaySymbol": "EUR/DKK", "symbol": "FXPRO:1062"}, {"description": "FXPRO US Dollar vs Swiss Franc USDCHF", "displaySymbol": "USD/CHF", "symbol": "FXPRO:6"}, {"description": "FXPRO Euro vs Hong Kong Dollar EURHKD", "displaySymbol": "EUR/HKD", "symbol": "FXPRO:1051"}, {"description": "FXPRO Spain 35 Spot Index #Spain35", "displaySymbol": "Spain35/EUR", "symbol": "FXPRO:1285"}, {"description": "FXPRO US Dollar vs Japanese Yen USDJPY", "displaySymbol": "USD/JPY", "symbol": "FXPRO:4"}, {"description": "FXPRO Euro vs Hungarian Forint EURHUF", "displaySymbol": "EUR/HUF", "symbol": "FXPRO:1063"}, {"description": "FXPRO Switzerland 20 Spot Index #Swiss20", "displaySymbol": "Swiss20/CHF", "symbol": "FXPRO:1286"}, {"description": "FXPRO Euro vs Mexican Pesos EURMXN", "displaySymbol": "EUR/MXN", "symbol": "FXPRO:1064"}, {"description": "FXPRO Euro vs Norwegian Krone EURNOK", "displaySymbol": "EUR/NOK", "symbol": "FXPRO:1039"}, {"description": "FXPRO US Small Cap 2000 Spot Index #US2000", "displaySymbol": "US20001296/USD", "symbol": "FXPRO:1296"}, {"description": "FXPRO Euro vs New Zealand Dollar EURNZD", "displaySymbol": "EUR/NZD", "symbol": "FXPRO:1065"}, {"description": "FXPRO Euro vs Polish Zloty EURPLN", "displaySymbol": "EUR/PLN", "symbol": "FXPRO:1066"}, {"description": "FXPRO Euro vs Russian Ruble EURRUB", "displaySymbol": "EUR/RUB", "symbol": "FXPRO:1083"}, {"description": "FXPRO Euro vs Swedish Krona EURSEK", "displaySymbol": "EUR/SEK", "symbol": "FXPRO:1067"}, {"description": "FXPRO Euro vs Singapore Dollar EURSGD", "displaySymbol": "EUR/SGD", "symbol": "FXPRO:1087"}, {"description": "FXPRO Euro vs Turkish Lira EURTRY", "displaySymbol": "EUR/TRY", "symbol": "FXPRO:1001"}, {"description": "FXPRO Euro vs South African Rand EURZAR", "displaySymbol": "EUR/ZAR", "symbol": "FXPRO:1052"}, {"description": "FXPRO British Pound vs Australian Dollar GBPAUD", "displaySymbol": "GBP/AUD", "symbol": "FXPRO:16"}, {"description": "FXPRO British Pound vs Danish Krone GBPDKK", "displaySymbol": "GBP/DKK", "symbol": "FXPRO:1088"}, {"description": "FXPRO British Pound vs Norwegian Krone GBPNOK", "displaySymbol": "GBP/NOK", "symbol": "FXPRO:1041"}, {"description": "FXPRO British Pound vs New Zealand Dollar GBPNZD", "displaySymbol": "GBP/NZD", "symbol": "FXPRO:1042"}, {"description": "FXPRO British Pound vs Polish Zloty GBPPLN", "displaySymbol": "GBP/PLN", "symbol": "FXPRO:1089"}, {"description": "FXPRO British Pound vs Swedish Krona GBPSEK", "displaySymbol": "GBP/SEK", "symbol": "FXPRO:1090"}, {"description": "FXPRO British Pound vs Singapore Dollar GBPSGD", "displaySymbol": "GBP/SGD", "symbol": "FXPRO:1043"}, {"description": "FXPRO British Pound vs South African Rand GBPZAR", "displaySymbol": "GBP/ZAR", "symbol": "FXPRO:1068"}, {"description": "FXPRO Norwegian Krone vs Swedish Krona NOKSEK", "displaySymbol": "NOK/SEK", "symbol": "FXPRO:1092"}, {"description": "FXPRO New Zealand Dollar vs Canadian Dollar NZDCAD", "displaySymbol": "NZD/CAD", "symbol": "FXPRO:1044"}, {"description": "FXPRO New Zealand Dollar vs Swiss Franc NZDCHF", "displaySymbol": "NZD/CHF", "symbol": "FXPRO:1045"}, {"description": "FXPRO New Zealand Dollar vs Japanese Yen NZDJPY", "displaySymbol": "NZD/JPY", "symbol": "FXPRO:1046"}, {"description": "FXPRO New Zealand Dollar vs Singapore Dollar NZDSGD", "displaySymbol": "NZD/SGD", "symbol": "FXPRO:1069"}, {"description": "FXPRO New Zealand Dollar vs US Dollar NZDUSD", "displaySymbol": "NZD/USD", "symbol": "FXPRO:12"}, {"description": "FXPRO Polish Zloty vs Japanese Yen PLNJPY", "displaySymbol": "PLN/JPY", "symbol": "FXPRO:1091"}, {"description": "FXPRO Singapore Dollar vs Japanese Yen SGDJPY", "displaySymbol": "SGD/JPY", "symbol": "FXPRO:1053"}, {"description": "FXPRO US Dollar vs China Offshore Spot USDCNH", "displaySymbol": "USD/CNH", "symbol": "FXPRO:1082"}, {"description": "FXPRO US Dollar vs Czech Koruna USDCZK", "displaySymbol": "USD/CZK", "symbol": "FXPRO:1081"}, {"description": "FXPRO US Dollar vs Danish Krone USDDKK", "displaySymbol": "USD/DKK", "symbol": "FXPRO:1070"}, {"description": "FXPRO US Dollar vs Hong Kong Dollar USDHKD", "displaySymbol": "USD/HKD", "symbol": "FXPRO:1054"}, {"description": "FXPRO US Dollar vs Hungarian Forint USDHUF", "displaySymbol": "USD/HUF", "symbol": "FXPRO:1071"}, {"description": "FXPRO US Dollar vs Israeli Shekel USDILS", "displaySymbol": "USD/ILS", "symbol": "FXPRO:1292"}, {"description": "FXPRO US Dollar vs Mexican Pesos USDMXN", "displaySymbol": "USD/MXN", "symbol": "FXPRO:1047"}, {"description": "FXPRO US Dollar vs Norwegian Krone USDNOK", "displaySymbol": "USD/NOK", "symbol": "FXPRO:1048"}, {"description": "FXPRO US Dollar vs Polish Zloty USDPLN", "displaySymbol": "USD/PLN", "symbol": "FXPRO:1049"}, {"description": "FXPRO US Dollar vs Russian Ruble USDRUB", "displaySymbol": "USD/RUB", "symbol": "FXPRO:1084"}, {"description": "FXPRO US Dollar vs Swedish Krona USDSEK", "displaySymbol": "USD/SEK", "symbol": "FXPRO:1050"}, {"description": "FXPRO US Dollar vs Singapore Dollar USDSGD", "displaySymbol": "USD/SGD", "symbol": "FXPRO:28"}, {"description": "FXPRO US Dollar vs Thai Baht USDTHB", "displaySymbol": "USD/THB", "symbol": "FXPRO:1313"}, {"description": "FXPRO US Dollar vs Turkish Lira USDTRY", "displaySymbol": "USD/TRY", "symbol": "FXPRO:1000"}, {"description": "FXPRO US Dollar vs South African Rand USDZAR", "displaySymbol": "USD/ZAR", "symbol": "FXPRO:1055"}, {"description": "FXPRO Natural Gas (US) Spot NAT.GAS", "displaySymbol": "XNG/USD", "symbol": "FXPRO:1118"}, {"description": "FXPRO WTI Spot Oil WTI", "displaySymbol": "XTI/USD", "symbol": "FXPRO:1116"}, {"description": "FXPRO FTSE Mid 250 Spot Index #UKmid250", "displaySymbol": "UKmid250/GBP", "symbol": "FXPRO:1316"}]'''
if (pairs_json):
pairs = pairs_json
symbol_list = json.loads(pairs)
for symbol in symbol_list:
print(str(symbol["symbol"]), end=" ")
@staticmethod
def get_pair_displayname(pair_symbol):
pairs = '''[{"description": "FXPRO Canadian Dollar vs Swiss Franc CADCHF", "displaySymbol": "CAD/CHF", "symbol": "FXPRO:1061"}, {"description": "FXPRO Silver Ounce vs Euro XAGEUR", "displaySymbol": "XAG/EUR", "symbol": "FXPRO:1109"}, {"description": "FXPRO Silver Ounce vs US Dollar XAGUSD", "displaySymbol": "XAG/USD", "symbol": "FXPRO:42"}, {"description": "FXPRO Gold Ounce vs Euro XAUEUR", "displaySymbol": "XAU/EUR", "symbol": "FXPRO:1108"}, {"description": "FXPRO Australian Dollar vs Canadian Dollar AUDCAD", "displaySymbol": "AUD/CAD", "symbol": "FXPRO:18"}, {"description": "FXPRO Gold Ounce vs US Dollar XAUUSD", "displaySymbol": "XAU/USD", "symbol": "FXPRO:41"}, {"description": "FXPRO Gold Grams vs US Dollar XAUUSDgr", "displaySymbol": "GAU/USD", "symbol": "FXPRO:1110"}, {"description": "FXPRO Australia 200 Spot Index #AUS200", "displaySymbol": "ASX200/AUD", "symbol": "FXPRO:1274"}, {"description": "FXPRO Platinum Ounce vs US Dollar XPTUSD", "displaySymbol": "XPT/USD", "symbol": "FXPRO:1297"}, {"description": "FXPRO BitcoinCash vs US Dollar BCHUSD", "displaySymbol": "BCH/USD", "symbol": "FXPRO:1314"}, {"description": "FXPRO Canadian Dollar vs Japanese Yen CADJPY", "displaySymbol": "CAD/JPY", "symbol": "FXPRO:15"}, {"description": "FXPRO Australian Dollar vs Swiss Franc AUDCHF", "displaySymbol": "AUD/CHF", "symbol": "FXPRO:1038"}, {"description": "FXPRO Euro Stoxx 50 Spot Index #Euro50", "displaySymbol": "Euro50/EUR", "symbol": "FXPRO:1103"}, {"description": "FXPRO Bitcoin vs US Dollar BTCUSD", "displaySymbol": "BTC/USD", "symbol": "FXPRO:1310"}, {"description": "FXPRO Swiss Franc vs Japanese Yen CHFJPY", "displaySymbol": "CHF/JPY", "symbol": "FXPRO:13"}, {"description": "FXPRO Australian Dollar vs Danish Krone AUDDKK", "displaySymbol": "AUD/DKK", "symbol": "FXPRO:1289"}, {"description": "FXPRO Brent (UK) Spot Oil BRENT", "displaySymbol": "XBR/USD", "symbol": "FXPRO:1117"}, {"description": "FXPRO France CAC 40 Spot Index #France40", "displaySymbol": "France40/EUR", "symbol": "FXPRO:1104"}, {"description": "FXPRO FTSE China A50 Spot Index #ChinaA50", "displaySymbol": "ChinaA50/USD", "symbol": "FXPRO:1100"}, {"description": "FXPRO Ethereum vs US Dollar ETHUSD", "displaySymbol": "ETH/USD", "symbol": "FXPRO:1311"}, {"description": "FXPRO Euro vs Canadian Dollar EURCAD", "displaySymbol": "EUR/CAD", "symbol": "FXPRO:17"}, {"description": "FXPRO Australian Dollar vs Japanese Yen AUDJPY", "displaySymbol": "AUD/JPY", "symbol": "FXPRO:11"}, {"description": "FXPRO Germany 30 (DAX) Spot Index #Germany30", "displaySymbol": "Germany30/EUR", "symbol": "FXPRO:1106"}, {"description": "FXPRO China H Shares Spot Index #ChinaHShar", "displaySymbol": "China_HShar/HKD", "symbol": "FXPRO:1115"}, {"description": "FXPRO Litecoin vs US Dollar LTCUSD", "displaySymbol": "LTC/USD", "symbol": "FXPRO:1312"}, {"description": "FXPRO Euro vs Swiss Franc EURCHF", "displaySymbol": "EUR/CHF", "symbol": "FXPRO:10"}, {"description": "FXPRO Australian Dollar vs New Zealand Dollar AUDNZD", "displaySymbol": "AUD/NZD", "symbol": "FXPRO:1060"}, {"description": "FXPRO Japan 225 Spot Index #Japan225", "displaySymbol": "Japan225/USD", "symbol": "FXPRO:1293"}, {"description": "FXPRO France 120 Spot Index #France120", "displaySymbol": "France120/EUR", "symbol": "FXPRO:1098"}, {"description": "FXPRO Ripple vs US Dollar XRPUSD", "displaySymbol": "XRP/USD", "symbol": "FXPRO:1315"}, {"description": "FXPRO Euro vs British Pound EURGBP", "displaySymbol": "EUR/GBP", "symbol": "FXPRO:9"}, {"description": "FXPRO Australian Dollar vs Polish Zloty AUDPLN", "displaySymbol": "AUD/PLN", "symbol": "FXPRO:1290"}, {"description": "FXPRO FTSE 100 Spot Index #UK100", "displaySymbol": "UK100/GBP", "symbol": "FXPRO:1105"}, {"description": "FXPRO Germany Technology 30 Spot Index #GerTech30", "displaySymbol": "GerTech30/EUR", "symbol": "FXPRO:1093"}, {"description": "FXPRO Euro vs Japanese Yen EURJPY", "displaySymbol": "EUR/JPY", "symbol": "FXPRO:3"}, {"description": "FXPRO Australian Dollar vs Singapore Dollar AUDSGD", "displaySymbol": "AUD/SGD", "symbol": "FXPRO:1085"}, {"description": "FXPRO US Dow Jones 30 Spot Index #US30", "displaySymbol": "US30/USD", "symbol": "FXPRO:1287"}, {"description": "FXPRO Germany 50 Mid Cap Spot Index #Germany50", "displaySymbol": "Germany50/EUR", "symbol": "FXPRO:1096"}, {"description": "FXPRO Euro vs US Dollar EURUSD", "displaySymbol": "EUR/USD", "symbol": "FXPRO:1"}, {"description": "FXPRO Australian Dollar vs US Dollar AUDUSD", "displaySymbol": "AUD/USD", "symbol": "FXPRO:5"}, {"description": "FXPRO US Nasdaq 100 Spot Index #USNDAQ100", "displaySymbol": "US_NDAQ100/USD", "symbol": "FXPRO:1107"}, {"description": "FXPRO British Pound vs Canadian Dollar GBPCAD", "displaySymbol": "GBP/CAD", "symbol": "FXPRO:1040"}, {"description": "FXPRO Swiss Franc vs Polish Zloty CHFPLN", "displaySymbol": "CHF/PLN", "symbol": "FXPRO:1086"}, {"description": "FXPRO US S&P 500 Spot Index #USSPX500", "displaySymbol": "USSPX500/USD", "symbol": "FXPRO:1288"}, {"description": "FXPRO Netherlands 25 Spot Index #Holland25", "displaySymbol": "Holland25/EUR", "symbol": "FXPRO:1094"}, {"description": "FXPRO British Pound vs Swiss Franc GBPCHF", "displaySymbol": "GBP/CHF", "symbol": "FXPRO:40"}, {"description": "FXPRO Swiss Franc vs Singapore Dollar CHFSGD", "displaySymbol": "CHF/SGD", "symbol": "FXPRO:1291"}, {"description": "FXPRO Hong Kong 50 Spot Index #HongKong50", "displaySymbol": "HongKong50/HKD", "symbol": "FXPRO:1114"}, {"description": "FXPRO British Pound vs Japanese Yen GBPJPY", "displaySymbol": "GBP/JPY", "symbol": "FXPRO:7"}, {"description": "FXPRO Euro vs Australian Dollar EURAUD", "displaySymbol": "EUR/AUD", "symbol": "FXPRO:14"}, {"description": "FXPRO British Pound vs US Dollar GBPUSD", "displaySymbol": "GBP/USD", "symbol": "FXPRO:2"}, {"description": "FXPRO Euro vs Czech Koruna EURCZK", "displaySymbol": "EUR/CZK", "symbol": "FXPRO:1080"}, {"description": "FXPRO US Dollar vs Canadian Dollar USDCAD", "displaySymbol": "USD/CAD", "symbol": "FXPRO:8"}, {"description": "FXPRO Euro vs Danish Krone EURDKK", "displaySymbol": "EUR/DKK", "symbol": "FXPRO:1062"}, {"description": "FXPRO US Dollar vs Swiss Franc USDCHF", "displaySymbol": "USD/CHF", "symbol": "FXPRO:6"}, {"description": "FXPRO Euro vs Hong Kong Dollar EURHKD", "displaySymbol": "EUR/HKD", "symbol": "FXPRO:1051"}, {"description": "FXPRO Spain 35 Spot Index #Spain35", "displaySymbol": "Spain35/EUR", "symbol": "FXPRO:1285"}, {"description": "FXPRO US Dollar vs Japanese Yen USDJPY", "displaySymbol": "USD/JPY", "symbol": "FXPRO:4"}, {"description": "FXPRO Euro vs Hungarian Forint EURHUF", "displaySymbol": "EUR/HUF", "symbol": "FXPRO:1063"}, {"description": "FXPRO Switzerland 20 Spot Index #Swiss20", "displaySymbol": "Swiss20/CHF", "symbol": "FXPRO:1286"}, {"description": "FXPRO Euro vs Mexican Pesos EURMXN", "displaySymbol": "EUR/MXN", "symbol": "FXPRO:1064"}, {"description": "FXPRO Euro vs Norwegian Krone EURNOK", "displaySymbol": "EUR/NOK", "symbol": "FXPRO:1039"}, {"description": "FXPRO US Small Cap 2000 Spot Index #US2000", "displaySymbol": "US20001296/USD", "symbol": "FXPRO:1296"}, {"description": "FXPRO Euro vs New Zealand Dollar EURNZD", "displaySymbol": "EUR/NZD", "symbol": "FXPRO:1065"}, {"description": "FXPRO Euro vs Polish Zloty EURPLN", "displaySymbol": "EUR/PLN", "symbol": "FXPRO:1066"}, {"description": "FXPRO Euro vs Russian Ruble EURRUB", "displaySymbol": "EUR/RUB", "symbol": "FXPRO:1083"}, {"description": "FXPRO Euro vs Swedish Krona EURSEK", "displaySymbol": "EUR/SEK", "symbol": "FXPRO:1067"}, {"description": "FXPRO Euro vs Singapore Dollar EURSGD", "displaySymbol": "EUR/SGD", "symbol": "FXPRO:1087"}, {"description": "FXPRO Euro vs Turkish Lira EURTRY", "displaySymbol": "EUR/TRY", "symbol": "FXPRO:1001"}, {"description": "FXPRO Euro vs South African Rand EURZAR", "displaySymbol": "EUR/ZAR", "symbol": "FXPRO:1052"}, {"description": "FXPRO British Pound vs Australian Dollar GBPAUD", "displaySymbol": "GBP/AUD", "symbol": "FXPRO:16"}, {"description": "FXPRO British Pound vs Danish Krone GBPDKK", "displaySymbol": "GBP/DKK", "symbol": "FXPRO:1088"}, {"description": "FXPRO British Pound vs Norwegian Krone GBPNOK", "displaySymbol": "GBP/NOK", "symbol": "FXPRO:1041"}, {"description": "FXPRO British Pound vs New Zealand Dollar GBPNZD", "displaySymbol": "GBP/NZD", "symbol": "FXPRO:1042"}, {"description": "FXPRO British Pound vs Polish Zloty GBPPLN", "displaySymbol": "GBP/PLN", "symbol": "FXPRO:1089"}, {"description": "FXPRO British Pound vs Swedish Krona GBPSEK", "displaySymbol": "GBP/SEK", "symbol": "FXPRO:1090"}, {"description": "FXPRO British Pound vs Singapore Dollar GBPSGD", "displaySymbol": "GBP/SGD", "symbol": "FXPRO:1043"}, {"description": "FXPRO British Pound vs South African Rand GBPZAR", "displaySymbol": "GBP/ZAR", "symbol": "FXPRO:1068"}, {"description": "FXPRO Norwegian Krone vs Swedish Krona NOKSEK", "displaySymbol": "NOK/SEK", "symbol": "FXPRO:1092"}, {"description": "FXPRO New Zealand Dollar vs Canadian Dollar NZDCAD", "displaySymbol": "NZD/CAD", "symbol": "FXPRO:1044"}, {"description": "FXPRO New Zealand Dollar vs Swiss Franc NZDCHF", "displaySymbol": "NZD/CHF", "symbol": "FXPRO:1045"}, {"description": "FXPRO New Zealand Dollar vs Japanese Yen NZDJPY", "displaySymbol": "NZD/JPY", "symbol": "FXPRO:1046"}, {"description": "FXPRO New Zealand Dollar vs Singapore Dollar NZDSGD", "displaySymbol": "NZD/SGD", "symbol": "FXPRO:1069"}, {"description": "FXPRO New Zealand Dollar vs US Dollar NZDUSD", "displaySymbol": "NZD/USD", "symbol": "FXPRO:12"}, {"description": "FXPRO Polish Zloty vs Japanese Yen PLNJPY", "displaySymbol": "PLN/JPY", "symbol": "FXPRO:1091"}, {"description": "FXPRO Singapore Dollar vs Japanese Yen SGDJPY", "displaySymbol": "SGD/JPY", "symbol": "FXPRO:1053"}, {"description": "FXPRO US Dollar vs China Offshore Spot USDCNH", "displaySymbol": "USD/CNH", "symbol": "FXPRO:1082"}, {"description": "FXPRO US Dollar vs Czech Koruna USDCZK", "displaySymbol": "USD/CZK", "symbol": "FXPRO:1081"}, {"description": "FXPRO US Dollar vs Danish Krone USDDKK", "displaySymbol": "USD/DKK", "symbol": "FXPRO:1070"}, {"description": "FXPRO US Dollar vs Hong Kong Dollar USDHKD", "displaySymbol": "USD/HKD", "symbol": "FXPRO:1054"}, {"description": "FXPRO US Dollar vs Hungarian Forint USDHUF", "displaySymbol": "USD/HUF", "symbol": "FXPRO:1071"}, {"description": "FXPRO US Dollar vs Israeli Shekel USDILS", "displaySymbol": "USD/ILS", "symbol": "FXPRO:1292"}, {"description": "FXPRO US Dollar vs Mexican Pesos USDMXN", "displaySymbol": "USD/MXN", "symbol": "FXPRO:1047"}, {"description": "FXPRO US Dollar vs Norwegian Krone USDNOK", "displaySymbol": "USD/NOK", "symbol": "FXPRO:1048"}, {"description": "FXPRO US Dollar vs Polish Zloty USDPLN", "displaySymbol": "USD/PLN", "symbol": "FXPRO:1049"}, {"description": "FXPRO US Dollar vs Russian Ruble USDRUB", "displaySymbol": "USD/RUB", "symbol": "FXPRO:1084"}, {"description": "FXPRO US Dollar vs Swedish Krona USDSEK", "displaySymbol": "USD/SEK", "symbol": "FXPRO:1050"}, {"description": "FXPRO US Dollar vs Singapore Dollar USDSGD", "displaySymbol": "USD/SGD", "symbol": "FXPRO:28"}, {"description": "FXPRO US Dollar vs Thai Baht USDTHB", "displaySymbol": "USD/THB", "symbol": "FXPRO:1313"}, {"description": "FXPRO US Dollar vs Turkish Lira USDTRY", "displaySymbol": "USD/TRY", "symbol": "FXPRO:1000"}, {"description": "FXPRO US Dollar vs South African Rand USDZAR", "displaySymbol": "USD/ZAR", "symbol": "FXPRO:1055"}, {"description": "FXPRO Natural Gas (US) Spot NAT.GAS", "displaySymbol": "XNG/USD", "symbol": "FXPRO:1118"}, {"description": "FXPRO WTI Spot Oil WTI", "displaySymbol": "XTI/USD", "symbol": "FXPRO:1116"}, {"description": "FXPRO FTSE Mid 250 Spot Index #UKmid250", "displaySymbol": "UKmid250/GBP", "symbol": "FXPRO:1316"}]'''
symbol_list = json.loads(pairs)
for symbol in symbol_list:
if(pair_symbol==str(symbol["symbol"])):
return str(symbol["displaySymbol"])