Skip to content

Instantly share code, notes, and snippets.

@vladthelittleone
Created February 7, 2018 12:39
Show Gist options
  • Select an option

  • Save vladthelittleone/b65aa41b77926e2828cffcadd1bba757 to your computer and use it in GitHub Desktop.

Select an option

Save vladthelittleone/b65aa41b77926e2828cffcadd1bba757 to your computer and use it in GitHub Desktop.
for active in MAIN_ACTIVE:
for (currency_1, currencies_1) in orders.items():
for (currency_2, order) in currencies_1.items():
if currency_2 == active or currency_1 == active:
continue
order_1 = orders[active][currency_1]
order_2 = order
order_3 = orders[currency_2][active]
amount = get_amount()
order_price = order_1['price'] * amount
transfer_1 = amount * (1 - COMMISSION)
transfer_2 = transfer_1 / order_2['price'] * (1 - COMMISSION)
transfer_3 = transfer_2 / order_3['price'] * (1 - COMMISSION)
if (transfer_3 / order_price) > 1:
print('##############')
print('Find percent:', transfer_3)
print('Amount:', str(amount), currency_1)
print('Order price:', str(order_price), active)
print('Income:', str(transfer_3), active)
print('Orders:')
print(order_1, '=>')
print(order_2, '=>')
print(order_3)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment