Skip to content

Expanded Charting - #2

Merged
serkor1 merged 26 commits into
develfrom
charting
Oct 18, 2025
Merged

Expanded Charting#2
serkor1 merged 26 commits into
develfrom
charting

Conversation

@serkor1

@serkor1 serkor1 commented Oct 18, 2025

Copy link
Copy Markdown
Owner

Note

As the R package is still in the development phase these PRs are mostly for internal tracking, if you are interested in the full range of changes please see the commit history.

📚 What?

This PR improves various user-facing (and back-end) aspects of the charting in {talib}. The charts are, for example, decorated with date ranges if the row-names are coercible to some date object, and adds possibly custom titles to the charts.

🔨 Example

{
    talib::chart(talib::BTC)
    talib::indicator(talib::MACD)
}

Created on 2025-10-18 with reprex v2.1.1

serkor1 added 21 commits October 3, 2025 22:29
* input_name(): strip namespace calls and deparse symbol

* rebuild_formula(): drop exclude (default idx) and reformulate

* add_idx(): attach idx labels from .plotting_environment or row seq

* to_title(): replace underscores and convert to title case

* has_arg(): detect provided args, including via ..., in parent call
The chart function have been updated with the following changes:

* idx: An optional argument which replaces the x-axis labels. It is possible
       to, for example, replace the 1:nrow(x) with dates.

* title: An optional custom title for the chart. Pretty selfexplanatory.
* If the series is being subset, then the returned value
  will have a non-null attribute called 'subset' which can
  be passed downstream to align multiple series.

  NOTE: It might have been a better idea to always pass
        a subsetting vector, rep(TRUE, nrow(x)) if no subsetting have been done
* indicator(): The function is inherits the label
               and idx from the main chart-function.
               It will (also) now give an informative error
               message if the data is not provided.
               It will (also) add title to the singular indicator
               charts.

* .chart_layout(): The function now support the idx, label and title
                   for the chart-function. All axis-titles are removed.
* Added a description of the interface and the differences
  from the core library

* Simplified the basic usage section so it is indeed basic.

* Updated installation instructions.
* Added helpers for charting: subchart
    - Helpers have been added to chart_elements.R
* charts now uses rownames by default for x-axis labels
* Added reminders to the source code.
* This function will check for existing charts.
* All indicators have been updated to fit
  with the upstream changes to charting.
* The vignette are going to outline the elements of
  charting with {talib}
* Some of the candlestick patterns are neither bullish or bearish by construction.
  The agnostic flag ensures that the markers are neutral. Agnostic patterns
  are displayed as font colors.
* The function now checks the input values
  and extracts the column names if not passed
  as names.
* The coding have been streamlined, and agnostic
  patterns have been encoded.
* The chart were always returning 1:nrow(x) in the branches.
  It now correctly displays rownames when they are not passed as
  integers or values coercible to integers.
* ACCBANDS: Now uses add_ribbon only
* BBANDS: The alpha has been increased

For both functions the proper names have been added to the chart.
* The charts now supports drawing resistance and support
  lines via modebar buttons.

  It is MAYBE worthwile to implement a function to draw these
  lines using functions.
* The plotly-methods now accepts upper + lower args for
  drawing ribbons around the area of interest.
* Added title argument: The argument sets the title of the chart.
  NOTE: the documentation is probably  a bit vague.
* This addition should adapt all downstream charts so
  support and resistance lines can be drawn on the charts.
* The method now follows the remaining plotly methods.
* The function were passing the plotly-object instead of
  the derived series.
@serkor1 serkor1 added the enhancement New feature or request label Oct 18, 2025
@codecov

codecov Bot commented Oct 18, 2025

Copy link
Copy Markdown

Welcome to Codecov 🎉

Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests.

Thanks for integrating Codecov - We've got you covered ☂️

* %||% is not compatible with older versions of R
  - Off it goes.
* The chart will output N as the total length of the series.
* The chart will only output range if its NOT integer. Having a range from 1-100 is not informative.
* The trading_volume is essentially just the volume, with the option to add smoothing MA lines.
    - Its still a WIP
* All Volume Indicator families have been updated to accomodate the new indicator.
@serkor1 serkor1 mentioned this pull request Oct 18, 2025
* Signatures updated so its streamlined
* Documented ma-arg
@serkor1
serkor1 merged commit 9c0c965 into devel Oct 18, 2025
13 checks passed
@serkor1
serkor1 deleted the charting branch October 18, 2025 16:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant