Skip to content

Commit

Permalink
Ignore build files.
Browse files Browse the repository at this point in the history
  • Loading branch information
dereckmezquita committed Jul 8, 2024
1 parent 387d094 commit c0864c9
Show file tree
Hide file tree
Showing 13 changed files with 228 additions and 1 deletion.
14 changes: 14 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,20 @@ deprecated/
.DS_Store
*html

# Compiled objects
*.o
*.so

# R specific
.Rproj.user
.Rhistory
.RData
.Ruserdata

# RcppExports
RcppExports.cpp
RcppExports.R

# History files
.Rhistory
.Rapp.history
Expand Down
11 changes: 11 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
# Generated by roxygen2: do not edit by hand

export(StatShadedDateRange)
export(bb)
export(cite_package)
export(ema)
export(macd)
export(mom)
export(monte_carlo)
export(roc)
export(rsi)
export(sma)
export(stat_bollingerbands)
export(stat_candlestick)
export(stat_macd)
Expand All @@ -10,4 +19,6 @@ export(theme_dereck_dark)
export(theme_dereck_light)
import(data.table)
import(ggplot2)
importFrom(Rcpp,evalCpp)
importFrom(ggplot2,'%+replace%')
useDynLib(dmplot, .registration = TRUE)
2 changes: 1 addition & 1 deletion R/cpp.R
Original file line number Diff line number Diff line change
Expand Up @@ -91,4 +91,4 @@ rsi <- function(price, n, method = 'e') {
#' @export
sma <- function(price, n) {
.Call('_dmplot_sma', PACKAGE = 'dmplot', price, n)
}
}
21 changes: 21 additions & 0 deletions dev/test-package.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
box::use(dmplot[ bb, rsi, macd, monte_carlo ])

# Generate some sample data
set.seed(123)
price_data <- cumsum(rnorm(100)) + 100

# Test Bollinger Bands
bb_result <- bb(price_data, n = 20)
tail(bb_result)

# Test RSI
rsi_result <- rsi(price_data, n = 14)
tail(rsi_result)

# Test MACD
macd_result <- macd(price_data, s = 12, l = 26, k = 9)
tail(macd_result)

# Test Monte Carlo simulation
mc_result <- monte_carlo(seed_price = 100, daily_vol = 0.02, num_sims = 100, num_days = 252)
str(mc_result)
21 changes: 21 additions & 0 deletions man/bb.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 11 additions & 0 deletions man/cite_package.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 21 additions & 0 deletions man/ema.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

25 changes: 25 additions & 0 deletions man/macd.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 19 additions & 0 deletions man/mom.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 23 additions & 0 deletions man/monte_carlo.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 21 additions & 0 deletions man/roc.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 21 additions & 0 deletions man/rsi.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 19 additions & 0 deletions man/sma.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit c0864c9

Please sign in to comment.