bestnaf / ARS

ARS addon for Gunbot MM
https://gunbot.ru
10 stars 2 forks source link

LiqSpread-Slicer #14

Open olhefr opened 3 years ago

olhefr commented 3 years ago

Idea LiqSpread-Slicer can be a simple tool to slowly average out of positions that hit Liquidation_Limit and are on freeze. One way is to wait it out until the position either hits PHR or closes with ROE. Another way is to manually handle the position. The way with LSS could be to slowly decrease the PositionSize to reduce risk and on the other hand still have the possibility to profit from retrace.

A smart way could be to combine with IAPK so LSS reduces position until it gets handled by IAPK. Of course PHR is still active as a last line of defence.

Core Functionality

If a positions LS hits LIQUIDATION_LIMIT its trading gets freezed until it hits PHR_LS_LIMIT or LS returns to > LL. With LSS enabled as long as LS < LL we decrease Position by a set percentrage every set x minutes.

default setting could be: Reduce 2% of PositionSize every 15 minutes as long as LS < LL.

Configuration Parameters enable (True) / disable (False) <pair>.settings.LSS = True

% of PositionSize to close every triggered event <pair>.settings.LSS_SLICE = 2

time to wait between reduction of set SLICE <pair>.settings.LSS_WAIT = 15

tr0lldermort commented 3 years ago

Do you want to use LS for the control variable of this function, or margin? Because when long on USDT-M for example, you wont see less than 100% liquidation spread until the -uPNL of the position is huge.

olhefr commented 3 years ago

For UPNL-matters I can - if I want - use upnl-killer or any other protection to not let grow my LONGs to an unhealthy size. But I dont care if it is triggered by LS or PosSize or anything else as long as it puts DCA on pause. The idea to use it together with IAPK will only work together with LS as IAPK otherwise wont trigger.

But tbh I am not too convinced by this approach anymore. At the moment I rather close early, take the (whole) loss and start over with next entry. But it is a way of keeping AvEP close at all time with the chance of exit on retrace. But ofc the pair can kill you anyway. But if not handled in any way it will kill you / eat your wallet when it hits PHR_LS_LIMIT. So better sooner than later if you want to go aggressive.

tr0lldermort commented 3 years ago

Agreed, my preference also is to "take the hit" and close the bag early. If we could add a setting on this slicer function to trigger on "% margin reached" instead of LS limit, it will work for both bag limiting and liquidation avoidance