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

Trade fee #28

Merged
merged 4 commits into from
Nov 24, 2020
Merged

Trade fee #28

merged 4 commits into from
Nov 24, 2020

Conversation

esemi
Copy link
Contributor

@esemi esemi commented Oct 27, 2020

Сделал учёт комиссий в расчёте профита по сделкам
Всё в рублях, всё по курсам на соответствующие даты

Осталось:

  • покрыть тестами prepare_trades_report раз уж у нас там такая важная калькуляция
  • обновить пример отчёта тулы в ридми
  • отображать в отчёте больше двух знаков после точки для комиссий

@esemi esemi force-pushed the trade_fee branch 3 times, most recently from 47be6c1 to 4173438 Compare October 29, 2020 17:02
@esemi esemi marked this pull request as ready for review October 29, 2020 17:13
@esemi
Copy link
Contributor Author

esemi commented Oct 29, 2020

тестов добавил
@cdump пример оставлю обновить тебе, у меня нет такого красивого портфеля)

@esemi esemi force-pushed the trade_fee branch 3 times, most recently from ec91787 to c341af7 Compare October 29, 2020 18:17
@esemi
Copy link
Contributor Author

esemi commented Nov 13, 2020

Нашёл проблему в отображении маленькой комиссии на итоговом отчёте по сделкам
Связано с округлением до двух знаком, влияет только на отображение, расчёт прибыли/убытка корректный при этом
image

@esemi
Copy link
Contributor Author

esemi commented Nov 18, 2020

@cdump пофиксил округление в отчёте (визуальная проблема была)
Можно ревьюшить)

билды упали ибо set-env таки запретили, пофиксил в соседнем МР

@esemi
Copy link
Contributor Author

esemi commented Nov 18, 2020

Обновил пример отчёта в ридми

@esemi esemi force-pushed the trade_fee branch 2 times, most recently from 70afa59 to 8209773 Compare November 18, 2020 11:15
@esemi
Copy link
Contributor Author

esemi commented Nov 21, 2020

@cdump пинг)

investments/data_providers/cbr.py Show resolved Hide resolved
investments/trade.py Outdated Show resolved Hide resolved
investments/trades_fifo.py Outdated Show resolved Hide resolved
investments/trades_fifo.py Show resolved Hide resolved
tests/data_providers/cbr_test.py Outdated Show resolved Hide resolved

analyze_trades_fifo_testdata = [
# trades: [(Date, Symbol, Quantity, Price)]
# expect_trades: (N, Symbol, Quantity, Total, Profit)
Copy link
Owner

Choose a reason for hiding this comment

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

WIP: подумать, не сломается ли #8 - тест на подобный баг

investments/ibtax/ibtax.py Outdated Show resolved Hide resolved
@esemi esemi force-pushed the trade_fee branch 4 times, most recently from f28d704 to fda2f79 Compare November 23, 2020 07:35
@cdump cdump merged commit f8cb343 into cdump:master Nov 24, 2020
@esemi esemi deleted the trade_fee branch November 27, 2020 16:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants