# Load rpnf library
library(rpnf)
# Load free available sample data
data(DOW)
# Determine point and figure informations for a linear chart with boxsize of 1 point
pnfdata <- pnfprocessor(
high=DOW$High,
low=DOW$Low,
date=DOW$Date,
boxsize=1L,
log=FALSE)
# Show the object obtained
str(pnfdata)
# Show the data obtained
pnfdata
# Create a TXT based plot with X and O's
pnfplottxt(pnfdata,boxsize=1L,log=FALSE)
# Create a more graphical plot
pnfplot(pnfdata)
## Not run:
# ### Second example: logarithmc example
# # For most stocks and indices it is useful
# # to do the analysis on a logarithmic scale.
# # This can be done with pnfprocessor, too.
# # Ensure to make use of the getLogBoxsize() function
# # for an appropriate boxsize of a logarithmic chart.
# # Determine point and figure informations for a logarithmic chart with boxsize 2\%
# symbol.pnf <- pnfprocessor(
# high=DOW$High,
# low=DOW$Low,
# date=DOW$Date,
# boxsize=getLogBoxsize(2),
# log=TRUE)
#
# # View the result
# tail(symbol.pnf)
# #View(symbol.pnf)
#
# # or plot it as a modern chart
# pnfplot(symbol.pnf,main="P&F Plot DOW (log)")
# # Or in the old traditional TXT style
# pnfplottxt(symbol.pnf,boxsize=getLogBoxsize(2),log=TRUE,main="P&F Plot DOW (log)")
#
# ### Additional examples
# # Examples for additional uses cases like
# # - relative strength vs index
# # - bullish percent of an index
# # - and many others
# # can be found in your local package library directory.
# # Search for rpnf-example1.R, rpnf-example2.R and so on.
# ## End(Not run)
Run the code above in your browser using DataLab