Code Monkey home page Code Monkey logo

crypto-copy-trader's Introduction

Hi 👋, I'm Mohamed Rashad

With 9+ years of experience in various multinationals & startups, interacting with a diverse set of problems. I've worked with software & hardware from building websites and apps, designing robots or developing machine learning applications, alongside experimenting with many ideas and trying to fulfill my curiosity by learning everything I can put my hands on.

I'm T-shaped minded person, interested in interdisciplinary and multidisciplinary work, considering this, I work to find the links between different disciplines and integrate them for a solution. Trying to make this world better, by applying egnineering and spreading knowledge.

My focus is developing deep/high tech and delivering real value to business.
I am an early adopter of disruptive ideas, and I helped building multiple successful products across multiple domains, for example :
• TAI Automation & Analytics Platform @ Nokia
• AI-Powered e-KYC Platform @ Digified
• Talent Matchmaking Platform @ Lyrise
• Tuba Auto AI-Vision Platform @ DevisionX
..also currently working on couple another products.

I also work with the engineering community both as volunteer and professional, I've been an IEEE Volunteer for more than 7 years, both locally and globally, from being my local student branch chairman to organizing the largest programming competition in the planet, I also co-founded the first makerspace and fablab in the Suez Canal region (Fab Lab Ismailia) , taking the lead of the maker community in this region and accelerating the growth of the engineering & maker community.

I believe that empowering of the community is integral to advancing the engineering as a discipline, so my technical work and community-oriented work go hand in hand to fulfill my vision.


► Business Domains of Experience :
• FinTech • Telecom • Industry 4.0 • Digital Transformation • Robotics & Avionics

►Technical Fields of Interest :
• Machine & Deep Learning • Software & System Design • Scientific Programming & Simulations • Backend Development & DevOps • Digital Signal Processing • Distributed Systems • Systems Engineering • Control Engineering • Aircraft Systems
• Robotics

►Research Interests :
• Formal Software Design Methods • Mathematical Modeling • Programming Language Design • Applied Mathematical Optimization • Applied Category Theory • Applied Artificial Intelligence • Systems Engineering • Control Theory

crypto-copy-trader's People

Contributors

alexandrebouttier avatar inapeace0 avatar mohammedrashad avatar mokolotron avatar rashad97 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

crypto-copy-trader's Issues

Using % of the Master Balance

Is it possible to modify the order amount in order for every account use the same percentage as the master?

Example:

Master has 10 BTC and opens a new buy limit of 5BTC at 6500USD (50% of the balance)

Slave 1 has 14 BTC, the script opens a new buy limit of 7BTC at 6500USD (50% of the balance)

Slave 2 has 3 BTC, the script opens a new buy limit of 1.5BTC at 6500USD (50% of the balance)

Maybe changing the value "quantity=order['origQty']" adding the formula for the original percentage?

Thanks for the patience, I'm not very much experienced in developing.

Question: Maximum number of slaves

Hello, I have a quick question, what is the number of slaves possible on the same master, how does it manage this in relation to the binance restrictions? Thank you for your work by the way

Binance Futures Support

Hello, I've tried to add Binance futures support to this and have changed all the methods required to communicate with the new exchange. It is able to copy existing orders successfully, but I'm not sure why the websocket is not picking up any user stream data? It says the websocket is launched but no events are picked up.
I've checked the websocket separately and it is able to pick up events but not when I try to implement it into here.

Lost apikeys

You are left your apikeys in file Crypto-Copy-Trader/config_files/config.csv
I think need add this file to .gitignore. And instead it, create a sample-confing.csv to give example how file config.csv must look like.

QUESTION frontend React & Evolution

Hello, I use your copybot which works very well thank you, for my part I transform the interface into React in the form of a dashboard, I wonder if you would be interested that once my work is finished to share with you in order to contribute to your project, the dashboard will be able to add new slaves with a mongoDB database, be able to add an allocation option in the slaves to dedicate an allocated sum in percentage, encryption of API secret keys, exchange choice, jwt connection to protect the table on board, recording each order of each slave, start shutting down the bot, and then see the stats of the bot

Binance API Invalid

binance.exceptions.BinanceAPIException: APIError(code=-2014): API-key format invalid.
image
image

Amount on Slaves

it is normal that the copy-trader leave a small amount of any coin he has bought on the Slaves ?
Thanks.

Which firewall ports?

Hello,

I want to block access to the configuration panel but the firewall is blocking all the connections, which ports should I allow?

Thanks

bug no action triggered on slaves

Hello have you encountered any bugs at the moment it's been 2 times that it detects but does nothing on my 2 Slaves and no errors, it's strange

