Zenbot: c.max_sell_loss_pct of 0 does not prevent selling at loss

Created on 4 Nov 2017  路  10Comments  路  Source: DeviaVir/zenbot

I'm using the ta_ema strategy and have the c.max_sell_loss_pct = 0

Why does it still sell at a loss? I interpreted this as meaning the bot will hold until it sees a profit. I also have c.sell_stop_pct = 0

question

Most helpful comment

what I have experienced (without having seen your particular stats from trading) is, that the bot compares the last buy value to the c.max_sell_loss_pct variable. In a sideway trend that means the last buy with a small total amount was made at a worse price than your first buy-in (so you want to keep the assets until the trend swings in your favor again) but the bot just "forgets" all previous trades and accounts for only his last buy and sells at a loss altogether. At least, this is how it seems to me.

I've tried to make the bot buy with 100% of the currency, but there seems to be a problem with that when actually buying on exchanges. Selling 100% of asset balance on the other hand is no problem at all. Even if you set 99% for buying of you balance, the bot will manage to make a buy with a very small amount at some point and then take that as the line and sell at a loss.

I would rather much like that the bot takes a snapshot of the initial balance, then use 25%/50%/100%/whatever% of that total to trade and not how it works right now (takes 50% of 10 eth, then 50% of remaining 5eth, then 50% of 2.5eth and so forth).

All 10 comments

what I have experienced (without having seen your particular stats from trading) is, that the bot compares the last buy value to the c.max_sell_loss_pct variable. In a sideway trend that means the last buy with a small total amount was made at a worse price than your first buy-in (so you want to keep the assets until the trend swings in your favor again) but the bot just "forgets" all previous trades and accounts for only his last buy and sells at a loss altogether. At least, this is how it seems to me.

I've tried to make the bot buy with 100% of the currency, but there seems to be a problem with that when actually buying on exchanges. Selling 100% of asset balance on the other hand is no problem at all. Even if you set 99% for buying of you balance, the bot will manage to make a buy with a very small amount at some point and then take that as the line and sell at a loss.

I would rather much like that the bot takes a snapshot of the initial balance, then use 25%/50%/100%/whatever% of that total to trade and not how it works right now (takes 50% of 10 eth, then 50% of remaining 5eth, then 50% of 2.5eth and so forth).

I agree with @ether-btc

The bot only remembers the last trade price. Iv been using buy_pct 99.99 sell_pct 99.99 and it works ok on gdax.

It would be easy to reset the "bought price" by recalculating the asset and bought costs after each buy.... but im not sure on how to rebalance it again after a sale.....

So are you guys saying that it can't remember what my last buy value was because of the residual assets left in the account? For example, I have had a very small (0.0015) share of BTC left over from the previous sale. Are you saying that this is interfering with the bot's ability to measure the profit/loss percentage of the most recent buy?

What were your buy settings (buy_pct=x)? what we suggested is that if that "x" is set to say "50" then the bot uses 50% of your currency balance to buy at a certain point. If that point is followed by a down-trend, and it buys once more with 50% of the remaining balance, then the bot takes that recent price into consideration when max_sell_loss_pct is concerned.
That means, originally you bought for 2.00, then once more at 1.80. the bot will sell at 1.82, even if that is unfavorable because he bought at 1.80 last. Even if you would like the bot to hold till say 2.10.

We are saying that the bot will only use the last bought price and assume the whole asset was purchased at the last bought price.

@ether-btc buy_pct aside... you could also get different buy rates if your limit order is filled in 2 or more parts as iv noticed this morning even if only part of the order is filled and the order book moves the bot will replace the order at a more competitive rate with the remaining balance

this feature still isn't working for me even with just 1 buy in the system. It does one buy, then does a sell at a lower price.
Is there something I'm missing or is it just messed up? I want it to never sell at a loss, like mentioned above. And this doesn't relate to multiple purchases messing it up because it's the first two actions during sim and real live trades

thanks!

"max_sell_loss_pct": 0,
"sell_stop_pct": 0,
    "trades": [
        {
            "time": 1514073889912,
            "execution_time": 230055,
            "slippage": 0.004233960460272476,
            "type": "buy",
            "size": "3.41448424",
            "fee": 0,
            "price": "294.11",
            "order_type": "maker",
            "cancel_after": "day"
        },
        {
            "time": 1514073960214,
            "execution_time": 1692,
            "slippage": 0,
            "type": "sell",
            "size": "3.36608751",
            "fee": 0,
            "price": "287.86",
            "order_type": "maker"
        },

@pursehouse set max_sell_loss_pct to 0.1, I had the impression that with 0 mean feature disabled.

well that's confusing... I had max set to 0.1 and it was constantly selling during flat trade times... took out 10% of my $ on a live test ( with like $10 :) ) setting it to 0.0001
thanks!

Negative numbers also work for this and forces a higher sell price. I have only tried this in the config files, not the command.

For example, if you set the max_sell_loss_pct = 1 , it allow a sell at a loss up to -1%. But setting it to -1 will reverse what it allows and it won't sell until it hits +1%

Dear issue reporter,

We have slightly changed our github issue policy and would now kindly request folks that have questions that they ask them in our zenbot subreddit.

You can find it here: https://reddit.com/r/zenbot

This issue will be closed, but if you disagree with your ticket being marked as a question feel free to leave a comment defending your case.

Thanks for contributing time and effort!

Greetings,
馃

Was this page helpful?
0 / 5 - 0 ratings

Related issues

joeswann picture joeswann  路  4Comments

michaelr524 picture michaelr524  路  3Comments

linuxu678 picture linuxu678  路  4Comments

nedievas picture nedievas  路  4Comments

mrzobot picture mrzobot  路  3Comments