This repository has been archived by the owner on Feb 15, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Always use lowest/highest price for buy/sell loss protection (#1471)
* Always use lowest/highest price for buy/sell loss protection On consecutive buys/sells the bot would always use the last price for loss protection, which could lead to a potential (sic) loss if the last price is below/above (depending on the order type) any previous price of the same order type. To overcome this we will lookup all previous orders (of the same type) and adjust last price to the highest/lowest within the previous orders. Will this isn't a true FIFO (as we don't account for any amount bought/sold) it goes in the same direction by always "aiming" for a profit. This completely removes held_pct, which i presume was supposed to accomplish the same but seems to be causing a bug preventing the bot from doing consequtive buys. Also some linter fixes will i am already at it. * linter Looks my master has different likings. * Refactor sell/loss protection update * Use lodash instead of legacy * Completely replaces the semi static last_buy|sell_price for loss protection * Include previous trades, if enabled/available * Always use the lowest/highest (aka. worst) price from within previous orders of the opposite signal, even on repeating signals * Typo in var duh
- Loading branch information
Showing
3 changed files
with
25 additions
and
22 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
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
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