Username: Password:

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - BorisTheSpider

Pages: [1]
1
Technical Support & Development / 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.



Pages: [1]