Closed daryl552007 closed 3 years ago
Not having entries in the execution log is totally normal. There shouldn't be much in there unless a trade was executed (or would have been executed if running with test mode on).
There isn't enough information to debug what happened from that error. Is there more in the log? Is this still happening? Sorry I missed this issue
Hi Bmino,
no problem. I am not getting the error anymore. I am not getting any trades though. Been running this for weeks now.
checked performance.log and I see below. are these figures ok?
[12/30/2020, 12:32:12 PM] DEBUG : Cycles done per second: 2.00 [12/30/2020, 12:32:12 PM] DEBUG : Clock usage for cycles: 43.36% [12/30/2020, 12:32:12 PM] DEBUG : CPU Load: 153% [100%] [12/30/2020, 12:32:12 PM] DEBUG : API Latency: 81 ms
[12/30/2020, 2:16:16 PM] DEBUG : Cycles done per second: 2.05 [12/30/2020, 2:16:16 PM] DEBUG : Clock usage for cycles: 42.59% [12/30/2020, 2:16:16 PM] DEBUG : CPU Load: 155% [100%] [12/30/2020, 2:16:16 PM] DEBUG : API Latency: 120 ms
I am also seeing a lot of these: [12/30/2020, 12:32:12 PM] WARN : Ask depth (0) too shallow to convert 0.0015 BTC to PIVX using PIVXBTC [12/30/2020, 12:32:12 PM] WARN : Bid depth (0) too shallow to convert 129 WAN to ETH using WANETH [12/30/2020, 12:32:12 PM] WARN : Ask depth (0) too shallow to convert 0.0015 BTC to LUNA using LUNABTC
personally, are the default settings what you are using so that you get trades? if not, what do you recommend like the starting currency, min, max and profit values?
Also, if we use the parallel approach for the script, what if we want to limit our currencies on BTC, ETH, and LTC? That would mean that trades wont come often right as it has to be those exact 3 currencies that are involved in that triangle?
thank you so much!
You are correct on how parallel works!
I see your cpu is completely exhausted running this bot :( Latency is okay but I want to see that near the trade execution latency which is about 20ms in my experience.
Those error messages will happen when a sweet disconnects which is likely happening because of the lack of cpu resources to handle ping/pong frames
I tweak those settings to really jack performance up haha but have typically gotten burnt by long trade times such as 15ms+
what can you suggest so that so that the cpu doesnt get exhausted?
by getting burnt by long trade times, so you mean you havent got trades lately as well?
what size ec2 instance are you using?
thanks
Haha if getting a better cpu or a vps isn't an option the SCANNING.TIMEOUT
config option is there for ya xD
Take a gander at the config readme, but the short story is to set this to where the logged "Clock usage for cycles" is low
I run with a spot instance of a c5n.large
thanks Bmino!
Another question, I was working with trades starting with BTC. the assumption here is that my trades start from BTC and will also end with BTC, or isnt that the case?
The problem I am having is that I am running out of BTC from my wallet as the balance is spread out on other coins. what should be done to prevent this and just have my balance stay with BTC or whatever I set as the initial currency?
thanks
You are correct, the base currency is where the trades start and end. You must have enough of this asset to cover the investment max quantity.
You can lower the investment max quantity to match whatever you are currently holding of your base asset, change your base asset to something else you hold, or consolidate your holdings some
Hi Bmino, I was actually starting with just BTC having balance. after some time running though, the BTC asset was lower, but it is just scattered among other currencies. But if you check the overall balance, accumulating all currencies as BTC value, it is actually higher.
any idea on why this could be happening and how we can prevent this?
thanks
If BTC was converted into something with a trade and was not converted back to BTC at the end, there would have been an error message in the logs since a trade would have failed. Are you seeing errors?
Unless you are performing trades yourself perhaps?
No, I wasnt performing any trades manually. I actually turned the logs to silent lol to counterpart the cpu usage I mentioned last time. Will turn it back on just to test.
below are the latest trades performed:
I'm having trouble tracking the triangular pairs in this timeframe. Was there a BTC/SOL/BNB or BTC/BNB/SOL at 21:06? The sequential order doesn't look right
Hi Bmino,
that is what confuses me. What I am showing you are what I am seeing as well. So, could it be that the trade process back to BTC didnt complete? If so what could be the reason?
thanks
Hi Bmino,
Here is another trade that could further give us hints on what could be causing it. It still ends with ETH so I end up having funds on ETH instead of my base asset BTC
The order of trades still doesn't make sense. In this example you acquire 81 BQX and then only convert 64 (25 + 16 + 23)
Do you have BNB enabled to pay trading fees? What is showing in the logs?
How about that 17 under where we convert 23? that would make it 64 + 17 =81 right?
for BNB yes, it is enabled. right now in the logs i have set it to errors. what should be the setting so that we can track this? I am not seeing anything in them except from the error I got when my BNB was not enough to cover the fees, so I acquired some
here is the latest, I seem to lose when there are multiple trades involved like this:
but all is ok when there are just 3 trades involved
Hi Bmino,
here is what I am getting from the logs:
execution log
[1/19/2021, 10:44:58 AM] [32mINFO[39m : [36mAttempting to execute BTC-ENJ-BNB with an age of 159 ms and expected profit of 0.1566%[39m [1/19/2021, 10:44:58 AM] [32mINFO[39m : [36mBuying 210 ENJBTC @ market price[39m [1/19/2021, 10:44:58 AM] [32mINFO[39m : [36mSuccessfully bought 210.00000000 ENJBTC @ a quote of 0.00200340 in 16 ms[39m [1/19/2021, 10:44:58 AM] [32mINFO[39m : [36mSelling 210 ENJBNB @ market price[39m [1/19/2021, 10:44:58 AM] [32mINFO[39m : [36mSuccessfully sold 210.00000000 ENJBNB @ a quote of 1.62015000 in 13 ms[39m [1/19/2021, 10:44:58 AM] [32mINFO[39m : [36mSelling 1.62 BNBBTC @ market price[39m [1/19/2021, 10:44:58 AM] [32mINFO[39m : [36mSuccessfully sold 1.62000000 BNBBTC @ a quote of 0.00199989 in 13 ms[39m [1/19/2021, 10:44:58 AM] [32mINFO[39m : [36mExecuted BTC-ENJ-BNB position in 46 ms[39m [1/19/2021, 10:44:58 AM] [34mDEBUG[39m : [36mENJBTC Stats:[39m [1/19/2021, 10:44:58 AM] [34mDEBUG[39m : [36mExpected Conversion: 0.00199080 BTC into 210.00000000 ENJ @ 0.00000948[39m [1/19/2021, 10:44:58 AM] [34mDEBUG[39m : [36mObserved Conversion: 0.00200340 BTC into 210.00000000 ENJ @ 0.00000954[39m [1/19/2021, 10:44:58 AM] [34mDEBUG[39m : [36mPrice Change: 0.63291139%[39m [1/19/2021, 10:44:58 AM] [34mDEBUG[39m : [1/19/2021, 10:44:58 AM] [34mDEBUG[39m : [36mENJBNB Stats:[39m [1/19/2021, 10:44:58 AM] [34mDEBUG[39m : [36mExpected Conversion: 210.00000000 ENJ into 1.62015000 BNB @ 0.00771500[39m [1/19/2021, 10:44:58 AM] [34mDEBUG[39m : [36mObserved Conversion: 210.00000000 ENJ into 1.62015000 BNB @ 0.00771500[39m [1/19/2021, 10:44:58 AM] [34mDEBUG[39m : [36mPrice Change: 0.00000000%[39m [1/19/2021, 10:44:58 AM] [34mDEBUG[39m : [1/19/2021, 10:44:58 AM] [34mDEBUG[39m : [36mBNBBTC Stats:[39m [1/19/2021, 10:44:58 AM] [34mDEBUG[39m : [36mExpected Conversion: 1.62000000 BNB into 0.00199989 BTC @ 0.00123450[39m [1/19/2021, 10:44:58 AM] [34mDEBUG[39m : [36mObserved Conversion: 1.62000000 BNB into 0.00199989 BTC @ 0.00123450[39m [1/19/2021, 10:44:58 AM] [34mDEBUG[39m : [36mPrice Change: 0.00000000%[39m [1/19/2021, 10:44:58 AM] [32mINFO[39m : [1/19/2021, 10:44:58 AM] [32mINFO[39m : [36mBTC delta: -0.00000351 (-0.1752%)[39m [1/19/2021, 10:44:58 AM] [32mINFO[39m : [36mENJ delta: 0.00000000 ( 0.0000%)[39m [1/19/2021, 10:44:58 AM] [32mINFO[39m : [36mBNB delta: 0.00015000 ( 0.0093%)[39m [1/19/2021, 10:44:58 AM] [32mINFO[39m : [36mBNB fees: -0.00366643[39m
performance log
[1/19/2021, 10:44:48 AM] [34mDEBUG[39m : [36mCycles done per second: 3.80[39m [1/19/2021, 10:44:48 AM] [34mDEBUG[39m : [36mClock usage for cycles: 4.95%[39m [1/19/2021, 10:44:48 AM] [34mDEBUG[39m : [36mCPU Load: 15% [13%][39m [1/19/2021, 10:44:48 AM] [34mDEBUG[39m : [36mAPI Latency: 13 ms[39m
and here is from another trade,
[1/19/2021, 11:26:22 AM] [32mINFO[39m : [36mAttempting to execute BTC-ENJ-ETH with an age of 54 ms and expected profit of 0.4453%[39m [1/19/2021, 11:26:22 AM] [32mINFO[39m : [36mBuying 141 ENJBTC @ market price[39m [1/19/2021, 11:26:22 AM] [32mINFO[39m : [36mSuccessfully bought 141.00000000 ENJBTC @ a quote of 0.00149601 in 14 ms[39m [1/19/2021, 11:26:22 AM] [32mINFO[39m : [36mSelling 141 ENJETH @ market price[39m [1/19/2021, 11:26:22 AM] [32mINFO[39m : [36mSuccessfully sold 141.00000000 ENJETH @ a quote of 0.03965766 in 11 ms[39m [1/19/2021, 11:26:22 AM] [32mINFO[39m : [36mSelling 0.039 ETHBTC @ market price[39m [1/19/2021, 11:26:22 AM] [32mINFO[39m : [36mSuccessfully sold 0.03900000 ETHBTC @ a quote of 0.00146948 in 15 ms[39m [1/19/2021, 11:26:22 AM] [32mINFO[39m : [36mExecuted BTC-ENJ-ETH position in 42 ms[39m [1/19/2021, 11:26:22 AM] [34mDEBUG[39m : [36mENJBTC Stats:[39m [1/19/2021, 11:26:22 AM] [34mDEBUG[39m : [36mExpected Conversion: 0.00149601 BTC into 141.00000000 ENJ @ 0.00001061[39m [1/19/2021, 11:26:22 AM] [34mDEBUG[39m : [36mObserved Conversion: 0.00149601 BTC into 141.00000000 ENJ @ 0.00001061[39m [1/19/2021, 11:26:22 AM] [34mDEBUG[39m : [36mPrice Change: 0.00000000%[39m [1/19/2021, 11:26:22 AM] [34mDEBUG[39m : [1/19/2021, 11:26:22 AM] [34mDEBUG[39m : [36mENJETH Stats:[39m [1/19/2021, 11:26:22 AM] [34mDEBUG[39m : [36mExpected Conversion: 141.00000000 ENJ into 0.04000875 ETH @ 0.00028375[39m [1/19/2021, 11:26:22 AM] [34mDEBUG[39m : [36mObserved Conversion: 141.00000000 ENJ into 0.03965766 ETH @ 0.00028126[39m [1/19/2021, 11:26:22 AM] [34mDEBUG[39m : [36mPrice Change: -0.87753304%[39m [1/19/2021, 11:26:22 AM] [34mDEBUG[39m : [1/19/2021, 11:26:22 AM] [34mDEBUG[39m : [36mETHBTC Stats:[39m [1/19/2021, 11:26:22 AM] [34mDEBUG[39m : [36mExpected Conversion: 0.04000000 ETH into 0.00150716 BTC @ 0.03767900[39m [1/19/2021, 11:26:22 AM] [34mDEBUG[39m : [36mObserved Conversion: 0.03900000 ETH into 0.00146948 BTC @ 0.03767897[39m [1/19/2021, 11:26:22 AM] [34mDEBUG[39m : [36mPrice Change: -0.00006805%[39m [1/19/2021, 11:26:22 AM] [32mINFO[39m : [1/19/2021, 11:26:22 AM] [32mINFO[39m : [36mBTC delta: -0.00002653 (-1.7734%)[39m [1/19/2021, 11:26:22 AM] [32mINFO[39m : [36mENJ delta: 0.00000000 ( 0.0000%)[39m [1/19/2021, 11:26:22 AM] [32mINFO[39m : [36mETH delta: 0.00065766 ( 1.6863%)[39m [1/19/2021, 11:26:22 AM] [32mINFO[39m : [36mBNB fees: -0.00272181[39m [1/19/2021, 11:26:22 AM] [32mINFO[39m : [1/19/2021, 11:26:22 AM] [32mINFO[39m : [36mCannot exceed user defined execution cap of 1 executions[39m
on this last trade starting BTC was 0.02012568 and then after the trade I had 0.02009915, so I had some loss instead of profit
plz plz please copy the error from a terminal window like nano, vi, vim, etc. to avoid those color formatting characters appearing. It's so much easier to read through :)
Your cpu load is fine, and the latency looks comparable to the best values I have gotten.
In the logs above you are right, I overlooked that 17 which makes sense. What you are seeing is an order being fulfilled with a quantity that spans multiple depths. So you have one trade for for depth 1, then another trade at a slightly higher price at depth 2, etc. This is calculated in the bot so no worries here.
Things I notice:
Trade 1 has an initial age of 153ms which is big. This should be ideally 1ms and can be filtered via the age threshold.
In trade 1 you notice that the calculated AB price has moved about 0.63% unfavorably while BC and CA moved 0%. This is due to the huge age.
Trade 2 has a better initial age of 54ms which is still big
In trade 2 the AB leg ran as calculated, and the BC leg executed at a higher price than expected getting less ETH. This lesser quantity of ETH was then converted into ofcourse less BTC but also at a worse price than calculated. Traditionally I've seen errors in the 3rd leg more than the first because the 1st and 2nd leg had to have completed before which took time and allows for market slippage
Hi Bmino,
i dropped the age threshold to 100ms, but still when I got a trade I am still losing
here is the log
Still gotta go lower haha. The age threshold shouldn't be higher than your trade times. I put my threshold at 15ms or sometimes 10ms
Thanks Bmino,
but when I lowered it to 15, even 10ms, I havent been getting any trades at all. What else should I be looking at?
You gotta wait for the market to be inefficient, which (in theory) shouldn't happen in the first place. This is why the config is there with those options. You can narrow the execution window with tighter thresholds or timings, or expand the execution window with the opposite. Currently, I'm not so sure it matters soo much since the trade execution times themselves seem to be too slow for acting on a position even identified within 1 ms.
I'm gonna close this issue since it has drifted to become a discussion board of sorts. Feel free to open a new issue with any specific questions etc. you've got
Hi Bmino,
all was good for the first day I ran the script then on the second day I get the error below: on the binance.log and when I run it now, I am not getting new entries on the execution.log except "initializing"
[11/27/2020, 12:45:22 AM] ERROR : _readableState: { "objectMode": false, "highWaterMark": 16384, "buffer": { "head": null, "tail": null, "length": 0 }, "length": 0, "pipes": null, "pipesCount": 0, "flowing": true, "ended": true, "endEmitted": true, "reading": false, "sync": true, "needReadable": false, "emittedReadable": false, "readableListening": false, "resumeScheduled": false, "paused": false, "emitClose": true, "autoDestroy": false, "destroyed": false, "defaultEncoding": "utf8", "awaitDrain": 0, "readingMore": true, "decoder": null, "encoding": null } readable: false _events: { "end": [ null, null, null ], "close": [ null, null ] } _eventsCount: 4 socket: { "_tlsOptions": { "pipe": false, "secureContext": { "context": {}, "singleUse": true },