Learn R Programming

ichimoku (version 1.5.5)

stratcombine: Combine Ichimoku Strategies

Description

Create custom strategies from combining existing strategies contained in ichimoku objects 's1' and 's2' to form 's1 & s2'.

Usage

stratcombine(s1, s2)

Value

An ichimoku object augmented with the combined strategy.

Arguments

s1

an ichimoku object containing a strategy.

s2

an ichimoku object containing a strategy.

Further Details

Please refer to the strategies vignette by calling: vignette("strategies", package = "ichimoku")

Details

The combined strategy ‘s1 & s2’ means indicator conditions in ‘s1’ and ‘s2’ have to be met simulateneously for a trade position to be taken.

The boolean values showing whether these conditions are met are stored in the ‘cond’ column.

The strategy summary may be accessed by the summary() method for ichimoku objects or via look.

Examples

Run this code
cloud <- ichimoku(sample_ohlc_data, ticker = "TKR")
strat1 <- strat(cloud, c1 = "close", c2 = "kijun")
strat2 <- strat(cloud, c1 = "cloudB", c2 = "tenkan")
cstrat <- stratcombine(strat1, strat2)
summary(cstrat)
plot(cstrat)

Run the code above in your browser using DataLab