Krypto-trading-bot icon indicating copy to clipboard operation
Krypto-trading-bot copied to clipboard

Idea: Profit Taking

Open CarlitoGrey opened this issue 8 years ago • 7 comments

Just thought I'd put this here for discussion.

The idea is to introduce a percentage-profit variable into the ewma_ls/lms calculation. Any profits are saved by selling down to a tbp of 0.00 when the % factor is reached:

image

CarlitoGrey avatar Jul 13 '17 05:07 CarlitoGrey

Hi not a bad idea, in the spirit of a scalper bot :)

However, don't forget that if the market goes 10 / 15 / 20% up you will leave the train with your 2% only :).

I was thinking about something a bit similar or what could be incorporated in a new ewma strategy.

It's not to have a fixed % you put but to start selling when the market goes under the fast ewma line. 28151829-03769664-6795-11e7-8b1f-7949952b81a5

Camille92 avatar Jul 13 '17 08:07 Camille92

It's only profit once it's been sold ;).

But you're right it could work better either:

  • Record the maximum value EWMA 50 reaches, if it drops below x% of this maximum, begin selling
  • Monitor the gradient of EWMA 50 and sell as it levels out.

We have to consider of course cases where there is a dip and then it continues to rise, however it's better to take a profit sometimes.

CarlitoGrey avatar Jul 13 '17 08:07 CarlitoGrey

True that!

I don't understand why you want to record the maximum ewma value. I was thinking something like:

If ewmashort > ewmalong && sma3 > ewmatakeprofit TP = 1 if ewmashort > ewmalong && sma3 < ewmatakeprofit TP = 1- (% takeprofit) if ewmashort < ewmalong && sma3 > ewmatakeprofit TP = -1 + (% takeprofit) if ewmashort < ewmalong && sma3 < ewmatakeprofit TP = -1

With TP = 1 -> full BTC TP = -1 -> 0 BTC % takeprofit = % of your stack you want to take profit/ take risks with. ewmatakeprofit = a third ewma to calculate the difference from the price sma3 = a simple moving average of 3mn to correct from blurry price movement.

Of course, it's not the final equation (it needs to include ewma sensibility) but I think it's quite good.

So it means: If your ewma are up + price is above your third ewma -> be full BTC If the ewma are up but the price is under your third ewma -> sell a part of your stack (and put 100% if you want to go all in). If the ewma are down but the price is above your third ewma -> buy a part of your stack If the ewma are down and the price is under your third ewma -> be completely out.

What do you think ?

Camille92 avatar Jul 13 '17 09:07 Camille92

I did a simulation on what it would look like on LTC USD with ewma 20 as the third ewma and 150 / 300 as the main ones:

  1. the ewmas are up + price is above your third ewma -> be full BTC
  2. the ewmas are up but the price is under your third ewma -> sell a part of your stack (and put 100% if you want to go all in).
  3. the ewmas are down but the price is above your third ewma -> buy a part of your stack
  4. the ewmas are down and the price is under your third ewma -> be completely out.

capture d ecran 2017-07-13 a 11 20 15

Camille92 avatar Jul 13 '17 09:07 Camille92

is this different from https://github.com/ctubio/tribeca/issues/100 ?

if is different, are we sure we want 2 ways to aggressively drain? if is the same or very similar, can we join them and remove one?

ctubio avatar Jul 13 '17 13:07 ctubio

Hi yep it's quite different, one is a trading strategy the other one is better market making.

The goal is not to drain here but to play with the EWMA / TBP :)

Camille92 avatar Jul 13 '17 13:07 Camille92

Unlocking doesn't fix depleted funds anyway 🍼

ghost avatar Mar 13 '18 20:03 ghost