Skip to content
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 feature: trailing SL in % from ATH since entry (refresh each X seconds) #43

Closed
alejandrobailo opened this issue Nov 2, 2021 · 6 comments

Comments

@alejandrobailo
Copy link

Hi,
first of all, awesome work and thanks a lot!

I think would be fine to set a SL trailing of a x% under the maximum value of the token since the entry.

E.j.

Entry 0.1
SL 10% 0.09
Trainling SL 5%
... 1h later
Value 0.3
SL 0.25

@beeb
Copy link
Owner

beeb commented Nov 2, 2021

Hello,

I think what you want to do can be achieved with 2 orders like so:

  • Order 1: stop loss 0.09
  • Order 2: take profit at price 0.105 with trailing stop loss 5%

Example 1:
Entry price 0.1
Price moves above 0.105 -> order 2 starts monitoring
Price moves to 0.3 ATH since entry -> order 2 is monitoring
Price moves below 0.285 -> order 2 triggers (5% drop from ATH) -> sell

Example 2:
Entry price 0.1
Price moves down below 0.09 -> order 1 triggers -> sell

You can choose the activation price for order 2 so it doesn't sell too early for your taste.

@alejandrobailo
Copy link
Author

But as I understood, bot says:

OK, I will sell when the price of TOKEN reaches x BNB per token.
Next, how much TOKEN do you want me to use for selling?
You can also use scientific notation like x or a percentage like 63%.
Current balance: x TOKEN

That means bot will sell when the Take profit will be reached, in your example 1 when 0.105

@beeb
Copy link
Owner

beeb commented Nov 2, 2021

Okay I think this is just a matter of bad documentation and/or messages.

When trailing stop loss (tsl) is activated on a sell order, the order will only execute once the price drops by X% compared to the maximum price during the monitoring period. Monitoring period starts when the price goes above the price value from the order.

@beeb beeb closed this as completed Nov 2, 2021
@alejandrobailo
Copy link
Author

Thanks, just to know which is the refresh rate of the monitoring? (in seconds I guess)

@beeb
Copy link
Owner

beeb commented Nov 2, 2021

Can be configured in the config file. Default is 5 seconds

@beeb beeb self-assigned this Nov 2, 2021
@beeb
Copy link
Owner

beeb commented Nov 2, 2021

Keep in mind that the more tokens you have added or the slower the RPC you use, the more time the script will need to get all the token prices. So effectively it could be slower than the specified amount.

@beeb beeb removed their assignment Nov 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants