Username: Password:

Author Topic: Trailing stop loss feature request  (Read 41688 times)

Offline BorisTheSpider

  • Rookie
  • *
  • Posts: 1
    • View Profile
Trailing stop loss feature request
« on: June 16, 2017, 01:19:13 AM »
Hi Gunthar,

We had a discussion in Telegram where I suggested a "Trailing Stop" strategy like http://www.investinganswers.com/financial-dictionary/stock-market/trailing-stop-loss-1182

For example, gunbot buys BTC_ALT at a price of 100, with a sell target of 105

When price reaches 105, instead of instantly selling, we set a "stop" at 103, meaning we will sell if price drops to 103.

Now, price rises to 106, our "stop" follows (or trails) behind the price, so it moves up from 103 to 104. Now we will sell at 104 if the price drops there.

Price rises further to 108, our stop is now at 106, and so on.

This way, we lock in profit, but continue to let the price rise. Maybe, for example, we bought at 100, price rises to 105, stop is set at 103. Now price falls to 104, but then rises again to 106, stop was never "triggered", so we now have our stop at 106, and keep following the price rise, but always protected from a loss.

I imagine the "amount" to trail the order behind the price being user configurable, like "risk X% of profit", so if that setting was 50%, then we'd set a stop half-way between the buy-price and the current price, to risk half our profit in the hope of making more if the price drops a bit (but not enough to hit the stop) but then rises even more. It would need to "lock-in" or evaluate what that 50% was (in actual terms) at the time of hitting the first sell-level, so for example, if buy price was 100, now sell level is reached at 105, and that setting is 50%, we have a stop at 102.5, however if price later has risen all the way to 120, we want the stop not to be at 110 (risking half of profit), but instead at 117.5 because we "locked-in" that 50% meant 2.5 units of price at the time it first hit the sell-level.

EDIT: I heard a better idea from another user. In fact, I think it's better to "trail" the stop-loss a user configurable percentage of price behind. So, for example, if we set "TRAILING_PERCENT_SELL" to like 1% for example. Now if we bought at 100 and are going to sell at 105, the stop is set at 105 - (105 * 0.01) = 103.95, and as the price rises, the size of the trailing stop increases in absolute terms, so if price rises to 200, now the stop is at 200 - (200 * 0.01) = 198, so now we are risking 2 units of profit vs 1.05 units earlier, but it's still 1%. This makes sense, because as we get a bigger and bigger gain on the trade, we may wish to be more agressive about risking a bit more of that gain to make even more - we already locked in a big profit, so why not "let it ride" a bit more.

--------------------------------------------------------------------------------------------------------------------------------------

So the above was trailing stops for coins we have already bought and wish to sell. I think also we can do something similar for coins we might buy.

Let's say our buy price for BTC_ALT is 100

Instead of immediately buying at 100, we set a trailing stop to buy at 102, now we wait. If price rises to 102 we buy, and maybe we have to accept a smaller profit, or even more risk of a bad buy in that case, because we bought too expensive. One option here is to _only_ set the trailing stop once price falls even more - if price goes 100,99,100,101 we miss the opportunity to buy because the stop never got set (it will only be set at 100 or lower).

However, if price falls to 99 we move our trailing stop down to 101, now if price rises to 101 we buy, otherwise we wait.

Price keeps falling, now it's 95 and trailing stop is at 97 - if price now rises to 97, we buy at a better, cheaper price than we would originally have bought at.


« Last Edit: June 16, 2017, 01:35:38 AM by BorisTheSpider »

Offline AllYourBaseRBelong2Us

  • Rookie
  • *
  • Posts: 8
    • View Profile
Re: Trailing stop loss feature request
« Reply #1 on: June 16, 2017, 04:25:31 AM »
FUNCTIONALITY LIKE THIS WOULD BE A GAME CHANGER.  The next and much smarter iteration of stopgain, which currently seems to buy toward the top of dumps and sell toward the bottom of pumps, presumably at the first sign of price reversal past level 1 of buy/sell (or %GAIN?).  I've had this happen twice in the last five days, buying at the high end of dumps and then being left with deep bags because stepgain could not follow the dump down.

