yasinkuyu / binance-trader

💰 Cryptocurrency Trading Bot for Binance (Experimental)
2.54k stars 833 forks source link

help #11

Closed nosaJjr closed 6 years ago

nosaJjr commented 6 years ago

i received this error

Traceback (most recent call last): File "/Users/SoleATCService/Desktop/binance-trader-master/trader.py", line 216, in main() File "/Users/SoleATCService/Desktop/binance-trader-master/trader.py", line 209, in main action(symbol) File "/Users/SoleATCService/Desktop/binance-trader-master/trader.py", line 129, in action file = open("ORDER", "r") IOError: [Errno 2] No such file or directory: 'ORDER'

caiorondon commented 6 years ago

@nosaJjr If you just read the console I bet you can figure it out the error by yourself.

[...]
IOError: [Errno 2] No such file or directory: 'ORDER'
[...]

Have you deleted this file? It is on the root of the repository.

[MOST LIKELY] Another reason that may be causing this problem is that you're running the trader.py from the outside of the directory. The file open system trader.py <line 45> is not using relative paths, so you have to run this script from the root directory of the repository, otherwise the script can't find the given file.

This bot is completely experimental and it has yet a lot of cases to cover. To increase your chances of using it correctly, try to change the environment as little as possible.

caiorondon commented 6 years ago

@yasinkuyu a solution that I use for dealing with file handling and paths is using the os and sys modules.

import os
import path
[...]
open(os.path.join(sys.path[0], "file_to_be_opened"), "r");

Assuming that file_to_be_opened is located in the same level as the main script.

yasinkuyu commented 6 years ago

https://github.com/yasinkuyu/binance-trader/commit/72aca9ced9257dd5e6b3294d88d547a388a3ccb7

nosaJjr commented 6 years ago

no i haven't deleted any files