-
Notifications
You must be signed in to change notification settings - Fork 124
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add trailing stop loss. #22
base: main
Are you sure you want to change the base?
Conversation
SniperService.cs
Outdated
@@ -192,6 +192,7 @@ private async Task PairCreated(PairCreatedEvent pair) | |||
Log.Logger.Information("Buying Token pair: {0} WHITELISTED ADDRESS: {1}", symbol, addressWhitelisted); | |||
} | |||
await _tradeHandler.Buy(otherPairAddress, otherTokenIdx, pair.Pair, _sniperConfig.AmountToSnipe); | |||
await _tradeHandler.Approve(otherPairAddress); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a reason we approve the pair after buying?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. Assuming you turn of the honeypot detection, It never approves the pair before the actual sell. Therefore the sell will fail.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, 1st contributor PR! 💯
just a few comments
Will merge in later on today and create a new release. Good stuff @twilker |
…it did not check whether a buy was placed or not.
Added a small fix, as it was approving every time liquidity was added. |
Hello guys, with SniperService.cs modified by twilker and the •original repo files from JayArrowz the bot now approve but fails same to sell with this error Fail with error 'PancakeRouter: INSUFFICIENT_OUTPUT_AMOUNT€' Thanks for your work •Original repo files i mean the latest files provided by JayArrowz |
I added the possibility to set a trailing stop loss. With that it is possible to get out before the target profit percentage when a certain stop loss occurred. It also enables the function to find the peak by only setting the stop loss. To achieve this the target profit has to be set to a ridiculous amount.