For selling I would have TRAILING_PERCENT_SELL (or whatever) work in conjunction with the current %GAIN function that guarantees minimum sell above BUY price.  So assuming (above) we bought at 100 with a %GAIN of 5% and a TRAILING_PERCENT_SELL set to 3%, using sell strategy TRAILINGSELL.  When prices rises past 105, we don't immediately sell, but wait to sell until price either a) retreats 3% from most recent high price, or b) retreats down to %GAIN price.  Assuming we stay above the %GAIN sell price, the price momentarily retreating 1-2% below highest current price would not trigger the sale, allowing Gunbot to chase the price up with however much variation along the way the user is comfortable with.

For buying I would think you ALWAYS want the option to chase the price as low as possible, no matter what BUY strategy you use, so maybe the only option you'd need for buying is the TRAILING_PERCENT_BUY which would be used in conjunction with the buy price Gunbot already determines based on the currently selected BUY strategy/range entered.  If the user (for some reason) doesn't want to chase a price down and allow for any flux in the price along the way, they can just set the TRAILING_PERCENT_BUY = 0 and buys will work exactly the same they do now.

Again, this would be a HUGE game changer.

- Chris OCC

Offline darkee

  • Rookie
  • *
  • Posts: 2
    • View Profile
Re: Trailing stop loss feature request
« Reply #2 on: June 16, 2017, 10:14:15 AM »
I agree this idea sounds very good for trading and buying at reasonable prices, rather than buying/selling too early just make the bot see where the market leads the price and then jump in before it's too late :)
Would be very much appreciated if something like this could be integrated into the next version of Gunbot

Offline magictrade

  • Contributor
  • **
  • Posts: 112
    • View Profile
Re: Trailing stop loss feature request
« Reply #3 on: June 16, 2017, 01:47:13 PM »
yes ! i agree , too

i had already suggest this idea in a past threat...... but dont can find it atm.......

if i had understand it right, than gunbot already trails, but only till the pricedirection changes......

