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

Time limit for buy orders #127

Closed
fsabiu opened this issue Apr 29, 2021 · 14 comments
Closed

Time limit for buy orders #127

fsabiu opened this issue Apr 29, 2021 · 14 comments
Labels
enhancement New feature or request

Comments

@fsabiu
Copy link

fsabiu commented Apr 29, 2021

According to the bot behaviour, once the current price reaches the lowest price, then the bot places a STOP-LOSS-LIMIT order to buy.
However, it often happens that the trigger price is reached after several candles (more than 4 o 5): this scenario indicates that the price is increasing "slowly", so it is more prone to fall. This is a bad scenario, we want to avoid it unless we are sure about the bullish trend (i.e. never).

What about setting a parameter expressing a time limit (expressed either in candles or in minutes) after which the buy order will be deleted if the trigger price is not reached?
In my opinion, on the basis of the current oscillations, this will increase the precision of the buy/sell orders.

The current behaviour could always be replicated by setting a time limit of -1, for example.

@fsabiu fsabiu added the enhancement New feature or request label Apr 29, 2021
@chrisleekr
Copy link
Owner

chrisleekr commented Apr 29, 2021

Hmm, it's interesting.

What is your buy stop/limit percentage? How does the buy order stay a long time? In fact, how long is long?

For some coins, what you say may apply; however, for some coins, it may not.
For example, this CAKEUSDT was +-7% for many days and it sudden increased over 20%.
image

But I guess that is why you mentioned optional configuration.

Can you give me some examples for your scenario?
I mean I see what you say, I am curious what settings you made to stay the buy order long time.

If you configured like 1.025/1.026, it would be executed in a short time (I am just assuming).

@elvishp2006
Copy link

I don't know if it`s related, but the bot put a buy order for almost 5 hours, any tip on params to avoid this scenario?

Captura de Tela 2021-04-29 às 10 06 45
Captura de Tela 2021-04-29 às 10 07 16

@chrisleekr
Copy link
Owner

chrisleekr commented Apr 29, 2021

@elvishp2006 You are trying to buy FIAT to FIAT, which is almost not moving at all.
That is why the buy order will be executed in few days.
Buy coins, not FIAT.

@elvishp2006
Copy link

@chrisleekr thanks, I was trying to convert my main FIAT to another by the lowest price

@chrisleekr
Copy link
Owner

@elvishp2006 oh, in that case, let's wait.

@fsabiu
Copy link
Author

fsabiu commented Apr 29, 2021

Thenk you @chrisleekr , for both your answer and the project itself.

What is your buy stop/limit percentage? How does the buy order stay a long time? In fact, how long is long?
My bot is running with 15 minute candles. With "long time" I mean that the minimum has not a V shape, that is typical during bearish trends!

