Skip to content

Conversation

@abhirathmahipal
Copy link
Contributor

Include Commissions in _trades DataFrame.

'SL': [t.sl for t in trades],
'TP': [t.tp for t in trades],
'PnL': [t.pl for t in trades],
'Commissions': [t._commissions for t in trades],
Copy link
Owner

Choose a reason for hiding this comment

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

Reasonable! Can we put this in conditionally, only if commission= was passed non-0 which is the default?

Copy link
Owner

Choose a reason for hiding this comment

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

I realize this would make sense for 'SL' and 'TP' too ...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Also, PnL doesn't account for Commissions. Rationale behind this decision?

Copy link
Owner

Choose a reason for hiding this comment

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

If you're implying PnL should be reduced for the respective value of Commissions, I guess it might be a bug!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, PnL should ideally account for Commissions and Spread. I can make the fix if you're aligned.

Copy link
Owner

Choose a reason for hiding this comment

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

Absolutely! Ideally, also document it if you can, maybe here. Particularly if there was to become a discrepancy between what trade.pl and this data frame reported.

Also think there might be a few open bugs related to commissions computation. Maybe see if you can get some of those by the way? 😅

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Will push these fixes :)

@abhirathmahipal
Copy link
Contributor Author

Incrementally taking up the changes. Please review this CR which includes commissions as the first step.

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