if there where a (user configurable) "buffer", i thing than there is a possibility for gunbot, to make much more profit (;


buffer means, the same like a trailing stop.......

not close the trade direct after it change the direction. it means wait X% and if the price falls x% then close the trade, otherwise wait and trail ^^

and the same for buying please !

a trailling buy !!!!!!!

i thing thats the threats:

https://gunthy.org/index.php?topic=191.msg812#msg812

https://gunthy.org/index.php?topic=188.msg825#msg825



here i my suggestion for a new "look", it included the trailing thing (;


https://gunthy.org/index.php?topic=454.0

Offline magictrade

  • Contributor
  • **
  • Posts: 112
    • View Profile
Re: Trailing stop loss feature request
« Reply #4 on: June 18, 2017, 06:54:16 PM »


"if it possible, to analyse how fast the price grow or fall, maybe it is possible, that gunbot can autochange the value.......
for example a smaller/tighter value, for an price, that grows fast (pumps) / that falls fast....
and an wider value, for an price, that grows "normal" with some little falls on the way up........"

Offline bolenath

  • Rookie
  • *
  • Posts: 10
    • View Profile
Re: Trailing stop loss feature request
« Reply #5 on: June 18, 2017, 08:29:23 PM »
Also I requested similar idea for a short while ago.
This idea should be quite easy to implement and it should be able to strongly increase profits .

Link to my version of quite similar idea https://gunthy.org/index.php?topic=432

Offline flashdel

  • Rookie
  • *
  • Posts: 6
    • View Profile
Re: Trailing stop loss feature request
« Reply #6 on: June 19, 2017, 10:47:39 AM »
+1

Offline bolenath

  • Rookie
  • *
  • Posts: 10
    • View Profile
Re: Trailing stop loss feature request
« Reply #7 on: June 19, 2017, 12:17:56 PM »
Another very nice thing using stop-limit orders would be that 422s and 429s would affect us much less then it does today, with missed buys and sales..

Offline cryptocant

  • Rookie
  • *
  • Posts: 8
    • View Profile
Re: Trailing stop loss feature request
« Reply #8 on: August 03, 2017, 12:39:22 AM »
game changer!

Offline DaleyEdster

  • Rookie
  • *
  • Posts: 29
  • Money never sleeps...
    • View Profile
Re: Trailing stop loss feature request
« Reply #9 on: August 03, 2017, 06:54:58 AM »
Plus 1 from me too!
Authorised reseller of the Gunbot license. Please PM me for more details and offers!

Offline Shallow Hal

  • Rookie
  • *
  • Posts: 3
    • View Profile
Re: Trailing stop loss feature request
« Reply #10 on: August 08, 2017, 02:53:25 PM »
+1

Offline tajneprzezpoufne

  • Rookie
  • *
  • Posts: 8
    • View Profile
Re: Trailing stop loss feature request
« Reply #11 on: August 08, 2017, 03:11:08 PM »
+1!

Offline richiehubbard

  • Rookie
  • *
  • Posts: 2
    • View Profile
Re: Trailing stop loss feature request
« Reply #12 on: August 09, 2017, 02:33:49 AM »
+1 for this, is there anything like this in the works? :-)

Offline tajneprzezpoufne

  • Rookie
  • *
  • Posts: 8
    • View Profile
Re: Trailing stop loss feature request
« Reply #13 on: August 10, 2017, 10:26:32 AM »

EDIT: I heard a better idea from another user. In fact, I think it's better to "trail" the stop-loss a user configurable percentage of price behind. So, for example, if we set "TRAILING_PERCENT_SELL" to like 1% for example. Now if we bought at 100 and are going to sell at 105, the stop is set at 105 - (105 * 0.01) = 103.95, and as the price rises, the size of the trailing stop increases in absolute terms, so if price rises to 200, now the stop is at 200 - (200 * 0.01) = 198, so now we are risking 2 units of profit vs 1.05 units earlier, but it's still 1%. This makes sense, because as we get a bigger and bigger gain on the trade, we may wish to be more agressive about risking a bit more of that gain to make even more - we already locked in a big profit, so why not "let it ride" a bit more.


I'd suggest slightly different approach (allowing for higher shortterm variation of coin price) with the following configuration parameters:
1. Gain after which trailing stop is triggered --> e.g. if we set to 5%, and we bought at 100, trailing stop would activate at 105
2. Max loss of profit allowed from the best observed price --> e.g. if we set it to 20%, the following will happen:
 - trailing stop activated at 105, while the best price observed was 105. Current profit is 5, with 20% of it considered OK to lose. Bot would sell if price drops below 104.
 - price keeps rising, the best observed is 110. Difference between best observed and bought is 10, with 20% of it considered OK to lose. Bot would sell if price drops below 108.
 - price keeps rising, the best observed is 200. Difference between best observed and bought is 100, with 20% of it considered OK to lose. Bot would sell if price drops below 180.
 - price drops a little to 190. The best observed is still 200. Difference between best observed and bought is 100, with 20% of it considered OK to lose. Bot would sell if price drops below 180.
 - etc.

What do you think?

Offline tajneprzezpoufne

  • Rookie
  • *
  • Posts: 8
    • View Profile
Re: Trailing stop loss feature request
« Reply #14 on: August 10, 2017, 10:34:50 AM »

EDIT: I heard a better idea from another user. In fact, I think it's better to "trail" the stop-loss a user configurable percentage of price behind. So, for example, if we set "TRAILING_PERCENT_SELL" to like 1% for example. Now if we bought at 100 and are going to sell at 105, the stop is set at 105 - (105 * 0.01) = 103.95, and as the price rises, the size of the trailing stop increases in absolute terms, so if price rises to 200, now the stop is at 200 - (200 * 0.01) = 198, so now we are risking 2 units of profit vs 1.05 units earlier, but it's still 1%. This makes sense, because as we get a bigger and bigger gain on the trade, we may wish to be more agressive about risking a bit more of that gain to make even more - we already locked in a big profit, so why not "let it ride" a bit more.


I'd suggest slightly different approach (allowing for higher shortterm variation of coin price) with the following configuration parameters:
1. Gain after which trailing stop is triggered --> e.g. if we set to 5%, and we bought at 100, trailing stop would activate at 105
2. Max loss of profit allowed from the best observed price --> e.g. if we set it to 20%, the following will happen:
 - trailing stop activated at 105, while the best price observed was 105. Current profit is 5, with 20% of it considered OK to lose. Bot would sell if price drops below 104.
 - price keeps rising, the best observed is 110. Difference between best observed and bought is 10, with 20% of it considered OK to lose. Bot would sell if price drops below 108.
 - price keeps rising, the best observed is 200. Difference between best observed and bought is 100, with 20% of it considered OK to lose. Bot would sell if price drops below 180.
 - price drops a little to 190. The best observed is still 200. Difference between best observed and bought is 100, with 20% of it considered OK to lose. Bot would sell if price drops below 180.
 - etc.

What do you think?

And possibly, there is 1 more potential improvement that could be considered.
In above example, if bot should sell if price drops below 104 --> this means bot could create a stop-limit order to sell.
Once "best observed" rises, bot could cancel previous stop-limit order and create a new one, at higher values.

This approach has 2 advantages:
1. We pay smaller fees (on polo it's 0.10% difference)
2. We are safe from possible bot / network crashes

Offline Gunthar

  • Administrator
  • *****
  • Posts: 287
    • View Profile
Re: Trailing stop loss feature request
« Reply #15 on: August 15, 2017, 12:59:03 PM »
this is a very good idea: i'm going to implement it.

Offline eBitcoinworld

  • Rookie
  • *
  • Posts: 7
    • View Profile
Re: Trailing stop loss feature request
« Reply #16 on: August 16, 2017, 02:36:26 AM »
You are awesome Gunthar.

Keep up the good work!

Thanks

theoutlaw

  • Guest
Re: Trailing stop loss feature request
« Reply #17 on: August 16, 2017, 03:05:26 AM »
this is a very good idea: i'm going to implement it.

Hey Gunthar,

Brand new here but this is EXACTLY what ive been looking for, how long do you think it would take to implement?

Would you mind sending me a PM to discuss the possibility of 1 on 1 training?

Offline ruphus

  • Rookie
  • *
  • Posts: 68
    • View Profile
Re: Trailing stop loss feature request
« Reply #18 on: August 19, 2017, 09:02:10 PM »

EDIT: I heard a better idea from another user. In fact, I think it's better to "trail" the stop-loss a user configurable percentage of price behind. So, for example, if we set "TRAILING_PERCENT_SELL" to like 1% for example. Now if we bought at 100 and are going to sell at 105, the stop is set at 105 - (105 * 0.01) = 103.95, and as the price rises, the size of the trailing stop increases in absolute terms, so if price rises to 200, now the stop is at 200 - (200 * 0.01) = 198, so now we are risking 2 units of profit vs 1.05 units earlier, but it's still 1%. This makes sense, because as we get a bigger and bigger gain on the trade, we may wish to be more agressive about risking a bit more of that gain to make even more - we already locked in a big profit, so why not "let it ride" a bit more.


I'd suggest slightly different approach (allowing for higher shortterm variation of coin price) with the following configuration parameters:
1. Gain after which trailing stop is triggered --> e.g. if we set to 5%, and we bought at 100, trailing stop would activate at 105
2. Max loss of profit allowed from the best observed price --> e.g. if we set it to 20%, the following will happen:
 - trailing stop activated at 105, while the best price observed was 105. Current profit is 5, with 20% of it considered OK to lose. Bot would sell if price drops below 104.
 - price keeps rising, the best observed is 110. Difference between best observed and bought is 10, with 20% of it considered OK to lose. Bot would sell if price drops below 108.
 - price keeps rising, the best observed is 200. Difference between best observed and bought is 100, with 20% of it considered OK to lose. Bot would sell if price drops below 180.
 - price drops a little to 190. The best observed is still 200. Difference between best observed and bought is 100, with 20% of it considered OK to lose. Bot would sell if price drops below 180.
 - etc.

What do you think?

And possibly, there is 1 more potential improvement that could be considered.
In above example, if bot should sell if price drops below 104 --> this means bot could create a stop-limit order to sell.
Once "best observed" rises, bot could cancel previous stop-limit order and create a new one, at higher values.

This approach has 2 advantages:
1. We pay smaller fees (on polo it's 0.10% difference)
2. We are safe from possible bot / network crashes

+1 for any of those functions! those functionality would make gunbot even more golden!

Offline glennb6

  • Rookie
  • *
  • Posts: 3
    • View Profile
Re: Trailing stop loss feature request
« Reply #19 on: August 29, 2017, 08:54:27 PM »
I be a newbee, plan to purchase quite soon, and trailing stops, perhaps with a widening or variable percent or absolute range as price escalates from original purchase price was one feature I would consider a make or break on purchase, glad to hear it will be coming.