diff --git a/main.py b/main.py index c7e8189..abb71d2 100644 --- a/main.py +++ b/main.py @@ -6,6 +6,9 @@ import triangular_arbitrage.detector as detector if __name__ == "__main__": + if hasattr(asyncio, "WindowsSelectorEventLoopPolicy"): + asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy()) # Windows handles asynchronous event loops + benchmark = os_util.parse_boolean_environment_var("IS_BENCHMARKING", "False") if benchmark: import time diff --git a/triangular_arbitrage/detector.py b/triangular_arbitrage/detector.py index 79d0b8b..3d26b0b 100644 --- a/triangular_arbitrage/detector.py +++ b/triangular_arbitrage/detector.py @@ -108,7 +108,7 @@ async def get_exchange_last_prices(exchange_name, ignored_symbols, whitelisted_s return last_prices -async def run_detection(exchange_name, ignored_symbols=None, whitelisted_symbols=None, max_cycle=None): +async def run_detection(exchange_name, ignored_symbols=None, whitelisted_symbols=None, max_cycle=10): last_prices = await get_exchange_last_prices(exchange_name, ignored_symbols or [], whitelisted_symbols) # default is the best opportunity for all cycles best_opportunity, best_profit = get_best_opportunity(last_prices, max_cycle=max_cycle)