Default print method for ichimoku objects to enable automatic plotting of the ichimoku cloud chart.

# S3 method for ichimoku
print(x, plot = TRUE, ...)

Arguments

x

an object of class 'ichimoku'.

plot

[default TRUE] set to FALSE to prevent automatic plotting of the ichimoku cloud chart.

...

additional arguments passed along to print.tbl and plot.ichimoku functions.

Value

The ichimoku object supplied (invisibly). The data is printed to the console. The ichimoku cloud chart is also output to the graphical device depending on the parameters set.

Details

This function is an S3 method for the generic function print() for class 'ichimoku'. It can be invoked by calling print(x) on an object 'x' of class 'ichimoku'.

Examples

cloud <- ichimoku(sample_ohlc_data, ticker = "TKR")

print(cloud)
#> # ichimoku object: more() to display more rows, look() to inspect attributes
#>    index                open  high   low close    cd tenkan kijun senkouA
#>    <dttm>              <dbl> <dbl> <dbl> <dbl> <dbl>  <dbl> <dbl>   <dbl>
#>  1 2020-01-02 00:00:00 123   123.1 122.5 122.7    -1   NA      NA      NA
#>  2 2020-01-03 00:00:00 122.7 122.8 122.6 122.8     1   NA      NA      NA
#>  3 2020-01-06 00:00:00 122.8 123.4 122.4 123.3     1   NA      NA      NA
#>  4 2020-01-07 00:00:00 123.3 124.3 123.3 124.1     1   NA      NA      NA
#>  5 2020-01-08 00:00:00 124.1 124.8 124   124.8     1   NA      NA      NA
#>  6 2020-01-09 00:00:00 124.8 125.4 124.5 125.3     1   NA      NA      NA
#>  7 2020-01-10 00:00:00 125.3 125.3 124.8 125.2    -1   NA      NA      NA
#>  8 2020-01-13 00:00:00 125.2 125.3 125.1 125.2     0   NA      NA      NA
#>  9 2020-01-14 00:00:00 125.2 125.2 124.3 124.4    -1  123.9    NA      NA
#> 10 2020-01-15 00:00:00 124.4 124.5 123.7 123.9    -1  123.9    NA      NA
#> # … with 271 more rows, and 4 more variables: senkouB <dbl>, chikou <dbl>,
#> #   cloudT <dbl>, cloudB <dbl>

print(cloud, plot = FALSE, n = 20)
#> # ichimoku object: more() to display more rows, look() to inspect attributes
#>    index                open  high   low close    cd tenkan kijun senkouA
#>    <dttm>              <dbl> <dbl> <dbl> <dbl> <dbl>  <dbl> <dbl>   <dbl>
#>  1 2020-01-02 00:00:00 123   123.1 122.5 122.7    -1  NA       NA      NA
#>  2 2020-01-03 00:00:00 122.7 122.8 122.6 122.8     1  NA       NA      NA
#>  3 2020-01-06 00:00:00 122.8 123.4 122.4 123.3     1  NA       NA      NA
#>  4 2020-01-07 00:00:00 123.3 124.3 123.3 124.1     1  NA       NA      NA
#>  5 2020-01-08 00:00:00 124.1 124.8 124   124.8     1  NA       NA      NA
#>  6 2020-01-09 00:00:00 124.8 125.4 124.5 125.3     1  NA       NA      NA
#>  7 2020-01-10 00:00:00 125.3 125.3 124.8 125.2    -1  NA       NA      NA
#>  8 2020-01-13 00:00:00 125.2 125.3 125.1 125.2     0  NA       NA      NA
#>  9 2020-01-14 00:00:00 125.2 125.2 124.3 124.4    -1 123.9     NA      NA
#> 10 2020-01-15 00:00:00 124.4 124.5 123.7 123.9    -1 123.9     NA      NA
#> 11 2020-01-16 00:00:00 123.9 124.4 123.8 124.2     1 123.9     NA      NA
#> 12 2020-01-17 00:00:00 124.2 124.3 123   123.5    -1 124.2     NA      NA
#> 13 2020-01-20 00:00:00 123.5 123.8 123.1 123.2    -1 124.2     NA      NA
#> 14 2020-01-21 00:00:00 123.6 123.6 123.4 123.6     0 124.2     NA      NA
#> 15 2020-01-22 00:00:00 123.5 124   123.3 123.5     0 124.15    NA      NA
#> 16 2020-01-23 00:00:00 123.5 124.5 123.3 124.3     1 124.15    NA      NA
#> 17 2020-01-24 00:00:00 124.3 124.4 124   124.2    -1 124.1     NA      NA
#> 18 2020-01-27 00:00:00 124.2 124.2 122.7 123      -1 123.6     NA      NA
#> 19 2020-01-28 00:00:00 123   123.6 122.7 123.1     1 123.6     NA      NA
#> 20 2020-01-29 00:00:00 123.1 123.3 123.1 123.2     1 123.6     NA      NA
#> # … with 261 more rows, and 4 more variables: senkouB <dbl>, chikou <dbl>,
#> #   cloudT <dbl>, cloudB <dbl>