1
Technical Support & Development / Re: Trailing stop loss feature request
« 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