lmusarella / Pancakeswap-Prediction-Bot-2023

I rewrote the code of the PancakeSwap Prediction Game BOT by bobalice7, removing the malicious code where for each transaction to the smart contract it sent transactions to this wallet 0xfB669b0e0656036D747d6C6F2666e530139d2899.
MIT License
27 stars 8 forks source link

Stop Loss/Daily Goal #12

Closed rootisareservedword closed 1 year ago

rootisareservedword commented 1 year ago

Discussed in https://github.com/lmusarella/Pancakeswap-Prediction-Bot/discussions/11

Originally posted by **rootisareservedword** March 26, 2023 When stop loss or daily goal is reached, what determines when the bot will resume trading? Is there a certain amount of time required to pass? Also, I see the .json history files that get created with statistics, round info, etc which is really helpful. Would it be possible to at least have the statistics (profit, percentage, win, loss, etc.) results written to CSV? I am currently using json2csv npm package via CLI and it works well. Am new to javascript, so my smooth brain is still trying to figure out how to implement it programatically :sweat_smile:

Bot doesn't resume trading unless history files are deleted. Can it be changed to resume trading starting 24 hours after the last trade was placed? Or, maybe not a full 24 hours, but at least reset at the start of the next day?

Thanks!

lmusarella commented 1 year ago

hello, as soon as I return to Italy I will take charge of the request. I am currently on vacation.

lmusarella commented 1 year ago

Yes exactly, when the bot reaches the stop loss or the daily goal, it checks if there are any rounds waiting. If there are no more rounds pending, it closes directly, otherwise it waits for the outcome of the pending rounds.

Yes in csv it could be better, maybe it could be a future feature.

That's right if you delete the stats file history the bot is reset.

Here too I'll see whether to implement something that does it automatically.

rootisareservedword commented 1 year ago

Ok, thank you for explaining. So if I am understanding correctly, the only way to reset the bot is to delete the history files?

As an example, let's say I start the bot at 12 PM and it hits stop loss at 2 PM, so the bot stops. I wait 24 hours and then try to start the bot again at 2 PM the following day, but the bot will not start and throws the "Stop loss or daily goal reached" message. It may not be obvious to the average user that the history files need to be deleted in order for it to resume trading. By saying "Daily", some might assume that the bot could be started at any time 1 day, 2 days, 3 days, etc. later without it automatically stopping.

If a user is using multiple strategies and they have history files for each strategy, deleting them could be time consuming. Sure, it could be scripted, but again not obvious for the average user. Csv files could be useful for analyzing different strategies over a period of time.

Many thanks for this wonderful project and all of your efforts to make it successful!