Closed mthad closed 2 years ago
tried with release 0.7.9 it worked. but not with main branch. I close this issue
Why close an issue which isn't fixed?
I think you need to read the documentation and add AccountRead rights to your 3Commas API key
Hi, sorry for closing it too early, mistake on my side. Regarding your suggestion, I already set 3Commas API Key with this parameter. my API key - BotsRead, BotsWrite, AccoundsRead:
Ok will check, thanks
Hi,
in the function named def get_threecommas_account(accountid):
this piece of code seems to cause the issue (line 299):
additional_headers={"Forced-Mode": "real"}
I commented it and it worked
Did a quick check and it's also present in the code of the following scripts:
Repoduced the issue on galaxyscore.py
, altrank.py
, compound.py
, coinmarketcap.py
After commenting the concerned line it worked.
Did not test with watchlist.py
, watchlist_100eye.py
But without it real mode doesn't work correctly when you put the webinterface in paper mode I think (it was an issue a while ago) Can you test this? If this is the case we need to reinstate the old accountmode setting and use that, but it means we cannot run mixed bots (paper/real)
Maybe they (3Commas) changed this behavior to work with all modes now, since it was strange behavior anyway.
Hi,
Scenario tested with galaxyscore.py (commented the line additional_headers={"Forced-Mode": "real"}
):
From the official documentation of 3commas API: " By default, API mode(real or paper) synchronized with mode in web/app. You can set a forced mode for public API through the request header "Forced-Mode" with values "real" or "paper"."
(speculation) It's probably true and matters for other actions through this api, but in our case, because we specify botids, it looks like it doesn't matter to be in real or paper account in webinterface. Ids are unique
@mthad I know about that text. But the issue is to determine the correct mode I have to get the market_code of an account_id linked to a botid. And if this request also needs the correct mode for that account (which it the case, it turns out) We have a chicken and egg problem. I cannot rely on the account_name in the bot for this, this can be "Paper account 12345" or "Test account" or something else.
To recap: I use the get_threecommas_account(accountid) code to get the market_code which tells me which market the bot is connected too, 'binance' for binance and 'paper_trading' if link to paper account.
I would expect I can read both ids (from paper and real botid) with mode is 'real' but this fails sometime as you pointed out, and without it the reading of the 'real' account fails if web interface is in paper mode.
There is other code, but this switched the mode (not only for a webcall) this is also unwanted...
@mthad Working solution it seems: I first read account data in paper mode, if this doesn't give me the market_code for theaccount_id I read it again using real mode ;-)
@mthad can you test with latest version?
Hi, @cyberjunky, tested with new version (main branch), worked successfully in scenario below. Scenario tested with galaxyscore.py:
switched on paper account on web interface, launched galaxyscore.py with botids of real account in galaxyscore.ini --> Result: Bot id in real account successfully updated with the right pairs.
switched on real account on webinterface, launched galaxyscore.py with botids of paper account in galaxyscore.ini --> Result: Bot id in paper account successfully updated with the right pairs.
Thanks for the fix ;-). Happy new year :-)!
@mthad Thank you for reporting and testing, have a happy new year too! :champagne:
Describe the bug Hello, First of all thank you for sharing this amazing tools!
I tried to use galaxyscore.py using docker with paper account on 3 commas. When I start the container, I get this error message:
Environment:
Additional context I am using paper account on 3 commas
Thanks for your help