diff --git a/DESCRIPTION b/DESCRIPTION index f8ec3f08..93b62cf6 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Package: ichimoku Type: Package Title: Visualization and Tools for Ichimoku Kinko Hyo Strategies -Version: 1.4.9 +Version: 1.4.9.9000 Description: An implementation of 'Ichimoku Kinko Hyo', also commonly known as 'cloud charts'. Static and interactive visualizations with tools for creating, backtesting and development of quantitative 'ichimoku' strategies. diff --git a/NEWS.md b/NEWS.md index e20ea557..534224ae 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,5 @@ +# ichimoku 1.4.9.9000 (development) + # ichimoku 1.4.9 * Internal performance enhancements. diff --git a/R/data.R b/R/data.R index 3059519f..1e83cb58 100644 --- a/R/data.R +++ b/R/data.R @@ -21,12 +21,12 @@ #' #' @format A data frame with 256 observations of 6 variables: #' \itemize{ -#' \item{time}{ - timestamp of observation [POSIXct]} -#' \item{open}{ - opening price [numeric]} -#' \item{low}{ - low price [numeric]} -#' \item{high}{ - high price [numeric]} -#' \item{close}{ - closing price [numeric]} -#' \item{volume}{ - volume [integer]} +#' \item time - timestamp of observation [POSIXct] +#' \item open - opening price [numeric] +#' \item low - low price [numeric] +#' \item high - high price [numeric] +#' \item close - closing price [numeric] +#' \item volume - volume [integer] #' } #' #' @usage sample_ohlc_data diff --git a/R/ichimoku-package.R b/R/ichimoku-package.R index 19c28acb..13737bc6 100644 --- a/R/ichimoku-package.R +++ b/R/ichimoku-package.R @@ -32,38 +32,38 @@ #' @section Principal ichimoku functions: #' Data & Visualization #' \itemize{ -#' \item{\code{\link{ichimoku}}} {to create an ichimoku object from price -#' data.} -#' \item{\code{\link{plot.ichimoku}} / \code{\link{iplot}}} {to plot -#' (interactive) cloud charts from ichimoku objects.} -#' \item{\code{\link{archive}}} {for reading/writing objects to/from archive -#' files with data verification.} -#' \item{\code{\link{oanda}}} {to retrieve price data from the OANDA fxTrade -#' API.} +#' \item \code{\link{ichimoku}} to create an ichimoku object from price +#' data. +#' \item \code{\link{plot.ichimoku}} / \code{\link{iplot}} to plot +#' (interactive) cloud charts from ichimoku objects. +#' \item \code{\link{archive}} for reading/writing objects to/from archive +#' files with data verification. +#' \item \code{\link{oanda}} to retrieve price data from the OANDA fxTrade +#' API. #' } #' Strategies & ML #' \itemize{ -#' \item{\code{\link{strat}}} {to augment an ichimoku object with a strategy, -#' including combined and asymmetric strategies.} -#' \item{\code{\link{autostrat}}} {to automatically evaluate and rank -#' top-performing strategies.} -#' \item{\code{\link{mlgrid}}} {to generate a numeric representation of the -#' ichimoku cloud chart.} -#' \item{\code{\link{relative}}} {to produce a statistical summary of the -#' latest ichimoku numeric representation relative to historical values.} +#' \item \code{\link{strat}} to augment an ichimoku object with a strategy, +#' including combined and asymmetric strategies. +#' \item \code{\link{autostrat}} to automatically evaluate and rank +#' top-performing strategies. +#' \item \code{\link{mlgrid}} to generate a numeric representation of the +#' ichimoku cloud chart. +#' \item \code{\link{relative}} to produce a statistical summary of the +#' latest ichimoku numeric representation relative to historical values. #' } #' Real-time #' \itemize{ -#' \item{\code{\link{oanda_chart}}} {to plot real-time ichimoku cloud charts -#' using OANDA data.} -#' \item{\code{\link{oanda_studio}}} {a complete live analysis environment -#' using OANDA data implemented in R Shiny.} -#' \item{\code{\link{oanda_stream}} / \code{\link{oanda_quote}}} {to obtain -#' the latest live data stream / quote from the OANDA fxTrade API.} -#' \item{\code{\link{oanda_view}}} {for a market overview showing the -#' relative performance of constituents.} -#' \item{\code{\link{oanda_orders}} / \code{\link{oanda_positions}}} {to -#' retrieve the aggregate OANDA fxTrade order / position book.} +#' \item \code{\link{oanda_chart}} to plot real-time ichimoku cloud charts +#' using OANDA data. +#' \item \code{\link{oanda_studio}} a complete live analysis environment +#' using OANDA data implemented in R Shiny. +#' \item \code{\link{oanda_stream}} / \code{\link{oanda_quote}} to obtain +#' the latest live data stream / quote from the OANDA fxTrade API. +#' \item \code{\link{oanda_view}} for a market overview showing the +#' relative performance of constituents. +#' \item \code{\link{oanda_orders}} / \code{\link{oanda_positions}} to +#' retrieve the aggregate OANDA fxTrade order / position book. #' } #' #' @encoding UTF-8 diff --git a/R/ichimoku.R b/R/ichimoku.R index cfad4fa1..d4f38679 100644 --- a/R/ichimoku.R +++ b/R/ichimoku.R @@ -55,30 +55,30 @@ #' #' Index: #' \itemize{ -#' \item{\code{index(object)}:} {date-time index [POSIXct]} +#' \item \code{index(object)}: date-time index [POSIXct] #' } #' Columns [numeric]: #' \itemize{ -#' \item{\code{object$open}:} {opening price} -#' \item{\code{$high}:} {high price} -#' \item{\code{$low}:} {low price} -#' \item{\code{$close}:} {closing price} -#' \item{\code{$cd}:} {candle direction (-1 = down, 0 = flat, 1 = up)} -#' \item{\code{$tenkan}:} {Tenkan-sen} -#' \item{\code{$kijun}:} {Kijun-sen} -#' \item{\code{$senkouA}:} {Senkou span A} -#' \item{\code{$senkouB}:} {Senkou span B} -#' \item{\code{$chikou}:} {Chikou span} -#' \item{\code{$cloudT}:} {cloud Top (max of senkouA, senkouB)} -#' \item{\code{$cloudB}:} {cloud Base (min of senkouA, senkouB)} +#' \item \code{object$open}: opening price +#' \item \code{$high}: high price +#' \item \code{$low}: low price +#' \item \code{$close}: closing price +#' \item \code{$cd}: candle direction (-1 = down, 0 = flat, 1 = up) +#' \item \code{$tenkan}: Tenkan-sen +#' \item \code{$kijun}: Kijun-sen +#' \item \code{$senkouA}: Senkou span A +#' \item \code{$senkouB}: Senkou span B +#' \item \code{$chikou}: Chikou span +#' \item \code{$cloudT}: cloud Top (max of senkouA, senkouB) +#' \item \code{$cloudB}: cloud Base (min of senkouA, senkouB) #' } #' Attributes: #' \itemize{ -#' \item{\code{attributes(object)$periods}:} { parameters used to -#' calculate the cloud [integer vector of length 3]} -#' \item{\code{$periodicity}:} { periodicity of the -#' data in seconds [numeric]} -#' \item{\code{$ticker}:} { instrument identifier [character]} +#' \item \code{attributes(object)$periods}: parameters used to calculate +#' the cloud [integer vector of length 3] +#' \item \code{$periodicity}: periodicity of the data in seconds +#' [numeric] +#' \item \code{$ticker}: instrument identifier [character] #' } #' #' @section Further Details: diff --git a/R/oanda.R b/R/oanda.R index 4ee2e8e4..d9c2dc6e 100644 --- a/R/oanda.R +++ b/R/oanda.R @@ -285,18 +285,18 @@ getPrices <- function(instrument, granularity, count = NULL, from = NULL, #' Summarised from the streaming API documentation: #' #' \itemize{ -#' \item{Pricing stream does not include every single price created for the -#' Account} -#' \item{At most 4 prices are sent per second (every 250 milliseconds) for -#' each instrument} -#' \item{If more than one price is created during the 250 millisecond window, -#' only the price in effect at the end of the window is sent} -#' \item{This means that during periods of rapid price movement, not every -#' price is sent} -#' \item{Pricing windows for different connections to the stream are not all -#' aligned in the same way (e.g. to the top of the second)} -#' \item{This means that during periods of rapid price movement, different -#' prices may be observed depending on the alignment for the connection} +#' \item Pricing stream does not include every single price created for the +#' Account +#' \item At most 4 prices are sent per second (every 250 milliseconds) for +#' each instrument +#' \item If more than one price is created during the 250 millisecond window, +#' only the price in effect at the end of the window is sent +#' \item This means that during periods of rapid price movement, not every +#' price is sent +#' \item Pricing windows for different connections to the stream are not all +#' aligned in the same way (e.g. to the top of the second) +#' \item This means that during periods of rapid price movement, different +#' prices may be observed depending on the alignment for the connection #' } #' #' @section Further Details: diff --git a/R/strat.R b/R/strat.R index 95249b09..95c0d2da 100644 --- a/R/strat.R +++ b/R/strat.R @@ -52,19 +52,19 @@ #' #' Columns [numeric]: #' \itemize{ -#' \item{\code{$cond}:} {a boolean vector if the indicator condition is met} -#' \item{\code{$posn}:} {a boolean vector indicating if a position is held} -#' \item{\code{$txn}:} {a vector representing the transactions to implement -#' the position (1 = enter position, -1 = exit position)} -#' \item{\code{$logret}:} {a vector of log returns} -#' \item{\code{$slogret}:} {a vector of log returns for the strategy} -#' \item{\code{$ret}:} {a vector of discrete returns} -#' \item{\code{$sret}:} {a vector of of discrete returns for the strategy} +#' \item \code{$cond}: a boolean vector if the indicator condition is met +#' \item \code{$posn}: a boolean vector indicating if a position is held +#' \item \code{$txn}: a vector representing the transactions to implement +#' the position (1 = enter position, -1 = exit position) +#' \item \code{$logret}: a vector of log returns +#' \item \code{$slogret}: a vector of log returns for the strategy +#' \item \code{$ret}: a vector of discrete returns +#' \item \code{$sret}: a vector of of discrete returns for the strategy #' } #' #' Attributes: #' \itemize{ -#' \item{\code{$strat}:} {the strategy summary [matrix]} +#' \item \code{$strat}: the strategy summary [matrix] #' } #' #' The strategy summary may be accessed by the \code{summary()} method for @@ -75,14 +75,14 @@ #' denotes the strategy 'c3 > c4'. #' #' \itemize{ -#' \item{Combined strategy 's1 & s2':} {indicator conditions in 's1' and +#' \item Combined strategy 's1 & s2': indicator conditions in 's1' and #' 's2' have to be met simulateneously for a position to be taken. The -#' column \code{$cond} will show when both conditions are met.} -#' \item{Asymmetric strategy 's1 x s2':} {indicator condition in 's1' has -#' to be met to enter a position, and indicator condition in 's2' to exit -#' a position. These rules are applied recursively over the length of the -#' data. The column \code{$cond} will show when the indicator condition -#' is met in 's1'} +#' column \code{$cond} will show when both conditions are met +#' \item Asymmetric strategy 's1 x s2': indicator condition in 's1' has +#' to be met to enter a position, and indicator condition in 's2' to +#' exit a position. These rules are applied recursively over the length +#' of the data. The column \code{$cond} will show when the indicator +#' condition is met in 's1' #' } #' #' @section Further Details: diff --git a/man/ichimoku-package.Rd b/man/ichimoku-package.Rd index b124dd9f..7b5cb57b 100644 --- a/man/ichimoku-package.Rd +++ b/man/ichimoku-package.Rd @@ -23,38 +23,38 @@ An implementation of 'Ichimoku Kinko Hyo', also commonly known as 'cloud Data & Visualization \itemize{ - \item{\code{\link{ichimoku}}} {to create an ichimoku object from price - data.} - \item{\code{\link{plot.ichimoku}} / \code{\link{iplot}}} {to plot - (interactive) cloud charts from ichimoku objects.} - \item{\code{\link{archive}}} {for reading/writing objects to/from archive - files with data verification.} - \item{\code{\link{oanda}}} {to retrieve price data from the OANDA fxTrade - API.} + \item \code{\link{ichimoku}} to create an ichimoku object from price + data. + \item \code{\link{plot.ichimoku}} / \code{\link{iplot}} to plot + (interactive) cloud charts from ichimoku objects. + \item \code{\link{archive}} for reading/writing objects to/from archive + files with data verification. + \item \code{\link{oanda}} to retrieve price data from the OANDA fxTrade + API. } Strategies & ML \itemize{ - \item{\code{\link{strat}}} {to augment an ichimoku object with a strategy, - including combined and asymmetric strategies.} - \item{\code{\link{autostrat}}} {to automatically evaluate and rank - top-performing strategies.} - \item{\code{\link{mlgrid}}} {to generate a numeric representation of the - ichimoku cloud chart.} - \item{\code{\link{relative}}} {to produce a statistical summary of the - latest ichimoku numeric representation relative to historical values.} + \item \code{\link{strat}} to augment an ichimoku object with a strategy, + including combined and asymmetric strategies. + \item \code{\link{autostrat}} to automatically evaluate and rank + top-performing strategies. + \item \code{\link{mlgrid}} to generate a numeric representation of the + ichimoku cloud chart. + \item \code{\link{relative}} to produce a statistical summary of the + latest ichimoku numeric representation relative to historical values. } Real-time \itemize{ - \item{\code{\link{oanda_chart}}} {to plot real-time ichimoku cloud charts - using OANDA data.} - \item{\code{\link{oanda_studio}}} {a complete live analysis environment - using OANDA data implemented in R Shiny.} - \item{\code{\link{oanda_stream}} / \code{\link{oanda_quote}}} {to obtain - the latest live data stream / quote from the OANDA fxTrade API.} - \item{\code{\link{oanda_view}}} {for a market overview showing the - relative performance of constituents.} - \item{\code{\link{oanda_orders}} / \code{\link{oanda_positions}}} {to - retrieve the aggregate OANDA fxTrade order / position book.} + \item \code{\link{oanda_chart}} to plot real-time ichimoku cloud charts + using OANDA data. + \item \code{\link{oanda_studio}} a complete live analysis environment + using OANDA data implemented in R Shiny. + \item \code{\link{oanda_stream}} / \code{\link{oanda_quote}} to obtain + the latest live data stream / quote from the OANDA fxTrade API. + \item \code{\link{oanda_view}} for a market overview showing the + relative performance of constituents. + \item \code{\link{oanda_orders}} / \code{\link{oanda_positions}} to + retrieve the aggregate OANDA fxTrade order / position book. } } diff --git a/man/ichimoku.Rd b/man/ichimoku.Rd index a73eb252..5f2507ea 100644 --- a/man/ichimoku.Rd +++ b/man/ichimoku.Rd @@ -66,30 +66,30 @@ Calling an ichimoku object automatically invokes its print method, Index: \itemize{ - \item{\code{index(object)}:} {date-time index [POSIXct]} + \item \code{index(object)}: date-time index [POSIXct] } Columns [numeric]: \itemize{ - \item{\code{object$open}:} {opening price} - \item{\code{$high}:} {high price} - \item{\code{$low}:} {low price} - \item{\code{$close}:} {closing price} - \item{\code{$cd}:} {candle direction (-1 = down, 0 = flat, 1 = up)} - \item{\code{$tenkan}:} {Tenkan-sen} - \item{\code{$kijun}:} {Kijun-sen} - \item{\code{$senkouA}:} {Senkou span A} - \item{\code{$senkouB}:} {Senkou span B} - \item{\code{$chikou}:} {Chikou span} - \item{\code{$cloudT}:} {cloud Top (max of senkouA, senkouB)} - \item{\code{$cloudB}:} {cloud Base (min of senkouA, senkouB)} + \item \code{object$open}: opening price + \item \code{$high}: high price + \item \code{$low}: low price + \item \code{$close}: closing price + \item \code{$cd}: candle direction (-1 = down, 0 = flat, 1 = up) + \item \code{$tenkan}: Tenkan-sen + \item \code{$kijun}: Kijun-sen + \item \code{$senkouA}: Senkou span A + \item \code{$senkouB}: Senkou span B + \item \code{$chikou}: Chikou span + \item \code{$cloudT}: cloud Top (max of senkouA, senkouB) + \item \code{$cloudB}: cloud Base (min of senkouA, senkouB) } Attributes: \itemize{ - \item{\code{attributes(object)$periods}:} { parameters used to - calculate the cloud [integer vector of length 3]} - \item{\code{$periodicity}:} { periodicity of the - data in seconds [numeric]} - \item{\code{$ticker}:} { instrument identifier [character]} + \item \code{attributes(object)$periods}: parameters used to calculate + the cloud [integer vector of length 3] + \item \code{$periodicity}: periodicity of the data in seconds + [numeric] + \item \code{$ticker}: instrument identifier [character] } } diff --git a/man/oanda_stream.Rd b/man/oanda_stream.Rd index ad6f45a9..74cbfff3 100644 --- a/man/oanda_stream.Rd +++ b/man/oanda_stream.Rd @@ -51,18 +51,18 @@ This function connects to the OANDA fxTrade Streaming API. Use the Summarised from the streaming API documentation: \itemize{ - \item{Pricing stream does not include every single price created for the - Account} - \item{At most 4 prices are sent per second (every 250 milliseconds) for - each instrument} - \item{If more than one price is created during the 250 millisecond window, - only the price in effect at the end of the window is sent} - \item{This means that during periods of rapid price movement, not every - price is sent} - \item{Pricing windows for different connections to the stream are not all - aligned in the same way (e.g. to the top of the second)} - \item{This means that during periods of rapid price movement, different - prices may be observed depending on the alignment for the connection} + \item Pricing stream does not include every single price created for the + Account + \item At most 4 prices are sent per second (every 250 milliseconds) for + each instrument + \item If more than one price is created during the 250 millisecond window, + only the price in effect at the end of the window is sent + \item This means that during periods of rapid price movement, not every + price is sent + \item Pricing windows for different connections to the stream are not all + aligned in the same way (e.g. to the top of the second) + \item This means that during periods of rapid price movement, different + prices may be observed depending on the alignment for the connection } } diff --git a/man/sample_ohlc_data.Rd b/man/sample_ohlc_data.Rd index 3d07dc9b..1afbb8d4 100644 --- a/man/sample_ohlc_data.Rd +++ b/man/sample_ohlc_data.Rd @@ -7,12 +7,12 @@ \format{ A data frame with 256 observations of 6 variables: \itemize{ - \item{time}{ - timestamp of observation [POSIXct]} - \item{open}{ - opening price [numeric]} - \item{low}{ - low price [numeric]} - \item{high}{ - high price [numeric]} - \item{close}{ - closing price [numeric]} - \item{volume}{ - volume [integer]} + \item time - timestamp of observation [POSIXct] + \item open - opening price [numeric] + \item low - low price [numeric] + \item high - high price [numeric] + \item close - closing price [numeric] + \item volume - volume [integer] } } \source{ diff --git a/man/strat.Rd b/man/strat.Rd index 57539e1c..37c0a174 100644 --- a/man/strat.Rd +++ b/man/strat.Rd @@ -63,19 +63,19 @@ The following assumption applies to all strategies: confirmation of Columns [numeric]: \itemize{ - \item{\code{$cond}:} {a boolean vector if the indicator condition is met} - \item{\code{$posn}:} {a boolean vector indicating if a position is held} - \item{\code{$txn}:} {a vector representing the transactions to implement - the position (1 = enter position, -1 = exit position)} - \item{\code{$logret}:} {a vector of log returns} - \item{\code{$slogret}:} {a vector of log returns for the strategy} - \item{\code{$ret}:} {a vector of discrete returns} - \item{\code{$sret}:} {a vector of of discrete returns for the strategy} + \item \code{$cond}: a boolean vector if the indicator condition is met + \item \code{$posn}: a boolean vector indicating if a position is held + \item \code{$txn}: a vector representing the transactions to implement + the position (1 = enter position, -1 = exit position) + \item \code{$logret}: a vector of log returns + \item \code{$slogret}: a vector of log returns for the strategy + \item \code{$ret}: a vector of discrete returns + \item \code{$sret}: a vector of of discrete returns for the strategy } Attributes: \itemize{ - \item{\code{$strat}:} {the strategy summary [matrix]} + \item \code{$strat}: the strategy summary [matrix] } The strategy summary may be accessed by the \code{summary()} method for @@ -88,14 +88,14 @@ The following assumption applies to all strategies: confirmation of denotes the strategy 'c3 > c4'. \itemize{ - \item{Combined strategy 's1 & s2':} {indicator conditions in 's1' and + \item Combined strategy 's1 & s2': indicator conditions in 's1' and 's2' have to be met simulateneously for a position to be taken. The - column \code{$cond} will show when both conditions are met.} - \item{Asymmetric strategy 's1 x s2':} {indicator condition in 's1' has - to be met to enter a position, and indicator condition in 's2' to exit - a position. These rules are applied recursively over the length of the - data. The column \code{$cond} will show when the indicator condition - is met in 's1'} + column \code{$cond} will show when both conditions are met + \item Asymmetric strategy 's1 x s2': indicator condition in 's1' has + to be met to enter a position, and indicator condition in 's2' to + exit a position. These rules are applied recursively over the length + of the data. The column \code{$cond} will show when the indicator + condition is met in 's1' } }