knitr::opts_chunk$set( collapse = TRUE, comment = "#>" )
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]) }
MT5.SymbolType())-1 not found.0 is stock.1 is option.2 is future contract.3 is Forex.4 is CFD.print(df_symbols)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.