21jake / Binance-volatility-trading-bot-JS

This Binance trading bot detects the most volatile cryptos to buy and later sell at predefined Take Profit / Stop Loss thresholds.
MIT License
35 stars 6 forks source link

Interference between safe mode and price check #11

Open daddywookie opened 3 years ago

daddywookie commented 3 years ago

I'm seeing some double entries at the same time stamp which appears to be the INTERVAL script and the safe mode script running at the same time. See 11:16 on the following logs. The price increase calculations seem to be adding together as well.

Purchased at: 0.3496 Max during ownership: 0.3850 (gain of 10.1%)

[26/05/2021, 11:11:34] The price of RAMPUSDT has increased 6.78% within last 5 minutes... [26/05/2021, 11:11:34] Successfully place an order: {"symbol":"RAMPUSDT","quantity":142.93,"orderId":36363922,"bought_at":0.3496,"TP_Threshold":0.360088,"SL_Threshold":0.339112,"purchase_time":"26/05/2021, 11:11:34","purchase_time_unix":1622023894804,"updated_at":"26/05/2021, 11:11:34"} [26/05/2021, 11:12:34] RAMPUSDT price hasn't hit SL threshold during this scan and the asset is kept [26/05/2021, 11:13:34] RAMPUSDT price hasn't hit SL threshold during this scan and the asset is kept [26/05/2021, 11:14:34] RAMPUSDT price hasn't hit SL threshold during this scan and the asset is kept [26/05/2021, 11:15:33] RAMPUSDT price hasn't hit SL threshold during this scan and the asset is kept [26/05/2021, 11:16:33] The price of RAMPUSDT has increased 7.15% within last 5 minutes... [26/05/2021, 11:16:33] Error in executing buying volatiles function: "Error in calculating quantity: \"Current portfolio value exceeds the initial quantity, waiting for the current asset(s) to be sold first...\"" [26/05/2021, 11:16:33] The RAMPUSDT has hit TP threshold and we continue to hold as TRAILING MODE activated [26/05/2021, 11:16:34] RAMPUSDT price hasn't hit SL threshold during this scan and the asset is kept [26/05/2021, 11:16:34] The price of RAMPUSDT has increased 11.33% within last 5 minutes... [26/05/2021, 11:16:34] RAMPUSDT price hasn't hit SL or TP threshold, continue to wait... [26/05/2021, 11:16:34] Error in executing buying volatiles function: "Error in calculating quantity: \"Current portfolio value exceeds the initial quantity, waiting for the current asset(s) to be sold first...\"" [26/05/2021, 11:17:34] RAMPUSDT price hasn't hit SL threshold during this scan and the asset is kept [26/05/2021, 11:18:34] RAMPUSDT price hasn't hit SL threshold during this scan and the asset is kept [26/05/2021, 11:19:33] RAMPUSDT price hasn't hit SL threshold during this scan and the asset is kept [26/05/2021, 11:20:34] RAMPUSDT price hasn't hit SL threshold during this scan and the asset is kept [26/05/2021, 11:21:33] Wait for the bot to gather data to check price volatility... [26/05/2021, 11:21:34] RAMPUSDT price hasn't hit SL threshold during this scan and the asset is kept [26/05/2021, 11:21:34] RAMPUSDT price hasn't hit SL or TP threshold, continue to wait... [26/05/2021, 11:24:11] RAMPUSDT price has hit SL threshold [26/05/2021, 11:24:11] The asset RAMPUSDT has been sold sucessfully at the profit of 0.94% and recorded in sold-assets.json [26/05/2021, 11:24:11] RAMPUSDT price hasn hit SL threshold during this scan and the asset is sold [26/05/2021, 11:24:12] Error in scanning Error in selling asset when it hits SL threshold: Error in selling 142.93 of RAMPUSDT: {"code":-2010,"msg":"Account has insufficient balance for requested action."}

21jake commented 3 years ago

really weird since there're 2 instances of the main() functions running at the same time. I'm working on it.