Description Usage Arguments Value References Examples
This indicator adds the swing high and swing low points on a chartSeries.
The indicator checks historical candles to detect whether there was a swing point. This will work by inputting a number to select the range of historical candles to check to see if there is a swing point in the selected trading period. If a candle has the lowest low or highest high in the selected range, then we know it was a swing point.
1 | add_swing_high_low(x, n = 7)
|
x |
an xts object that contains OHLC data |
n |
Number of periods. Default is 7. |
Adds swing points to a chartSeries
swing high: https://www.investopedia.com/terms/s/swinghigh.asp swing low: https://www.investopedia.com/terms/s/swinglow.asp
1 2 3 4 5 6 7 8 9 10 | ## Not run:
library(quantmod)
ADM <- getSymbols("ADM",
from = "2018-01-01",
to = "2018-07-01",
auto.assign = FALSE)
chartSeries(ADM)
add_swing_high_low(ADM, n = 1)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.