knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>"
)

List all symbols and types

Simple example to obtain all available symbols in MT5 marketwatch and theirs types (CFD, Forex, etc).

Load mt5R package.

library(mt5R)

Use MT5.Marketwatch() to obtain all marketwatch symbols.

AllSymbols <- MT5.Marketwatch()
print(AllSymbols)

Create a data.frame to summary all the data.

df_symbols <- data.frame(Symbol = AllSymbols, Type = NA)

Use MT5.SymbolType() to obtain the type of every symbol using loop.

for(i in seq_len(dim(df_symbols)[1]))
{
  df_symbols[i,2] <- MT5.SymbolType(df_symbols[i,1])
}
print(df_symbols)


Kinzel/mt5r documentation built on March 25, 2021, 9:57 p.m.