-3

I have to predict to purchase or not of the sp500 put and call options, however I do not understand some parts of the code that was provided to me. In addition can you explain to me what every option of the data does, for example:

  • optionclosingprice;
  • optionsettleprice;
  • optiontype;
  • optionstrike;
  • optionhighprice;
  • optionlowprice;
  • optionvol;
  • optionopenint;
  • optionbetprice etc.

and their utility?

We try to use ARIMA for the prediction but do you have any other solution to offer me?

Thank you in advance and here is the piece of code that I do not understand:

mutate(optiontype = as.double(optiontype == "put")) %>%
mutate(buy_gain = (optionstrike - settle_sp_price)*(optiontype * 2 - 1)) %>%
mutate(bet_price = optionstrike - optionclosingprice*(optiontype * 2 - 1))
prices <- options %>% 
select(todaydate, today_sp_price) %>%
unique() %>%
mutate(lag_one = lag(today_sp_price), lag_three = lag(today_sp_price, 3), 
lag_five = lag(today_sp_price, 5) ) %>%
select(-(today_sp_price)) `
Artem
  • 3,304
  • 3
  • 18
  • 41
bibio95100
  • 31
  • 5
  • Heyo, welcome to SO! Could you be more specific about what you don't understand? This might be too vague a question for this website. – MQLN Jul 11 '18 at 23:12
  • 1
    How would somebody else (not in your class?) know anything about the particular variables within *your* private data? We know nothing about the structure or background of the data you are discussing. The question about *"what each option of the data does"* should be directed to the teacher/professor or team-leader. Please read a little about [how to ask](https://stackoverflow.com/help/how-to-ask) questions on SO, and a popular q/a about [reproducible questions](https://stackoverflow.com/questions/5963269/). – r2evans Jul 11 '18 at 23:27
  • I can give you the title og each column of the data if you want ?? I have not done enough study to understand what is for example bet price, clothing price ect .... i don't understand what represent all the things i say in the example – bibio95100 Jul 12 '18 at 00:04
  • Someone can help me ? – bibio95100 Jul 12 '18 at 12:08
  • could you upload somewhere the sp500 data you are trying to analyze, e.g. first 10 rows? Or use dput(head(options)) and post the result? – Artem Jul 26 '18 at 13:26
  • i don't know how i can donwload the data – bibio95100 Jul 27 '18 at 18:53

1 Answers1

0

Definitions:

Option types:

Call: buyer purchase a right (not an obligation) to buy an underlying asset by the given date with a predifined (strike) price; a buyer expect that a price of underlying asset is going to increase.

Put: buyer purchase a right (not an obligation) to sell an underlying asset by the given date with a predifned (strike) price; a buyer expects that a price of underlying asset is going to decrease.

  • Underlying asset - share, bond etc.
  • Option is a secondary financial instrument (derivative) when the buyer is buying a right to make a purchase or a sale in a given period of time of a certain underlying asset (bond, share etc. )
  • Settlement price the average (usually weighted) trading price of the underlying security at the trading day.
  • Closing price is a price at the end of the trading day.
  • Low price is the lowest price of the trading day
  • High price is the highest price of the trading day.
  • Openning price is a price at the openning of trading day.
  • Volatility is a measure of the variability of an option price during the day, it characterize how much risks is associated with a given option.
  • Bet price the difference between strike price and closing price for put options; difference between closing price and strike price for call options.

All above metioned characterisitcs are alow you to create diversified portofolio to mitigate the risks go broke and maximize expected profit

R-code:

mutate(col.name = experession) creates a column with col.name which equals to the expression

select(col.name1, col.name2, ...) selects col.name1, col.nam2, ... columns from the data.frame

select(-col.name) - remove frome data.frame col.name column

lag(ts, n) gets a time series ts and shifts underlying dates by n time units

%>% - connect sequence of operations on data.frame (mutate, select etc.) into one line

unique - chooses only unique combinations of columns

optiontype = as.double(optiontype == "put")) - create optiontype column, with every cell of column equals either 1 if it is put option or 0 if it has any other value.

Time seris:

Except of ARIMA you can use exponential smoothing algorithms (like Holt-Winters, state-space) or Recurrent Neural Networks, etc.

Artem
  • 3,304
  • 3
  • 18
  • 41
  • thank you so much!! this is the kind of answer i was waiting for! but i try to make prediction with FFT method, is it possible or just a waste of time ? – bibio95100 Jul 30 '18 at 20:15
  • I think it's quite challenging: – Artem Jul 31 '18 at 07:04
  • 1) When you apply FFT the spectra will have frequencies which occur because of end points of time series ("overtones") and you will try to convert back spectra to signals your prediction will be affected by "overtones" frequencies. 2) FFT is in principle having infinity of coefficients and any "outlier" will affect all the coeffecients and the model prediction I would recommend you to try wavelets: https://en.wikipedia.org/wiki/Wavelet – Artem Jul 31 '18 at 07:16
  • Can you tell me more about the problem of overtones please ? – bibio95100 Jul 31 '18 at 10:44
  • Usually you analyze finite time-series from the with edges (from t1 to t2). Fourier basis consisting of sine\cosines with different applitudes and every basis will interact with an edge points no matter where it is located, hence influencing every Fourier coefficient. So basically some artifact frequences appears because of limited character of your time series. Spectrum of rectangular impulse (https://en.wikipedia.org/wiki/Rectangular_function). However some people are using FFT for options. But stuff is tough. (https://www.math.ust.hk/~maykwok/piblications/Handbook_chapter.pdf) – Artem Jul 31 '18 at 16:14
  • @bibio95100, in case the question is answered could you accept it to remove from the question queue. – Artem Oct 05 '18 at 10:28