if (FALSE) {
# Authenticate and get options positions
auth <- ig_auth(
username = "your_username",
password = "your_password",
api_key = "your_api_key",
acc_type = "DEMO",
acc_number = "ABC123"
)
options <- ig_get_options(auth)
print(options)
# Using mock response for testing
mock_response <- data.frame(
dealId = "DIXXXX",
size = 1.5,
direction = "BUY",
instrumentType = "OPTION"
)
options <- ig_get_options(auth, mock_response = mock_response)
}
Run the code above in your browser using DataLab