Skip to content

Instantly share code, notes, and snippets.

@ugik
Created June 8, 2021 20:50
Show Gist options
  • Save ugik/48021bb58bc6884817b147f882e863de to your computer and use it in GitHub Desktop.
Save ugik/48021bb58bc6884817b147f882e863de to your computer and use it in GitHub Desktop.
def main():
start_time = time()
csvfile = open('arbitrage', 'w', newline='', encoding='UTF8')
result_writer = csv.writer(csvfile, delimiter=',')
n = 0
while n < ITERATIONS:
n += 1
prices = get_prices()
triangles = list(find_triangles(prices))
if triangles:
for triangle in sorted(triangles, key=itemgetter('profit'), reverse=True):
describe_triangle(prices, triangle, result_writer)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment