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

Runtime Statistics Currency Conversion and Formating #6742

Closed
4 tasks done
DerekMelchin opened this issue Nov 14, 2022 · 3 comments · Fixed by #7284
Closed
4 tasks done

Runtime Statistics Currency Conversion and Formating #6742

DerekMelchin opened this issue Nov 14, 2022 · 3 comments · Fixed by #7284
Assignees
Labels
bug good first issue If you're looking to get started as a LEAN contributor, check out these starter issues! impact-low

Comments

@DerekMelchin
Copy link
Collaborator

Expected Behavior

If we set the account currency to BTC, the runtime statistics are valued in BTC and have the same number of as decimals as BTC.

Actual Behavior

If we set the account currency to BTC, the runtime statistics have the BTC currency symbol, but the value and rounding is the same as dollars.

Potential Solution

N/A

Reproducing the Problem

Run this backtest. The Equity runtime statistic is ₿100,005.88.

System Information

QC Cloud

Checklist

  • I have completely filled out this template
  • I have confirmed that this issue exists on the current master branch
  • I have confirmed that this is not a duplicate issue by searching issues
  • I have provided detailed steps to reproduce the issue
@Martin-Molinero
Copy link
Member

If we set the account currency to BTC, the runtime statistics have the BTC currency symbol, but the value and rounding is the same as dollars.

By default the initial cash is set to 100K of the account currency, the shared algorithm has 100k BTC and 100K USD which is ~5 BTC extra,
image

@jaredbroad jaredbroad added the bug label Feb 16, 2023
@jaredbroad
Copy link
Member

Seems odd the self.SetCash("USD", 100000) would result in 100K BTC. If not a bug in runtime statistics, then seems like a bug in setting cash.

@Martin-Molinero
Copy link
Member

  • Add new overload for SetAccountCurrency() allowing the user to set the target cash quantity/amount, which would override the default 100k

@Martin-Molinero Martin-Molinero added the good first issue If you're looking to get started as a LEAN contributor, check out these starter issues! label May 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug good first issue If you're looking to get started as a LEAN contributor, check out these starter issues! impact-low
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

4 participants