Skip to content
This repository has been archived by the owner on Feb 15, 2022. It is now read-only.

Completely rework --buy_max_amt #1494

Merged
merged 13 commits into from
Apr 23, 2018

Conversation

defkev
Copy link
Contributor

@defkev defkev commented Mar 12, 2018

As much as i like the --buy_max_amt feature i was never a fan of how it was implemented, leave alone the naming being confusing at best as it simply doesn't just account for the amount the bot can buy but how much he is actually able to trade.

  • Renames --buy_max_amt to --deposit for sake of clarification
  • Using --buy_max_amt will still work but print a deprecated warning
  • Instead of using --deposit to size buy orders use it to limit the balance available to the bot
  • This allows us to use it together with --buy_pct
  • --deposit will still account for asset held to calculate the available currency balance
  • So if the asset held is covering --deposit the bot will have 0 currency (0% of currency balance) available, if not currency will be filled to the point it compensates for the difference (up to 100% of currency balance)
  • If deposit is exceeding asset + currency the bot will also use 100% of currency balance held
  • Deposit will be updated on each price change and new period to ensure the bot always only trades the amount as defined by --deposit
  • Profit calculation will no longer go havoc as long as currency balance doesn't fall below whats currently deposited into the bot
  • If enabled this will add two new columns to the output displaying the total currency balance (in green) as well as how much percentage (gray) of currency balance (0 - 100%) is currently used by the bot
  • Works in Live, Paper & Sim mode

@defkev
Copy link
Contributor Author

defkev commented Mar 12, 2018

Just noticed that this doesn't cover the stats returned by P and thus not the profit returned by the API. Might as well add a new asset column to the Web GUI (as deposit is stored in s.balance) will i am at it 🤔

Leave it open for now..

@defkev
Copy link
Contributor Author

defkev commented Mar 18, 2018

I finally had some time to polish the whole thing and fix the profit calculation for sims.

Note that the balance (last/end) reported by stats in live/paper/sim mode will now use deposit as its base value instead of the absolute balance if --deposit is enabled.

Copy link
Owner

@DeviaVir DeviaVir left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, this is a much requested feature and I think this makes it a lot more clear. Thanks!

if (so.buy_max_amt) {
console.log(('--buy_max_amt is deprecated, use --deposit instead!\n').red)
so.deposit = so.buy_max_amt
}
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice

defkev added 10 commits March 24, 2018 22:13
As much as i like the --buy_max_amt feature i was never a fan of how it was implemented, leave alone the naming being confusing at best as it simply doesn't just account for the amount the bot can buy but how much he is actually able to trade.

* Renames --buy_max_amt to --deposit for sake of clarification
* Using --buy_max_amt will still work but print a deprecated warning
* Instead of using --deposit to size buy orders use it to limit the balance available to the bot
* This allows us to use it together with --buy_pct
* --deposit will still account for asset held to calculate the available currency balance
* So if the asset held is covering --deposit the bot will have 0 currency (0% of currency balance) available, if not currency will be filled to the point it compensates for the difference (up to 100% of currency balance)
* If deposit is exceeding asset + currency the bot will also use 100% of currency balance held
* Deposit will be updated on each price change and new period to ensure the bot always only trades the amount as defined by --deposit
* Profit calculation will no longer go havoc as long as currency balance doesn't fall below whats currently deposited into the bot
* If enabled this will add two new columns to the output displaying the total currency balance (in green) as well as how much percentage (gray) of currency balance (0 - 100%) is currently used by the bot
* Works in Live, Paper & Sim mode
* Fix profit calculation for stats and API
* Add deposit to Web GUI's capital row
@defkev defkev force-pushed the pr-rework-buy_max_amt branch from 3816115 to 3edca5b Compare March 24, 2018 21:28
defkev added 3 commits March 24, 2018 23:10
As deposit no longer overrides buy_pct this is kinda expected...
With deposit set order would be below minimum with asset on hold
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants