taFactory | R Documentation |
Constructor to instantiate object(s) of class 'TAIndicator'. It maps the indicator definition to the class properties.
taFactory(ind)
ind |
Indicator definition. |
An object of class 'TAIndicator'.
# Call the factory with SMA setup.
json <- '{
"label": "SMA",
"method": "TTR::SMA",
"columns": [{"x": ["Close"]}]
}'
ind <- jsonlite::fromJSON(json)
ta <- taFactory(ind)
# Call the factory with ATR setup.
json <- '{
"label": "ATR",
"method": "TTR::ATR",
"columns": [{"HLC": ["High", "Low", "Close"]}],
"args": [{"n": 14, "maType": "EMA"}]
}'
ind <- jsonlite::fromJSON(json)
ta <- taFactory(ind)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.