Description Usage Arguments Value Examples
Calculate Gradual Stop Loss from Price Data
1 | calculate_sl(price, sl1 = -0.18, sl2 = -0.28, ma = c("ALMA"), n = 5)
|
price |
asset price |
sl1 |
number indicating drawdown at which to initiate gradual stop loss |
sl2 |
number indicating drawdown to which to extend gradual stop loss |
ma |
moving average type (SMA, EMA, ALMA or DEMA) to use for drawdown calculation |
n |
number of periods to use for moving average calculation |
xts object indicating proportion of portfolio to be invested (1.0 = fully invested; 0.8 = 20
1 | calculate_sl(xts_price, sl1 = -0.18, sl2 = -0.28, ma = c("ALMA"), n = 5)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.