if (FALSE) {
auth <- ig_auth(
username = "your_username",
password = "your_password",
api_key = "your_api_key",
acc_type = "DEMO",
acc_number = "ABC123")
res <- ig_execute_trade(
epic = "CS.D.USDCHF.MINI.IP",
direction = "BUY",
size = 1.0,
auth = auth,
currency_code = "CHF",
order_type = "MARKET",
time_in_force = "FILL_OR_KILL",
limit_distance = 2000,
stop_distance = 2000,
guaranteed_stop = FALSE,
force_open = TRUE
)
print(res)
}
Run the code above in your browser using DataLab