Function to load all available options in MT5 of an underlying asset.

Only works in stock brokers.

MT5.ListOptions(
  sUnderlyingAsset,
  bUseDescriptionStrike = FALSE,
  bAutomaticHelpUnderlying = TRUE
)

Arguments

sUnderlyingAsset

character(); target underlying asset (e.g. for "PETR4" should be used "PETR").

bUseDescriptionStrike

bool; use strike given in symbol description. Some brokers do not adjust the prices following the dividends. Totally optional (experimental). (default FALSE).

bAutomaticHelpUnderlying

bool; it will try to help the user to only send the underlying asset to mt5R. It will convert "PETR4" to "PETR" automatically (default TRUE).

Value

Returns Data.frame \([nx6]\), with follow informations:

  • sOpt {character}: options symbol.

  • PN_ON {int}: 0 for preferential stocks, 1 otherwise.

  • Type {factor}: options type. "CALL" for call options, "PUT" for put options.

  • Mod {factor}: option style. "AMERICAN" or "EUROPEAN". See references.

  • Strike {numeric}: options strike.

  • Expiration {Date}: options expiration.

References

https://en.wikipedia.org/wiki/Option_style

See also

Examples

if (FALSE) { ## Get all available options of PETR4 and PETR3 (Petroleo Brasileiro S.A. - Petrobras PBR:NYSE) MT5.ListOptions("PETR") ## Other examples MT5.ListOptions("VALE") MT5.ListOptions("USIM") }