forked from enarjord/passivbot
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
39 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,15 +23,50 @@ Long and short positions are supported and have each the same parameters. | |
| `secondary_pprice_diff` | Distance from pos price to secondary entry price. | ||
| `secondary_allocation` | Allocation of wallet_exposure_limit for secondary entry. E.g. 0.4 means 40% to secondary, 60% to primary. | ||
|
||
|
||
Secondary entry is independent of primary entry grid, intended to catch abnormally deep dips. | ||
|
||
Here is a diagram summarizing the parameters (without EMA): | ||
|
||
![Grid Parameters](images/passivbot_grid_parameters.jpeg) | ||
[Full image](images/passivbot_grid_parameters.jpeg) | ||
|
||
**Recursive grid mode** | ||
|
||
See `docs/passivbot_modes.md` | ||
|
||
|
||
**EMAs** | ||
|
||
Since Passivbot 5.3, EMA are introduced to allow: | ||
* limit initial entries at peak of pump/dump | ||
* auto unstuck position | ||
The mechanism is described in this chapter : (https://github.com/enarjord/passivbot/blob/master/docs/auto_unstuck.md) | ||
|
||
Here is a diagram summarizing the parameters (without EMA): | ||
|
||
![Grid Parameters](images/passivbot_grid_parameters.jpeg) | ||
[Full image](images/passivbot_grid_parameters.jpeg) | ||
**Backwards TP** | ||
|
||
Since passivbot v5.6 parameter "backwards_tp: true/false" is added. | ||
|
||
The backwards tp mode works like this: | ||
|
||
(considering long pos, short pos is same but flipped) | ||
|
||
1) get close prices evenly spaced `linspace(pprice * (1 + min_markup), pprice * (1 + min_markup + markup_range), n_close_orders)` e.g. pprice=100, min_markup=0.002, markup_range=0.018, n_close_orders=10 -> `[100.2, 100.4, 100.6, 100.8, 101.0, 101.2, 101.4, 101.6, 101.8, 102.0]` | ||
|
||
2) filter out prices lower than current lowest ask | ||
|
||
3) calc full psize, i.e. psize when wallet_exposure==wallet_exposure_limit: `full_psize = (wallet_exposure_limit * balance) / pprice` (linear) | ||
|
||
4) calc qty per close: `qty_per_close = max(min_qty, round_up(full_psize / len(close_prices), qty_step))` | ||
|
||
5) for each TP node backwards, add qty until psize is spent | ||
|
||
Say full_psize=10 and actual psize is 3. qty per close is 10 / 10 == 1. | ||
Given TP prices `[100.2, 100.4, 100.6, 100.8, 101.0, 101.2, 101.4, 101.6, 101.8, 102.0]`, | ||
fill them up starting backwards: `[[email protected], [email protected], [email protected]]`, | ||
break when sum(qtys) == psize | ||
|
||
Say full_psize=20 and actual psize is 15. qty per close is 20 / 10 == 2. | ||
Given TP prices `[100.2, 100.4, 100.6, 100.8, 101.0, 101.2, 101.4, 101.6, 101.8, 102.0]`, | ||
fill them up starting backwards: `[[email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected]]`, | ||
break when sum(qtys) == psize |