It is best explained by showing a few examples. LOESS can be seen as a generalization of polynomial regression which is itself a generalization of linear regression, that is closely related to correlation (the correlation coefficient is additionally provided in the title of the plot to give some context). The payoff diagram is created by a local regression, or more precisely locally estimated scatterplot smoothing or LOESS. the loessplot function, does is to create a scatter plot from the respective price series and a benchmark (normally an index to compare it with) and superimpose a payoff diagram. Loessplot ROC() |> coredata() |> na.omit() |> ame() # Registered S3 method overwritten by 'quantmod': # The following objects are masked from 'package:base':
Payoff vs profit diagram code#
Once again we will stand on the shoulders of giants by using the mighty quantmod package (on CRAN) and a not so well-known function from Base R, scatter.smooth (to run the code you must have R ≥ 4.1.0 installed): library(quantmod) If you want to get your hands on a simple R script that creates an easy-to-understand plot (a profit & loss profile or payoff diagram) out of any price series, read on! Why not simply translate one into the other? But everybody understands the meaning of rising and falling markets. Not many people understand the financial alchemy of modern financial investment vehicles, like hedge funds, that often use sophisticated trading strategies.