Sitelet https://web.archive.org/web/20201227182323/https://github.com/freqtrade/freqtrade/issues/3696
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ability to set a custom fee for dry-run trading #3696

Open
Levos-IG1075 opened this issue Aug 19, 2020 · 6 comments
Open

Ability to set a custom fee for dry-run trading #3696

Levos-IG1075 opened this issue Aug 19, 2020 · 6 comments

Comments

@Levos-IG1075
Copy link

@Levos-IG1075 Levos-IG1075 commented Aug 19, 2020

Describe the enhancement

Hi, just registered on github for a quick suggestion. I think it would be great to have an option to set a custom fee when running trade with dry-run enabled in the JSON config.

As for the parameter dry_run_wallet, I'd love to be able to set an option like dry_run_fee.
My strategy is based on small profits, and while I can set the fee in backtesting/hyperopt (with the --fee parameter), I didn't find a way to do it with the dry-run mode, and my strategy runs poorly.

What do you think?

@xmatthias
Copy link
Member

@xmatthias xmatthias commented Aug 20, 2020

What would be the reason for this?

Freqtrade is assuming the exchange's default fee for trades in dry-run (so for binance, thats 0.1%).
In reality, you will also be paying fees - given, these may be 0.075% if you're paying in BNB - however, considering slippage / sometimes unfilled orders, using a slightly higher fee in dry-run will make your dry-run more realistic.


Apart from that - Especially when aiming for very minimal profits per trade, you must be very careful how you price your trades (which side of the orderbook, which order type, ...) - as dry-run will always assume that an order fills within seconds - which in live may not the case if the order is priced poorly.

@Levos-IG1075
Copy link
Author

@Levos-IG1075 Levos-IG1075 commented Aug 20, 2020

What would be the reason for this?

I think it would help with consistency between hyperopt, backtest and dry-run.

Freqtrade is assuming the exchange's default fee for trades in dry-run (so for binance, thats 0.1%).
In reality, you will also be paying fees - given, these may be 0.075% if you're paying in BNB - however, considering slippage / sometimes unfilled orders, using a slightly higher fee in dry-run will make your dry-run more realistic.

I agree, in the meantime I've set a 0.2% fee to account for that. Maybe this could be mentionned in the docs?

If you think this is not a useful improvement feel free to close the ticket :)

@xmatthias
Copy link
Member

@xmatthias xmatthias commented Aug 20, 2020 •

by setting fees to 0.2% - the effective fees will be 0.4% (0.2% for open, 0.2% for close).

I'm indecided on this - if someone feels like doing a PR for it i'm sure to look at it, but personally, i see no benefit - so myself i don't think i'll implement this any time soon.

@tejeshreddy
Copy link

@tejeshreddy tejeshreddy commented Sep 20, 2020

@xmatthias I would like to take this issue up. I will look to set up the custom fee for dry run

@xmatthias
Copy link
Member

@xmatthias xmatthias commented Sep 20, 2020 •

sure, go for it 👍 (this is actually the main reason to label an issue as "good first issue")

I think it shouldn't be "too" hard - best look at the methods dry_run_order() and _store_dry_order() in exchange.py.

The setting (fee) should already be there for backtesting, so there's not "too much" additional setup required.

If you need any help, best submit a PR with "what you got" at that point - so we can look at it together.

@tejeshreddy
Copy link

@tejeshreddy tejeshreddy commented Sep 20, 2020

@xmatthias that sounds great, thanks!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.