-
-
Notifications
You must be signed in to change notification settings - Fork 225
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
Refactor addCLV to follow skeleton_TA structure #96
Open
erichung0404
wants to merge
12
commits into
joshuaulrich:master
Choose a base branch
from
erichung0404:refactor_add_CLV_chart
base: master
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
Refactor addCLV to follow skeleton_TA structure #96
erichung0404
wants to merge
12
commits into
joshuaulrich:master
from
erichung0404:refactor_add_CLV_chart
Conversation
This file contains 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
This was referenced Aug 5, 2016
erichung0404
force-pushed
the
refactor_add_CLV_chart
branch
from
August 5, 2016 12:13
068ce81
to
f9a704a
Compare
As chartSeries is now a wrapper for chart_Series and chartSeries.chob is deprecated, code of add* functions that manipulate chob and chobTA objects breaks. So add* functions are refactored to use skeleton_TA structure to coordinate with chart_Series called by chartSeries. For those add* functions, however, quantmod::chart* functions are untouched. New chart* functions are passed to lenv environment in add* based on skeleton_TA structure. quantmod::chart* functions will be deprecated.
When subset is specified in chartSeries, addVo() doesn't apply correct subset volume to the chart. To fix this issue, subset setting is applied to chartVo function in chartSeries and pass subset volume to the environment. y-axis limit of the frame is expanded to reserve space from the top.
When reChart is called to draw subset volume, bar colors are wrong and subset functionality fails. The volume chart starts from the first day of the series no matter what subset period is specified. Pull out the panel settings from chartVo and wrap in expression.
Function y_grid_lines is not exported and is in plot_object$Env. chart* functions called in add* are passed to "lenv" environment so y_grid_lines cannot be found. y_grid_lines function is defined in chart* by y_grid_lines <- plot_object$Env$y_grid_lines. For add*MA functions, x.tmp should not be passed by x.tmp[xsubset] because when zoomChart is called, series used to calculate moving averages will change with the subset period if we pass x.tmp[xsubset] to x.tmp. Moving avrage indicators are passed to ma by ma <- *MA(x.tmp, ...)[xsubset] so x.tmp should always be the initial series and should not change with the subset period.
erichung0404
force-pushed
the
refactor_add_CLV_chart
branch
4 times, most recently
from
August 12, 2016 14:04
4643b6b
to
048a875
Compare
To coordinate with functions that manipulate TA such as swapTA(), moveTA() and dropTA(), TA values is passed to a new name list "TA" and function calls are passed to call_list.
erichung0404
force-pushed
the
refactor_add_CLV_chart
branch
from
August 12, 2016 14:11
048a875
to
b68c0ea
Compare
Pass subsetted bar.color to the histogram.
erichung0404
force-pushed
the
refactor_add_CLV_chart
branch
from
August 14, 2016 10:49
e9199a1
to
2f40706
Compare
Updating the last price displayed on chart when zoomChart is called to view subset series.
Pass color settings to addTA functions except for addSAR, addMACD, addShading, addLines, addPoints and add*MA functions that have their own 'col' argument. Users can call chartTheme(addTA = list(...)) colors and pass chart.theme object to chartSeries to manage desired chart colors.
erichung0404
force-pushed
the
refactor_add_CLV_chart
branch
6 times, most recently
from
August 19, 2016 06:50
bd3fbec
to
6913356
Compare
This commit is mainly for updating bug and cleaning up code for addTA functions. Originally, addTA functions' frame was set to be fixed so y limit value was unchanged when zoomChart was called to zoom up the indicators. The issue is not apparent in small data (~1000) and indicators that have upper and lower limits such as RSI and Aroon. But as the data grows bigger, TA's range will be larger. When zoomChart is called to view a shorter period, say, a month, y limit will be much greater than the value of the subset series, which makes the chart diffcult to read. Remove duplicated calculation for TA in lenv$chartTA. Move the expression of adding border and grid lines to lenv$chartTA. Add well-calculated TA to lenv to avoid duplicated calculation and use lenv$TA to create the y limit for new frame. Set TA's frame to be nonfixed. Divide BBands settings into col and lty. For addVo, minimum volume used to draw bars is replaced by the lower y limit. For addPoints, xts object is now allowed to be specified to x. Fix the bug that points' location will change when zoomChart is called.
Originally, argument "x" is mixed up with the x representing current chart passed to chartPoints and chartLines, which makes points and lines change with "x" continuously whenever new addPoints() and addLines() are called. New arguments are specified to chartPoints and chartLines to distinguish from x representing the current chart.
Apply "col" setting to shading regime.
Match the laegend color of last volume in subset period with the last bar color. Update the legend volume to be in millions.
erichung0404
force-pushed
the
refactor_add_CLV_chart
branch
from
August 20, 2016 04:35
60ef0c2
to
1559d58
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Refactor addCLV to use skeleton_TA structure. chartCLV function is given to create Close Location Value indicator based on skeleton_TA structure as following: