-
-
Notifications
You must be signed in to change notification settings - Fork 229
Refactor addTA functions in addTA.R to follow skeleton_structure #111
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
Closed
erichung0404
wants to merge
23
commits into
joshuaulrich:master
from
erichung0404:refactor_add_ta_chart
Closed
Refactor addTA functions in addTA.R to follow skeleton_structure #111
erichung0404
wants to merge
23
commits into
joshuaulrich:master
from
erichung0404:refactor_add_ta_chart
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
Refactor addADX to use skeleton_TA structure. New chartADX is given to create Directional Movement Index indicator based on skeleton_TA structure.
Refactor addATR to use skeleton_TA structure. New chartATR is given to create Average True Range indicator based on skeleton_TA structure.
Refactor addBBands to use skeleton_TA structure. New chartBBands function is given to create Bollinger Bands indicator based on skeleton_TA structure.
Refactor addCCI to use skeleton_TA structure. New chartCCI function is given to create Commodity Channel Index indicator based on skeleton_TA structure.
Refactor addDEMA to use skeleton_TA structure. New chart EMV function is given to create various Moving Averages of a series based on skeleton_TA structure.
Refactor addDPO to use skeleton_TA structure. New chartDPO function is given inside addDPO to create Detrended Price Oscillator indicator based on skeleton_TA structure.
Refactor addEnvelope to use skeleton_TA structure. New chartEnvelope function is given to create technical indicators to the chart based on skeleton_TA structure.
Refactor addEVWMA to use skeleton_TA structure. New chartEVWMA is given to create various weighted moving averages of a series based on skeleton_TA structure.
Refactor addExpiry to use skeleton_TA structure. New chartExpiry function is given to add options or futures expiration vertical bars to price chart.
Refactor addMACD to use skeleton_TA structure. New chartMACD function is given to create MACD indicator in a new frame based on skeleton_TA structure.
Refactor addMomentum to use skeleton_TA structure. New chartMomentum function is given to create Momentum indicator based on skeleton_TA. Add 'with.col' argument to accept any arguments for x, not just Cl, which is required in the original code.
Refactor addPoints to use skeleton_TA structure. New chartPoints function is given to add points to the time series chart based on skeleton_TA structure.
Refactor addROC to use skeleton_TA structure. New chartROC is given to add rate of price series to the price chart based on skeleton_TA structure.
New chartRSI is given to create Relative Strength Index indicator based on skeleton_TA structure.
New chartSAR function is given to create Stop-And-Reverse indicator based on skeleton_TA structure.
New chartShading function is given to add shading area to the price series.
New chartSMA function is given to create moving average indicator based on skeleton_TA structure.
New chartTRIX function is given to create the TRIX indicator based on skeleton_TA structure.
New addWMA function is given to create Weighted Moving Average indicator based on skeleton_TA structure.
New chartEMA function is given to add Exponential Moving Average indicator to the price chart based on skeleton_TA structure.
New chartLines function is given to add lines to the ith panel when overlay=TRUE or chart on a new frame based on skeleton_TA structure.
New chartZLEMA function is given to add various moving averages indicator to the ith panel when overlay=TRUE or create a new frame based on skeleton_TA structure.
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.
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.
addTA functions in addTA.R file all have their own "chartTA" function to add technical indicators to the current chart. For the reason described in #108, those original chart* functions will not be called anymore since new chartTA functions are given based on skeleton_TA structure (see #96). In addTA.R file, there are:
addADX
,addATR
,addBBands
,addCCI
,addDEMA
,addDPO
,addEnvelope
,addEVWMA
,addExpiry
,addMACD
,addMomentum
,addPoints
,addROI
,addRSI
,addSAR
,addShading
,addSMA
,addTRIX
,addWMA
,addEMA
,addLines
andaddZLEMA
functions.