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:

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.

It's only profit once it's been sold ;).
But you're right it could work better either:
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.
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 ?
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.

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?
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 :)
Unlocking doesn't fix depleted funds anyway 馃嵓
Most helpful comment
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 :)