2021-01-02 08:11:13,397 - INFO - The Crypto-Copy-Trader starts launch
2021-01-02 08:11:13,399 - INFO - Reading configuration file...
2021-01-02 08:11:13,400 - INFO - 2 Slave accounts detected
2021-01-02 08:11:13,407 - INFO - Connecting to the master: KeyMaman...
2021-01-02 08:11:14,464 - INFO - Connecting to the slaves. Its can take time...
2021-01-02 08:11:17,101 - INFO - Open masters websocket...
2021-01-02 08:11:17,346 - INFO - Launch complete. Now I can copy orders!
2021-01-02 20:58:12,601 - DEBUG - Event came: {'e': 'executionReport', 'E': 1609621084969, 's': 'ETHUSDT', 'c': xxxxxxxx', 'S': 'SELL', 'o': 'MARKET', 'f': 'GTC', 'q': '0.45432000', 'p': '0.00000000', 'P': '0.00000
000', 'F': '0.00000000', 'g': -1, 'C': '', 'x': 'NEW', 'X': 'NEW', 'r': 'NONE', 'i': 2426449851, 'l': '0.00000000', 'z': '0.00000000', 'L': '0.00000000', 'n': '0', 'N': None, 'T': 1609621084968, 't': -1, 'I': 5074388446, 'w': True, 'm': Fa
lse, 'M': False, 'O': 1609621084968, 'Z': '0.00000000', 'Y': '0.00000000', 'Q': '340.80000000'}
2021-01-02 20:58:12,602 - DEBUG - Event came: {'e': 'executionReport', 'E': 1609621084969, 's': 'ETHUSDT', 'c': xxxxxxxx', 'S': 'SELL', 'o': 'MARKET', 'f': 'GTC', 'q': '0.45432000', 'p': '0.00000000', 'P': '0.00000
000', 'F': '0.00000000', 'g': -1, 'C': '', 'x': 'TRADE', 'X': 'FILLED', 'r': 'NONE', 'i': 2426449851, 'l': '0.45432000', 'z': '0.45432000', 'L': '750.12000000', 'n': '0.34079452', 'N': 'USDT', 'T': 1609621084968, 't': 235350357, 'I': 50743
88447, 'w': False, 'm': False, 'M': True, 'O': 1609621084968, 'Z': '340.79451840', 'Y': '340.79451840', 'Q': '340.80000000'}
2021-01-02 20:58:12,603 - DEBUG - Event came: {'e': 'outboundAccountPosition', 'E': 1609621084969, 'u': 1609621084968, 'B': [{'a': 'ETH', 'f': '0.00140990', 'l': '0.00000000'}, {'a': 'BNB', 'f': '0.00039450', 'l': '0.00000000'}, {'a': 'USD
T', 'f': '342.68541755', 'l': '0.00000000'}]}

Error while placing spot order on Binance

Hi, I started the application and was able to run successfully. I placed a spot order on ETH/USDT pair from the master account and slave accounts were supposed to copy the same but instead, I got this error below and I am looking for a solution. Please help.
error-copy-trading

APIError(code=-1013): Filter failure: LOT_SIZE

setting up the system and want to try to place the order,get this error
Slave {'asset': 'USDT', 'free': '200.00000000', 'locked': '0.00000000'} {'asset': 'ETH', 'free': '0.00000000', 'locked': '0.00000000'}, Create Order: amount: 0.079711, price: 395.62000000
APIError(code=-1013): Filter failure: LOT_SIZE
Slave {'asset': 'USDT', 'free': '200.00000000', 'locked': '0.00000000'} {'asset': 'ETH', 'free': '0.00000000', 'locked': '0.00000000'}, Create Order: amount: 0.079711, price: 395.62000000
APIError(code=-1013): Filter failure: LOT_SIZE
{'e': 'outboundAccountPosition', 'E': 1596713805704, 'u': 1596713805702, 'B': [{'a': 'ETH', 'f': '0.08937000', 'l': '0.00000000'}, {'a': 'BNB', 'f': '0.84203880', 'l': '0.00000000'}, {'a': 'USDT', 'f': '64.73866910', 'l': '0.00000000'}]}

it seems like that the amounts have problem.Filter failure: LOT_SIZE

How to set custom ratio?

Hi! I understand the default ratio is according to the balance of accounts. I would like to override this and set ratio myself. If this feature is not available can you please point me to the parts of code where the ratio is decided so I can try modifying it.

Thanks a lot!

Remove Single Slave Account

Dear,
When I click the delete/remove button on Slave Account on browser http://0.0.0.0:5000, it delete/remove all Slave accounts. Do we have option to remove single account only or how to manually do it, please?

Thanks very much.

Error MIN_NOTIONAL Invalid quantity

Hello, I encounter a bug, when I launch an order on master, quantity problem with my slave even though he has the necessary funds to place an order, here are my logs

2020-12-23 10:10:36,499 - INFO - The Crypto-Copy-Trader starts launch
2020-12-23 10:10:36,499 - INFO - Reading configuration file...
2020-12-23 10:10:36,499 - INFO - 1 Slave accounts detected
2020-12-23 10:10:36,501 - INFO - Connecting to the master: KeyALex...
2020-12-23 10:10:37,587 - INFO - Connecting to the slaves. Its can take time...
2020-12-23 10:10:38,876 - INFO - Open masters websocket...
2020-12-23 10:10:39,121 - INFO - Launch complete. Now I can copy orders!
2020-12-23 10:11:24,388 - DEBUG - Event came: {'e': 'executionReport', 'E': 1608714684262, 's': 'ETHUSDT', 'c': 'xxxxx', 'S': 'BUY', 'o': 'MARKET', 'f': 'GTC', 'q': '0.16315000', 'p': '0.00000000', 'P': '0.00000000', 'F': '0.00000000', 'g': -1, 'C': '', 'x': 'NEW', 'X': 'NEW', 'r': 'NONE', 'i': 2325685997, 'l': '0.00000000', 'z': '0.00000000', 'L': '0.00000000', 'n': '0', 'N': None, 'T': 1608714684260, 't': -1, 'I': 4865731139, 'w': True, 'm': False, 'M': False, 'O': 1608714684260, 'Z': '0.00000000', 'Y': '0.00000000', 'Q': '100.00000000'}
2020-12-23 10:11:24,389 - DEBUG - Event came: {'e': 'executionReport', 'E': 1608714684262, 's': 'ETHUSDT', 'c': 'xxxxx', 'S': 'BUY', 'o': 'MARKET', 'f': 'GTC', 'q': '0.16315000', 'p': '0.00000000', 'P': '0.00000000', 'F': '0.00000000', 'g': -1, 'C': '', 'x': 'TRADE', 'X': 'FILLED', 'r': 'NONE', 'i': 2325685997, 'l': '0.16315000', 'z': '0.16315000', 'L': '612.93000000', 'n': '0.00226259', 'N': 'BNB', 'T': 1608714684260, 't': 227902861, 'I': 4865731140, 'w': False, 'm': False, 'M': True, 'O': 1608714684260, 'Z': '99.99952950', 'Y': '99.99952950', 'Q': '100.00000000'}
2020-12-23 10:11:24,389 - DEBUG - Event came: {'e': 'outboundAccountInfo', 'E': 1608714684262, 'm': 10, 't': 10, 'b': 0, 's': 0, 'T': True, 'W': True, 'D': True, 'u': 1608714684260, 'B': [{'a': 'ETH', 'f': '0.19602369', 'l': '0.00000000'}, {'a': 'BNB', 'f': '0.00669054', 'l': '0.00000000'}, {'a': 'USDT', 'f': '6320.77495381', 'l': '0.00000000'}], 'P': ['SPOT', 'LEVERAGED']}
2020-12-23 10:11:24,622 - INFO -

2020-12-23 10:11:24,623 - INFO - New action came: {'exchange': 'Binance', 'name': 'new_order', 'order': Order: id: 2325685997price: 612.93000000, symbol: ETHUSDT, amount: 0.16315000, part: 0.015418628151843191, side: BUY, type: MARKET,}
2020-12-23 10:11:24,624 - INFO - Slave mhamed {'asset': 'USDT', 'free': '123.81576397', 'locked': '0.00000000'} {'asset': 'ETH', 'free': '0.00000000', 'locked': '0.00000000'}, Create Order: amount: 0.00311, price: 612.93000000
2020-12-23 10:11:24,876 - ERROR - APIError(code=-1013): Filter failure: MIN_NOTIONAL
2020-12-23 10:11:24,877 - DEBUG - Event came: {'e': 'outboundAccountPosition', 'E': 1608714684262, 'u': 1608714684260, 'B': [{'a': 'ETH', 'f': '0.19602369', 'l': '0.00000000'}, {'a': 'BNB', 'f': '0.00669054', 'l': '0.00000000'}, {'a': 'USDT', 'f': '6320.77495381', 'l': '0.00000000'}]}
2020-12-23 10:15:08,389 - DEBUG - Event came: {'e': 'executionReport', 'E': 1608714908258, 's': 'ETHUSDT', 'c': 'xxxxx', 'S': 'SELL', 'o': 'MARKET', 'f': 'GTC', 'q': '0.19601000', 'p': '0.00000000', 'P': '0.00000000', 'F': '0.00000000', 'g': -1, 'C': '', 'x': 'NEW', 'X': 'NEW', 'r': 'NONE', 'i': 2325706924, 'l': '0.00000000', 'z': '0.00000000', 'L': '0.00000000', 'n': '0', 'N': None, 'T': 1608714908257, 't': -1, 'I': 4865773912, 'w': True, 'm': False, 'M': False, 'O': 1608714908257, 'Z': '0.00000000', 'Y': '0.00000000', 'Q': '120.22000000'}
2020-12-23 10:15:08,390 - DEBUG - Event came: {'e': 'executionReport', 'E': 1608714908258, 's': 'ETHUSDT', 'c': 'xxxxx', 'S': 'SELL', 'o': 'MARKET', 'f': 'GTC', 'q': '0.19601000', 'p': '0.00000000', 'P': '0.00000000', 'F': '0.00000000', 'g': -1, 'C': '', 'x': 'TRADE', 'X': 'PARTIALLY_FILLED', 'r': 'NONE', 'i': 2325706924, 'l': '0.03260000', 'z': '0.03260000', 'L': '613.34000000', 'n': '0.00045189', 'N': 'BNB', 'T': 1608714908257, 't': 227903918, 'I': 4865773913, 'w': False, 'm': False, 'M': True, 'O': 1608714908257, 'Z': '19.99488400', 'Y': '19.99488400', 'Q': '120.22000000'}
2020-12-23 10:15:08,391 - DEBUG - Event came: {'e': 'executionReport', 'E': 1608714908258, 's': 'ETHUSDT', 'c': 'xxxx, 'S': 'SELL', 'o': 'MARKET', 'f': 'GTC', 'q': '0.19601000', 'p': '0.00000000', 'P': '0.00000000', 'F': '0.00000000', 'g': -1, 'C': '', 'x': 'TRADE', 'X': 'FILLED', 'r': 'NONE', 'i': 2325706924, 'l': '0.16341000', 'z': '0.19601000', 'L': '613.33000000', 'n': '0.00226513', 'N': 'BNB', 'T': 1608714908257, 't': 227903919, 'I': 4865773915, 'w': False, 'm': False, 'M': True, 'O': 1608714908257, 'Z': '120.21913930', 'Y': '100.22425530', 'Q': '120.22000000'}
2020-12-23 10:15:08,392 - DEBUG - Event came: {'e': 'outboundAccountInfo', 'E': 1608714908258, 'm': 10, 't': 10, 'b': 0, 's': 0, 'T': True, 'W': True, 'D': True, 'u': 1608714908257, 'B': [{'a': 'ETH', 'f': '0.00001369', 'l': '0.00000000'}, {'a': 'BNB', 'f': '0.00397352', 'l': '0.00000000'}, {'a': 'USDT', 'f': '6440.99409311', 'l': '0.00000000'}], 'P': ['SPOT', 'LEVERAGED']}
2020-12-23 10:15:08,640 - INFO -

2020-12-23 10:15:08,640 - INFO - New action came: {'exchange': 'Binance', 'name': 'new_order', 'order': Order: id: 2325706924price: 613.32000000, symbol: ETHUSDT, amount: 0.19601000, part: 0.9899308598873942, side: SELL, type: MARKET,}
2020-12-23 10:15:08,641 - INFO - Slave mhamed {'asset': 'USDT', 'free': '123.81576397', 'locked': '0.00000000'} {'asset': 'ETH', 'free': '0.00000000', 'locked': '0.00000000'}, Create Order: amount: 0.0, price: 613.32000000
2020-12-23 10:15:08,877 - ERROR - APIError(code=-1013): Invalid quantity.
2020-12-23 10:15:08,879 - DEBUG - Event came: {'e': 'outboundAccountPosition', 'E': 1608714908258, 'u': 1608714908257, 'B': [{'a': 'ETH', 'f': '0.00001369', 'l': '0.00000000'}, {'a': 'BNB', 'f': '0.00397352', 'l': '0.00000000'}, {'a': 'USDT', 'f': '6440.99409311', 'l': '0.00000000'}]}
2020-12-23 10:16:01,922 - DEBUG - Event came: {'e': 'executionReport', 'E': 1608714961790, 's': 'ETHUSDT', 'c': 'xxxxx', 'S': 'BUY', 'o': 'MARKET', 'f': 'GTC', 'q': '0.14697000', 'p': '0.00000000', 'P': '0.00000000', 'F': '0.00000000', 'g': -1, 'C': '', 'x': 'NEW', 'X': 'NEW', 'r': 'NONE', 'i': 2325713320, 'l': '0.00000000', 'z': '0.00000000', 'L': '0.00000000', 'n': '0', 'N': None, 'T': 1608714961787, 't': -1, 'I': 4865786962, 'w': True, 'm': False, 'M': False, 'O': 1608714961787, 'Z': '0.00000000', 'Y': '0.00000000', 'Q': '90.00000000'}
2020-12-23 10:16:01,923 - DEBUG - Event came: {'e': 'executionReport', 'E': 1608714961790, 's': 'ETHUSDT', 'c': 'xxxxx', 'S': 'BUY', 'o': 'MARKET', 'f': 'GTC', 'q': '0.14697000', 'p': '0.00000000', 'P': '0.00000000', 'F': '0.00000000', 'g': -1, 'C': '', 'x': 'TRADE', 'X': 'FILLED', 'r': 'NONE', 'i': 2325713320, 'l': '0.14697000', 'z': '0.14697000', 'L': '612.35000000', 'n': '0.00203682', 'N': 'BNB', 'T': 1608714961787, 't': 227904205, 'I': 4865786963, 'w': False, 'm': False, 'M': True, 'O': 1608714961787, 'Z': '89.99707950', 'Y': '89.99707950', 'Q': '90.00000000'}
2020-12-23 10:16:01,923 - DEBUG - Event came: {'e': 'outboundAccountInfo', 'E': 1608714961790, 'm': 10, 't': 10, 'b': 0, 's': 0, 'T': True, 'W': True, 'D': True, 'u': 1608714961787, 'B': [{'a': 'ETH', 'f': '0.14698369', 'l': '0.00000000'}, {'a': 'BNB', 'f': '0.00193670', 'l': '0.00000000'}, {'a': 'USDT', 'f': '6350.99701361', 'l': '0.00000000'}], 'P': ['SPOT', 'LEVERAGED']}
2020-12-23 10:16:02,160 - INFO -

create_order failed Bitmex

Hi Bro!
Pls help me. I try day and day. Whats wrong?
Master Account Bitmex
Slave Account Bitmextestnet.
Many thanks

2021-03-26 16:01:26,100 - INFO - The Crypto-Copy-Trader starts launch
2021-03-26 16:01:26,107 - INFO - Reading configuration file...
2021-03-26 16:01:26,113 - INFO - 1 Slave accounts detected
2021-03-26 16:01:26,120 - INFO - Connecting to the master: Master...
2021-03-26 16:01:34,121 - INFO - Connecting to the slaves. Its can take time...
2021-03-26 16:01:42,863 - INFO - Open masters websocket...
2021-03-26 16:01:43,646 - DEBUG - Event came: {'table': 'order', 'action': 'partial', 'keys': ['orderID'], 'types': {'orderID': 'guid', 'clOrdID': 'string', 'clOrdLinkID': 'symbol', 'account': 'long', 'symbol': 'symbol', 'side': 'symbol', 'simpleOrderQty': 'float', 'orderQty': 'long', 'price': 'float', 'displayQty': 'long', 'stopPx': 'float', 'pegOffsetValue': 'float', 'pegPriceType': 'symbol', 'currency': 'symbol', 'settlCurrency': 'symbol', 'ordType': 'symbol', 'timeInForce': 'symbol', 'execInst': 'symbol', 'contingencyType': 'symbol', 'exDestination': 'symbol', 'ordStatus': 'symbol', 'triggered': 'symbol', 'workingIndicator': 'boolean', 'ordRejReason': 'symbol', 'simpleLeavesQty': 'float', 'leavesQty': 'long', 'simpleCumQty': 'float', 'cumQty': 'long', 'avgPx': 'float', 'multiLegReportingType': 'symbol', 'text': 'string', 'transactTime': 'timestamp', 'timestamp': 'timestamp'}, 'foreignKeys': {'symbol': 'instrument', 'side': 'side', 'ordStatus': 'ordStatus'}, 'attributes': {'orderID': 'grouped', 'account': 'grouped', 'ordStatus': 'grouped', 'workingIndicator': 'grouped'}, 'filter': {'account': 1625735, 'symbol': 'XBTUSD'}, 'data': [{'orderID': 'b80c8ed4-ca5c-465a-b937-f18b29735982', 'clOrdID': '3cms_req_deal_368320258_2', 'clOrdLinkID': '', 'account': 1625735, 'symbol': 'XBTUSD', 'side': 'Sell', 'simpleOrderQty': None, 'orderQty': 966057, 'price': 54062.5, 'displayQty': None, 'stopPx': None, 'pegOffsetValue': None, 'pegPriceType': '', 'currency': 'USD', 'settlCurrency': 'XBt', 'ordType': 'Limit', 'timeInForce': 'GoodTillCancel', 'execInst': 'ReduceOnly', 'contingencyType': '', 'exDestination': 'XBME', 'ordStatus': 'New', 'triggered': '', 'workingIndicator': True, 'ordRejReason': '', 'simpleLeavesQty': None, 'leavesQty': 966057, 'simpleCumQty': None, 'cumQty': 0, 'avgPx': None, 'multiLegReportingType': 'SingleSecurity', 'text': 'Sent by 3commas', 'transactTime': '2021-03-26T13:56:29.250Z', 'timestamp': '2021-03-26T13:56:29.250Z'}]}
2021-03-26 16:01:46,353 - INFO - Launch complete. Now I can copy orders!
2021-03-26 16:01:46,373 - ERROR - Slave1: Error create order
Traceback (most recent call last):
File "/home/mezo/Crypto-Copy-Trader/ExchangeInterfaces/BitmexExchange.py", line 205, in create_order
quantity = self.calc_quantity_from_part(order.symbol, order.quantityPart,
File "/home/mezo/Crypto-Copy-Trader/ExchangeInterfaces/BitmexExchange.py", line 95, in calc_quantity_from_part
amount_usd = float(quantityPart) * float(self.get_balance())
TypeError: float() argument must be a string or a number, not 'NoneType'

Error while running project

Hi Mohammed, nice to meet you.

I was able to launch your project. You have done an awesome job, thank you so much!
Still I'm finding troubles, cause after launching this error appears:

2021-09-08 09:10:45,726 - INFO - The Crypto-Copy-Trader starts launch
2021-09-08 09:10:45,728 - INFO - Reading configuration file...
2021-09-08 09:10:45,729 - INFO - 2 Slave accounts detected
192.168.1.78 - - [08/Sep/2021 09:10:45] "GET /run HTTP/1.1" 500 -
Traceback (most recent call last):
File "C:\Crypto-Copy-Trader-master\venv\Lib\site-packages\flask\app.py", line 2088, in call
return self.wsgi_app(environ, start_response)
File "C:\Crypto-Copy-Trader-master\venv\Lib\site-packages\flask\app.py", line 2073, in wsgi_app
response = self.handle_exception(e)
File "C:\Crypto-Copy-Trader-master\venv\Lib\site-packages\flask\app.py", line 2070, in wsgi_app
response = self.full_dispatch_request()
File "C:\Crypto-Copy-Trader-master\venv\Lib\site-packages\flask\app.py", line 1515, in full_dispatch_request
rv = self.handle_user_exception(e)
File "C:\Crypto-Copy-Trader-master\venv\Lib\site-packages\flask\app.py", line 1513, in full_dispatch_request
rv = self.dispatch_request()
File "C:\Crypto-Copy-Trader-master\venv\Lib\site-packages\flask\app.py", line 1499, in dispatch_request
return self.ensure_sync(self.view_functions[rule.endpoint])(**req.view_args)
File "C:\Crypto-Copy-Trader-master\api.py", line 54, in run_process
manual_run()
File "C:\Crypto-Copy-Trader-master\api.py", line 27, in manual_run
container = server_begin()
File "C:\Crypto-Copy-Trader-master\Helpers\Helpers.py", line 65, in server_begin
slave_container = SlaveContainer(config, symbols)
File "C:\Crypto-Copy-Trader-master\SlaveContainer.py", line 20, in init
self.logger.info(f"Connecting to the master: {config['master']['name']}...")
TypeError: list indices must be integers or slices, not str
192.168.1.78 - - [08/Sep/2021 09:10:46] "GET /run?debugger=yes&cmd=resource&f=style.css HTTP/1.1" 200 -
192.168.1.78 - - [08/Sep/2021 09:10:46] "GET /run?debugger=yes&cmd=resource&f=debugger.js HTTP/1.1" 200 -
192.168.1.78 - - [08/Sep/2021 09:10:46] "GET /run?debugger=yes&cmd=resource&f=console.png HTTP/1.1" 200 -
192.168.1.78 - - [08/Sep/2021 09:10:47] "GET /run?debugger=yes&cmd=resource&f=ubuntu.ttf HTTP/1.1" 200 -

I'm sorry, but I'm not an experienced python programmer at all, could you please help me to find what I'm doing wrong?
Thank you in advance!
BR

Exception

Exception in thread Thread-11:
Traceback (most recent call last):
File "/usr/lib/python3.7/threading.py", line 917, in _bootstrap_inner
self.run()
File "/usr/lib/python3.7/threading.py", line 1166, in run
self.function(*self.args, **self.kwargs)
File "/home/bachmann/.local/lib/python3.7/site-packages/binance/websockets.py", line 544, in _keepalive_account_socket
callback = self._user_callback
AttributeError: 'BinanceSocketManager' object has no attribute '_user_callback'

What does this mean ?

Thanks

Dockerfile syntax

###REMOVE
FROM phusion/baseimage:latest
###REPLACE WITH
FROM phusion/baseimage:master-amd64

Invalid quantity

Hello,
i have run the api, seems to work but the master not read the quantity:

2021-04-25 17:04:36,675 - INFO - Launch complete. Now I can copy orders!
2021-04-25 17:04:36,943 - INFO - Slave Slave1 {'asset': 'BUSD', 'free': '31.87310000', 'locked': '0.00000000'} {'asset': 'ALGO', 'free': '0.00000000', 'locked': '0.00000000'}, Create Order: amount: 0.0, price: 1.23230000
2021-04-25 17:04:37,211 - ERROR - APIError(code=-1013): Invalid quantity.
2021-04-25 17:04:37,212 - INFO - Slave Slave1 {'asset': 'BUSD', 'free': '31.87310000', 'locked': '0.00000000'} {'asset': 'SNX', 'free': '0.00000000', 'locked': '0.00000000'}, Create Order: amount: 0.0, price: 19.02000000
2021-04-25 17:04:37,475 - ERROR - APIError(code=-1013): Invalid quantity.
2021-04-25 17:04:37,475 - INFO - Slave Slave2 {'asset': 'BUSD', 'free': '10120.47423041', 'locked': '0.00000000'} {'asset': 'ALG O', 'free': '0.00000000', 'locked': '0.00000000'}, Create Order: amount: 0.0, price: 1.23230000
2021-04-25 17:04:37,736 - ERROR - APIError(code=-1013): Invalid quantity.
2021-04-25 17:04:37,737 - INFO - Slave Slave2 {'asset': 'BUSD', 'free': '10120.47423041', 'locked': '0.00000000'} {'asset': 'SNX ', 'free': '0.00000000', 'locked': '0.00000000'}, Create Order: amount: 0.0, price: 19.02000000
2021-04-25 17:04:37,999 - ERROR - APIError(code=-1013): Invalid quantity.

Thanks for help :-)

Bitmex pair problem.

Hi! I install ubuntu 20.
Use BItmex, edit symbols.csv -> XBTUSD ETHUSD
Cant start the bot.

mezo@mezo:~/Crypto-Copy-Trader$ python3 api.py

  • Serving Flask app "api" (lazy loading)
  • Environment: production
    WARNING: Do not use the development server in a production environment.
    Use a production WSGI server instead.
  • Debug mode: on
  • Running on http://0.0.0.0:5000/ (Press CTRL+C to quit)
  • Restarting with stat
  • Debugger is active!
  • Debugger PIN: 282-647-152
    192.168.1.89 - - [24/Feb/2021 14:37:37] "GET / HTTP/1.1" 200 -
    2021-02-24 14:37:38,587 - INFO - The Crypto-Copy-Trader starts launch
    2021-02-24 14:37:38,588 - INFO - Reading configuration file...
    2021-02-24 14:37:38,588 - INFO - 2 Slave accounts detected
    2021-02-24 14:37:38,588 - INFO - Connecting to the master: Master...
    2021-02-24 14:37:38,589 - DEBUG - Can't translate word ETHUSD in Bitmex
    /home/mezo/.local/lib/python3.8/site-packages/swagger_spec_validator/validator20.py:49: SwaggerValidationWarning: Found "$ref: #/definitions/UserPreferences" with siblings that will be overwritten. See https://stackoverflow.com/a/48114924 for more information. (path #/definitions/User/properties/preferences)
    warnings.warn(

Many thanx \o/

the free balance not update after the first copy trade.

\Slave {'asset': 'USDT', 'free': '130.741099060', 'locked': '0.00000000'} {'asset': 'BTC', 'free': '0.00000000', 'locked': '0.00000000'}, Create Order: amount: 0.004525, price: 11787.47000000
order created
Slave {'asset': 'USDT', 'free': '137.741715760', 'locked': '0.00000000'} {'asset': 'BTC', 'free': '0.00000000', 'locked': '0.00000000'}, Create Order: amount: 0.004767, price: 11787.47000000
\order created

this is the first copy trade,
and the second
Slave {'asset': 'USDT', 'free': '130.741099060', 'locked': '0.00000000'} {'asset': 'ETH', 'free': '0.05712000', 'locked': '0.00000000'}, Create Order: amount: 0.27874, price: 397.23000000
APIError(code=-2010): Account has insufficient balance for requested action.
Slave {'asset': 'USDT', 'free': '81.551036950', 'locked': '0.00000000'} {'asset': 'ETH', 'free': '0.05712000', 'locked': '0.00000000'}, Create Order: amount: 0.17387, price: 397.23000000
order created

actualy the first slave just have about 80 free usdt after the first copy.
it seems the balance not update after the first trade.

Trades not duplicated

Hey!
Thank you so much for this amazing code, I'm currently trying to apply it in a raspberry pi (totally new in coding).

Would be nice if someone could help me: Code was working properly this morning, but right now it doesn't work anymore (trades not duplicated). Here the "error message" appearing in my cmd log.

Thanks!

DEBUG - Event came: {'e': 'executionReport', 'E': 1610824401562, 's': 'LINKUSDT', 'c': 'ios_56699c1a04254e2594d505a7d14a7d89', 'S': 'SELL', 'o': 'MARKET', 'f': 'GTC', 'q': '4.80000000', 'p': '0.00000000', 'P': '0.00000000', 'F': '0.00000000', 'g': -1, 'C': '', 'x': 'NEW', 'X': 'NEW', 'r': 'NONE', 'i': 1291098740, 'l': '0.00000000', 'z': '0.00000000', 'L': '0.00000000', 'n': '0', 'N': None, 'T': 1610824401562, 't': -1, 'I': 2647974736, 'w': True, 'm': False, 'M': False, 'O': 1610824401562, 'Z': '0.00000000', 'Y': '0.00000000', 'Q': '100.60670000'}

2021-01-16 20:13:21,792 - DEBUG - Event came: {'e': 'executionReport', 'E': 1610824401562, 's': 'LINKUSDT', 'c': 'ios_56699c1a04254e2594d505a7d14a7d89', 'S': 'SELL', 'o': 'MARKET', 'f': 'GTC', 'q': '4.80000000', 'p': '0.00000000', 'P': '0.00000000', 'F': '0.00000000', 'g': -1, 'C': '', 'x': 'TRADE', 'X': 'FILLED', 'r': 'NONE', 'i': 1291098740, 'l': '4.80000000', 'z': '4.80000000', 'L': '20.92850000', 'n': '0.10045680', 'N': 'USDT', 'T': 1610824401562, 't': 68965818, 'I': 2647974737, 'w': False, 'm': False, 'M': True, 'O': 1610824401562, 'Z': '100.45680000', 'Y': '100.45680000', 'Q': '100.60670000'}"GET / HTTP/1.1" 200 -

2021-01-16 20:13:21,794 - DEBUG - Event came: {'e': 'outboundAccountPosition', 'E': 1610824401562, 'u': 1610824401562, 'B': [{'a': 'BNB', 'f': '0.00006165', 'l': '0.00000000'}, {'a': 'USDT', 'f': '688.42587600', 'l': '0.00000000'}, {'a': 'LINK', 'f': '0.00604000', 'l': '0.00000000'}]}

bug report - OCO order

Hello Mohammed
Thank you for that great bot
I put OCO order in master account but for slaves bot has bug and just put 1 stop-limit order.
can u please check it?
thank you

Deploy in Share Host

Dear,
Could you please advise if this code can be deployed in share host (python support) or heroku, please?
Since i tried with heroku but still get error

"Application error
An error occurred in the application and your page could not be served. If you are the application owner, check your logs for details. You can do this from the Heroku CLI with the command
heroku logs --tail"

Log:
2020-12-25T04:27:43.615927+00:00 app[api]: Release v3 created by user [email protected]
2020-12-25T04:27:57.000000+00:00 app[api]: Build succeeded
2020-12-25T04:28:01.540544+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path="/" host=abc-copy-trade.herokuapp.com request_id=ffc42758-9c35-4021-be62-7b8d5c45260c fwd="42.113.184.88" dyno= connect= service= status=503 bytes= protocol=https
2020-12-25T04:28:02.810041+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path="/favicon.ico" host=abc-copy-trade.herokuapp.com request_id=64c25745-d404-40fc-8fa3-96336d216edb fwd="42.113.184.88" dyno= connect= service= status=503 bytes= protocol=https
2020-12-25T04:28:16.329642+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path="/" host=abc-copy-trade.herokuapp.com request_id=458cd8dd-6070-48f1-a07c-7d038e279d6e fwd="42.113.184.88" dyno= connect= service= status=503 bytes= protocol=https
2020-12-25T04:29:35.066784+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path="/" host=abc-copy-trade.herokuapp.com request_id=45ba567d-bb4f-4933-bc8c-028ff3a22f2a fwd="42.113.184.88" dyno= connect= service= status=503 bytes= protocol=https
2020-12-25T04:29:35.463267+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path="/favicon.ico" host=abc-copy-trade.herokuapp.com request_id=790dee78-0ba6-459c-b9e1-eda110c2a167 fwd="42.113.184.88" dyno= connect= service= status=503 bytes= protocol=https
2020-12-25T04:35:09.717328+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path="/" host=abc-copy-trade.herokuapp.com request_id=ec4443c2-90c0-46bf-8c2e-966694f8d4ae fwd="42.113.184.88" dyno= connect= service= status=503 bytes= protocol=https
2020-12-25T04:35:10.493165+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path="/favicon.ico" host=abc-copy-trade.herokuapp.com request_id=eab5130c-8289-4906-b380-6d7e1c852fb8 fwd="42.113.184.88" dyno= connect= service= status=503 bytes= protocol=https

Appreciate your help to give me a hint how to deploy it in web rather than local host (any share host or heroku, please), thank you very much for great code.
Regards,

I cannot start project

Dear friend, I'm sorry I'm not an experienced python programmer. I cannot start project.
I did everything as in the instructions:
======= RESTART: D:\Install\OpenServer\domains\Crypto-Copy-Trader\api.py =======
Traceback (most recent call last):
File "D:\Install\OpenServer\domains\Crypto-Copy-Trader\api.py", line 5, in
from Helpers.Helpers import server_begin
File "D:\Install\OpenServer\domains\Crypto-Copy-Trader\Helpers\Helpers.py", line 2, in
from SlaveContainer import SlaveContainer
File "D:\Install\OpenServer\domains\Crypto-Copy-Trader\SlaveContainer.py", line 2, in
from ExchangeInterfaces.BinanceExchange import BinanceExchange
File "D:\Install\OpenServer\domains\Crypto-Copy-Trader\ExchangeInterfaces\BinanceExchange.py", line 4, in
from binance.exceptions import BinanceAPIException
ModuleNotFoundError: No module named 'binance'

Feature Request: Notification System for users.

Feature request for possible Twitter Feed, Discord Webhook or Telegram Notification

When the master trade is opened,modified or closed and its copied to the salve account (opened, modified or closed)
Then i would like to be notified of these change via either twitter, discord webhook, or telegram

how to set the ratio for different slave accounts?

how to set the ratio for slave 1 or slave2 accounts?
for example,the main account invest 100 usd and the slave 1 1000 and slave2 50.
is it only support the same amount on the copy trade for the main accounts?

Deploying in Share Hosting

Dear all,
I am also really interested in deploying the code in sharing hosting, however, I still stuck and it say error message "500 unable to connect to the server". I really appreciate if anyone can share any hint on deploying this code in sharing hosting.
Thank you very much.

Originally posted by @balancetri in #42 (comment)

can not place an order when change from sxpbtc to linkbtc pair.

the system working on sxpbtc pair,and i want to change it to linkbtc this error happen.

2020-11-16 20:51:40,406 - ERROR - Error in master.process_event()
Traceback (most recent call last):
File "/root/copyusdt/SlaveContainer.py", line 53, in on_event_handler
p_event = self.master.process_event(event)
File "/root/copyusdt/ExchangeInterfaces/BinanceExchange.py", line 138, in process_event
self.get_part(order_event['s'], order_event['q'], order_event['p'], order_event['S']),
File "/root/copyusdt/ExchangeInterfaces/BinanceExchange.py", line 202, in get_part
balance = float(get_context_balance(symbol)['free'])
File "/root/copyusdt/ExchangeInterfaces/BinanceExchange.py", line 186, in _get_balance_market_by_symbol
return list(filter(lambda el: el['asset'] == symbol[3:], self.get_balance()))[0]
IndexError: list index out of range
Unhandled Error
Traceback (most recent call last):
File "/usr/local/lib/python3.7/dist-packages/twisted/python/log.py", line 103, in callWithLogger
return callWithContext({"system": lp}, func, *args, **kw)
File "/usr/local/lib/python3.7/dist-packages/twisted/python/log.py", line 86, in callWithContext
return context.call({ILogContext: newCtx}, func, *args, **kw)
File "/usr/local/lib/python3.7/dist-packages/twisted/python/context.py", line 122, in callWithContext
return self.currentContext().callWithContext(ctx, func, *args, **kw)
File "/usr/local/lib/python3.7/dist-packages/twisted/python/context.py", line 85, in callWithContext
return func(*args,**kw)
--- ---
File "/usr/local/lib/python3.7/dist-packages/twisted/internet/posixbase.py", line 614, in _doReadOrWrite
why = selectable.doRead()
File "/usr/local/lib/python3.7/dist-packages/twisted/internet/tcp.py", line 243, in doRead
return self._dataReceived(data)
File "/usr/local/lib/python3.7/dist-packages/twisted/internet/tcp.py", line 249, in _dataReceived
rval = self.protocol.dataReceived(data)
File "/usr/local/lib/python3.7/dist-packages/twisted/protocols/tls.py", line 330, in dataReceived
self._flushReceiveBIO()
File "/usr/local/lib/python3.7/dist-packages/twisted/protocols/tls.py", line 295, in _flushReceiveBIO
ProtocolWrapper.dataReceived(self, bytes)
File "/usr/local/lib/python3.7/dist-packages/twisted/protocols/policies.py", line 120, in dataReceived
self.wrappedProtocol.dataReceived(data)
File "/usr/local/lib/python3.7/dist-packages/autobahn/twisted/websocket.py", line 290, in dataReceived
self._dataReceived(data)
File "/usr/local/lib/python3.7/dist-packages/autobahn/websocket/protocol.py", line 1206, in _dataReceived
self.consumeData()
File "/usr/local/lib/python3.7/dist-packages/autobahn/websocket/protocol.py", line 1218, in consumeData
while self.processData() and self.state != WebSocketProtocol.STATE_CLOSED:
File "/usr/local/lib/python3.7/dist-packages/autobahn/websocket/protocol.py", line 1578, in processData
fr = self.onFrameEnd()
File "/usr/local/lib/python3.7/dist-packages/autobahn/websocket/protocol.py", line 1703, in onFrameEnd
self._onMessageEnd()
File "/usr/local/lib/python3.7/dist-packages/autobahn/twisted/websocket.py", line 318, in _onMessageEnd
self.onMessageEnd()
File "/usr/local/lib/python3.7/dist-packages/autobahn/websocket/protocol.py", line 627, in onMessageEnd
self._onMessage(payload, self.message_is_binary)
File "/usr/local/lib/python3.7/dist-packages/autobahn/twisted/websocket.py", line 321, in _onMessage
self.onMessage(payload, isBinary)
File "/usr/local/lib/python3.7/dist-packages/binance/websockets.py", line 32, in onMessage
self.factory.callback(payload_obj)
File "/root/copyusdt/SlaveContainer.py", line 57, in on_event_handler
if p_event is None:
builtins.UnboundLocalError: local variable 'p_event' referenced before assignment

Unhandled Error
Traceback (most recent call last):
File "/usr/local/lib/python3.7/dist-packages/binance/websockets.py", line 586, in run
reactor.run(installSignalHandlers=False)
File "/usr/local/lib/python3.7/dist-packages/twisted/internet/base.py", line 1283, in run
self.mainLoop()
File "/usr/local/lib/python3.7/dist-packages/twisted/internet/base.py", line 1295, in mainLoop
self.doIteration(t)
File "/usr/local/lib/python3.7/dist-packages/twisted/internet/epollreactor.py", line 235, in doPoll
log.callWithLogger(selectable, _drdw, selectable, fd, event)
--- ---
File "/usr/local/lib/python3.7/dist-packages/twisted/python/log.py", line 103, in callWithLogger
return callWithContext({"system": lp}, func, *args, **kw)
File "/usr/local/lib/python3.7/dist-packages/twisted/python/log.py", line 86, in callWithContext
return context.call({ILogContext: newCtx}, func, *args, **kw)
File "/usr/local/lib/python3.7/dist-packages/twisted/python/context.py", line 122, in callWithContext
return self.currentContext().callWithContext(ctx, func, *args, **kw)
File "/usr/local/lib/python3.7/dist-packages/twisted/python/context.py", line 85, in callWithContext
return func(*args,**kw)
File "/usr/local/lib/python3.7/dist-packages/twisted/internet/posixbase.py", line 627, in _doReadOrWrite
self._disconnectSelectable(selectable, why, inRead)
File "/usr/local/lib/python3.7/dist-packages/twisted/internet/posixbase.py", line 258, in _disconnectSelectable
selectable.connectionLost(failure.Failure(why))
File "/usr/local/lib/python3.7/dist-packages/twisted/internet/tcp.py", line 519, in connectionLost
self._commonConnection.connectionLost(self, reason)
File "/usr/local/lib/python3.7/dist-packages/twisted/internet/tcp.py", line 327, in connectionLost
protocol.connectionLost(reason)
File "/usr/local/lib/python3.7/dist-packages/twisted/protocols/tls.py", line 398, in connectionLost
self._flushReceiveBIO()
File "/usr/local/lib/python3.7/dist-packages/twisted/protocols/tls.py", line 295, in _flushReceiveBIO
ProtocolWrapper.dataReceived(self, bytes)
File "/usr/local/lib/python3.7/dist-packages/twisted/protocols/policies.py", line 120, in dataReceived
self.wrappedProtocol.dataReceived(data)
File "/usr/local/lib/python3.7/dist-packages/autobahn/twisted/websocket.py", line 290, in dataReceived
self._dataReceived(data)
File "/usr/local/lib/python3.7/dist-packages/autobahn/websocket/protocol.py", line 1206, in _dataReceived
self.consumeData()
File "/usr/local/lib/python3.7/dist-packages/autobahn/websocket/protocol.py", line 1218, in consumeData
while self.processData() and self.state != WebSocketProtocol.STATE_CLOSED:
File "/usr/local/lib/python3.7/dist-packages/autobahn/websocket/protocol.py", line 1570, in processData
fr = self.onFrameData(payload)
File "/usr/local/lib/python3.7/dist-packages/autobahn/websocket/protocol.py", line 1665, in onFrameData
self._onMessageFrameData(payload)
File "/usr/local/lib/python3.7/dist-packages/autobahn/twisted/websocket.py", line 309, in _onMessageFrameData
self.onMessageFrameData(payload)
File "/usr/local/lib/python3.7/dist-packages/autobahn/websocket/protocol.py", line 601, in onMessageFrameData
self.frame_data.append(payload)
builtins.AttributeError: 'NoneType' object has no attribute 'append'

Order not placed on slave

I am unable to place orders on the salve account. I am using the master branch and the trade pair used is RENUSDT

Config and Command prompt window
image

Pair used RENUSDT (Limit order placed via binance.com on master account)
image

Slave account - No Limit order replicated.

image

The amount of the deal

Hello
I need help
When purchasing with the main account
Worth $ 100
The purchase is made by the servant
1000 dollars
Because of the ratio, is it possible to verify the quantity and then the ratio?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.