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

Chart Arithmetic #61

Open
tbrown747 opened this issue Jul 3, 2021 · 0 comments
Open

Chart Arithmetic #61

tbrown747 opened this issue Jul 3, 2021 · 0 comments

Comments

@tbrown747
Copy link

  • Users may want to create charts using spreads between different securities
  • A spread is calculated by subtracting or dividing the price of two specified securities and charting the result
  • There may be some interaction with Support Basket Charting #60
  • One possible implementation for both issues is to support charting by parsing arbitrary mathematical expressions. Some examples:
    • TSLA + 2NIO + 5NKLA
    • TSLA / QQQ
  • Basket support can be included by providing weighting functions for the expression:
    • PRICERATIO(SYMBOL, BASKET) returns the price weighting for the specified symbol against the specified basket
    • CAPRATIO(SYMBOL, BASKET) returns the market cap weighting for the specified symbol against the specified basket
  • For example, if we define a basket #EV that contains symbols [TSLA, NIO, NKLA], and we want to generate a price weighted basket chart for these symbols: PRICERATIO(TSLA, #EV)*TSLA + PRICERATIO(NIO, #EV) * NIO + PRICERATIO(NKLA, #EV) * NKLA
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

No branches or pull requests

1 participant