-
Notifications
You must be signed in to change notification settings - Fork 1
Robust <plotly> methods #24
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
Open
serkor1
wants to merge
60
commits into
devel
Choose a base branch
from
plotly
base: devel
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
* The goal is to ease the process of building individual <plotly> elements. * Added alias to themes as a small step towards normalizing the coding
* This commit is a preliminary implementation using Reduce() a high-level wrapper will be implemented at a later point when the code is completed.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## devel #24 +/- ##
==========================================
- Coverage 96.52% 95.41% -1.12%
==========================================
Files 266 270 +4
Lines 11504 11919 +415
==========================================
+ Hits 11104 11372 +268
- Misses 400 547 +147 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
* The plotly builder is an S3 function for high-level
building indicators usings list of traces instead of
coding it in a low-level manner. A similar implementation were done in {cryptoQuotes}.
* The templates are now split in subchart and main chart indicators. This implementation is not really clever, as it has just been copy-pasted; but it works.
* The name of the data is fixed, and given the changes in 92edf20, it makes sense to add a 'data'-argument.
* This is just to play around with it, and have starting point for developing the new functions further.
* The functions adds common trace elements to a list of traces. It abstracts the lapply code-chain in indicators with more than one trace.
* This options is primarily meant for the README.
In {cryptoQuotes} there is a added an extra padding to
avoid overlap with the title. Consider whether this is a good
idea here.
* The README removes the modebar such that it is not a part of the figure presented in the chart-section.
* plotly_init: Initializes an empty plotly object using the constructed_indicator object from the parent.frame * plotly_line: Creates a straight line using the number of rows from the constructed_indicator object from the parent.frame The goal is deprecate the subchart() and add_ribbons()
* The template were spelled incorrectly.
* All indicators are now generated conditionally on being subchart or main chart indicators
* The implementation is a bit off, some indicators have proper names, some doesn't. At the moment the goal is to implement it correctly, then implement the small details.
* The functions now uses the same templates and logic as the remaining.
* The low-level implementation uses the ta_MA.c to calculate the MAs for the volume
* The function were looking for a non-existent argument.
* The trading volume is now implemented similar to the remaining funcitons. It might be that this is overkill, but it has been implemented nonetheless. This implementation is in response to #23
* add_ribbons are replaced by fills in each trace * subchart is replaced by plotly_init See 3f423fc for more details and as a starting point if any interest.
* The merge() function is a S3 function from {base}
applied to <plotly>-objects. The function is currently
a rough sketch of how it should function, and requires alot of upstream
changes (I think).
At the moment it does not differentiate colors in the merged indicator
so this needs some (slight) rethinking. A quick-fix could be to add a pool
of colors to chose from in the function itself.
* I think there might be a bug somewhere. But now its committed.
* The subchart will inherit the title of the subchart indicator unless its explicitly passed.
* See 344f8a8 * The generators now supports overriding numeric method availability.
* The plotly_line() function is now more robust to upstream logic. * The produced lines are now a middlepoint between the font and grid color with dots instead of dash. * The mode, type and class of the plotly_line() is hardcoded to avoid downstream ambigiuty in plotly_build()
* The function will now add legends by default and treats plotly_line() differently from indicator traces. * The function now also builds the gridlines by default.
* The decorators is a list of function for decorating the chart and added indicators. An example use-case is forcing limits to the indicators where limits are applied. The ADX ranges from 0 to 100, for example, and should therefore be plotted accordingly. * To support the decorators the templates have been updated, and is.empty() helper-function have been introduced to check for empty lists, characters and such. Not sure why, but it was a good idea at the time.
* These functions have no decorators for now and can be committed without further actions.
* The last value decorators adds the last values to the charts with bold and regular fonts. * The title of the main chart now follows the paper and does not overflow to the right.
* The <plotly>-methods have been updated and now uses the new decorator interface.
* The legend is now a part of the chart itself instead of being outside of the plot area. This layout is consistent with other charting software like Binance and TradingView.
* This is a work in progress. The naming and grouping
of legend entries should be handled by the individual methods.
- There is too much nitty gritty work around polishing the
charts. The package is not even published, and based on the experiences
from {SLmetrics} nobody will 'really' use the package because people do not
switch from old packages.
* The template will look for decorators and return a list() if not found. - There is no reason to scan 100+ indicators to determine if a decorator is needed.
* The build_plotly() now groups and names traces based on the naming and title argument.
* All indicators now follows the new structure of the of the plotly_build() - the upstream implementation allows for more boilerplate coding at a later point.
* Added RSI and Volume to charts
* The source of the "one config"-warning could not be located.
- So instead of baking the config in the plotly_object, it will be applied
on return instead. So its never really a part of any object.
* Swithced the position of the title and the last OHLC-values
* All margins are set to zero; except right side.
* Both bands are now uniquely identified from the legends; multiple bands will provide multiple legend entries identifiable from the titles.
* All moving averages are now grouped under the 'Moving Averages'-legends.
* This function is essentially a variadic sprintf()-wrapper for naming <plotly>-method traces.
* Replaces missing names with NULL
* The function is now internally documented * The function will now build the minimum required elements so the resulting <plotly>-object is uniform
* Implemented new templates * Minor bug-fixes
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Note
This PR closes #15 and #23
📚 What?
This PR adds a more robust implementation of the <plotly>-methods alongside new implementations.
🚀 New features
merge.plotly: Merge two <plotly>-objects that are similar in terms of y-scales. A use-case is the combination of an indicator with varyingn🔨 Developer tools
The most important (internal) additions are:
plotly_init(): Initialize an empty <plotly>-object for the subchart indicators.plotly_line(): Create a straight line for indicators with threshold values.plotly_build(): Build a <plotly>-object using the various layout functionsThe overall goal with these functions is to ease the development flow and streamline the {plotly} implementation.
📋 TODO
merge.plotly()