In order to limit losses (assuming that we don't know whether the general trend is bullish or bearish), my sell parameters are:
Trigger percentage: 1.008
Limit price percentage: 0.992

In this way, when the price rises of 0.8% after the buy, I have a stop loss at (more or less) the price I bought.

Concerning your example, notice that my goal (and those of many traders) is not to take all the possible opportunities.
On one hand, I wish to maximize the precision of the buy orders, i.e. they are the middle point of a V shape.
On the other hand, I would like to reach the trigger percentage as soon as possible in order to minimize the time in which I don't have a stop loss.

For this goal, I think that this optional (you guessed) parameter may help.

The following image shows a scenario that I would like to avoid (BTC), even if it is followed by a rise.
btc

The following three images (ETH, IOTA, LTC) show good scenarios, in which minimums are followed by a growth of at least trigger % within the next 2 candles, so that
(i) we have a V shape
(ii) the time in which we haven't stop loss is minimized.

ETH
eth

IOTA
iota

LTC
ltc

@GrigorovskyA
Copy link

I also thought how it would be possible to implement the behavior of the bot at such moments of the market.
And I have not come up with anything better than to achieve the maximum number of trades with the minimum profit.

  • make a checkbox - take the minimum profit.
  • need to - if profit price in usd * (fee*2) > 0 - sell
    and I think need to create a limit order right away.(not stop-loss-limit)
    But I didn’t think of how it is possible not to lose profit at moments in time - if the coin continues to grow. also keep track of time intervals.

@chrisleekr
Copy link
Owner

@fsabiu
First of all, let me point out your sell parameters. I know it's your strategy.

In order to limit losses (assuming that we don't know whether the general trend is bullish or bearish), my sell parameters are:
Trigger percentage: 1.008
Limit price percentage: 0.992

The above configuration will chew up your money because of the commission. I assume you would know already.

In this way, when the price rises of 0.8% after the buy, I have a stop loss at (more or less) the price I bought.

Technically, it's not selling at the last buy price because you should take out trade commissions.

With your example, I still don't think it will work. Let me explain why.
image

Let's assume, you bought the BTC at 53700 USDT.
And the bot will start placing stop-loss limit order once it came back to 53700 USDT. However, within 15mins, it will definitely decrease by 0.8%, which I assume your stop percentage as well. Then it won't follow the rising price, your order would be executed in a short time.

Other examples will have the same issue.

If you want to follow the rise, you would configure stop/limit price percentage much bigger.

Am I making sense?

@fsabiu
Copy link
Author

fsabiu commented Apr 30, 2021

Thank you @chrisleekr.
I understand your considerations. I was using such a "limit price percentage" also as stop loss for the buy.
In my opinion, your last example highlighted the need of an initial (optional) stop loss that should be different from the limit price percentage (even 2 or 3 times bigger). In this case, we could avoid your scenario, guaranteeing an upper bound for the risk at each transaction. I know from other comments that you are not so favourable to it, it is just a kind proposal.

About parameters, you are right. Which parameters do you advise? And how are they profitable?

@chrisleekr
Copy link
Owner

chrisleekr commented Apr 30, 2021

@fsabiu

In my opinion, your last example highlighted the need of an initial (optional) stop loss that should be different from the limit price percentage (even 2 or 3 times bigger). In this case, we could avoid your scenario, guaranteeing an upper bound for the risk at each transaction.

Just to be clear, when you configure

  • stop/limit percentage for buy, the limit percentage is just needed 0.01% higher than the stop percentage.
  • stop/limit percentage for sell, the limit percentage is just needed 0.01% lower than the stop percentage.

What I was saying, for clarification, increase stop/limit percentage to cover the changes of each candle, so the bot can follow the rise. Hope it makes sense. Otherwise, I will explain further.

About parameters, you are right. Which parameters do you advise? And how are they profitable?

I would not advise any parameters as it's your money, you should do your own research.
But I can say some of my situations:

  • I am not investing huge dollars as I am just testing a bot. I am doing this for my study purpose. And I don’t have much money :(
  • This month, I choose the leverage token XRPDOWN/LTCDOWN and lost around $350, which was all my balance, and they are still losing. I haven't sold, but it seems it wouldn't recover unless the market crashes. Lesson from here, DO NOT TRADE DOWN LEVERAGE TOKEN unless you know absolutely it will go down.
  • On 12th/Apr, I added another 199AUD to continue the test. Since then, my cumulative PNL is 28.97%. But it doesn't mean my profit will continue to grow. It can lose all any point.
  • I am configuring different setting for all coins based on the trend. As all coins are different trends, you should study them and configure them as per the trend. However, mostly, I targeting 7% for sell trigger percentage.
  • I also have a coin -15% currently. I am just waiting. Again, It's risky if you see the trend wrong.
  • I also continuously change my settings to look for better profit.

I talked a lot, sorry. Hopefully, it helps a bit.

Just to prove what I am saying, I attached screenshots.

421D78AE-1C1D-460F-9CAE-58FEE477588A
D6D81621-1BCF-4BD9-B094-4C3730BFD719

@fsabiu
Copy link
Author

fsabiu commented Apr 30, 2021

@chrisleekr many thanks for sharing your experience, it is useful to everyone!

Don't you agree that with a stop loss of 5% (for example) you would have limited many losses? Is it implementing it very time expansive? Otherwise, could you suggest how to implement it in the project?

Finally, why don't we create a Telegram group or something similar where we all share parameters and related profits? We would save a lot of time and money.

fsabiu

@chrisleekr
Copy link
Owner

chrisleekr commented Apr 30, 2021

@fsabiu

Don't you agree that with a stop loss of 5% (for example) you would have limited many losses? Is it implementing it very time expansive? Otherwise, could you suggest how to implement it in the project?

If you are talking about selling the coin to prevent further loss, yes it will be implemented. It's on my todo list - #99

I am just don't have much time to do the development at this point.
Currently, I am focusing on stabilising #77, which is a huge improvement.
Take a look if you are interested.

Finally, why don't we create a Telegram group or something similar where we all share parameters and related profits? We would save a lot of time and money.

I think I mentioned it many times because others asking about this as well. But again, I don't have much time to chat about it and manage it.
At the moment, my baby is sleeping so I can talk with you like this. And during weekdays, I have a main job as well.
Feel free to create any chat and announce with a new issue. I will pin it, so others can join it.

@GrigorovskyA
Copy link

Well I created a discord server for it - https://discord.gg/Cqy35XnppA
And created pr with attached link in readme #136

@fsabiu
Copy link
Author

fsabiu commented Apr 30, 2021

@chrisleekr thank you again for your effort, we will share useful information in the discord channel.
@GrigorovskyA thank you, I join it.

@fsabiu fsabiu closed this as completed Apr 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants