IG_create_open_pos: IG API Create one or more OTC positions

Description Usage Arguments Value Examples

View source: R/IGAPI.R

Description

Create one or more OTC positions

Usage

1
2
3
4
5
6
7
8
IG_create_open_pos(headers,
  url = "https://demo-api.ig.com/gateway/deal/positions/otc",
  dealReference = "", currency_code = "AUD", direction = "BUY", epic,
  expiry = "-", force_open = "true", guaranteed_stop = "false",
  level = "", limit_distance = "", limit_level = "",
  order_type = "MARKET", size, stop_distance = "", stop_level = "",
  trailingStop = "false", trailingStopIncrement = "",
  timeInForce = "FILL_OR_KILL", timeo = 5)

Arguments

headers

Object returned from IG_Auth

url

API URL

dealReference

A user-defined reference identifying the submission of the order

currency_code

Currency. Restricted to available instrument currencies

direction

Deal direction ('BUY' or 'SELL')

epic

Instrument epic identifier

expiry

Instrument expiry

force_open

True if force open is required

guaranteed_stop

True if a guaranteed stop is required

level

Closing deal level

limit_distance

Limit distance

limit_level

Limit level

order_type

'LIMIT', 'MARKET', 'QUATE'

size

Deal size

stop_distance

Stop distance

stop_level

Stop level

trailingStop

Whether the stop has to be moved towards the current level in case of a favourable trade

trailingStopIncrement

increment step in pips for the trailing stop

timeInForce

'EXECUTE_AND_ELIMINATE' or 'FILL_OR_KILL'

timeo

number of tries

Value

A data.frame Deal reference of the transaction

Examples

1
2
3
4
5
6
7
HEADERS = IG_Auth(" ","APIdemo1", " ")
order = IG_create_open_pos(headers = HEADERS, url ="https://demo-api.ig.com/gateway/deal/positions/otc",
dealReference = 'audcad001', currency_code = 'AUD', direction = 'BUY', epic = 'CS.D.AUDUSD.CFD.IP',
expiry = '-', force_open = 'true', guaranteed_stop = 'false', level = '', limit_distance = '', limit_level = '',
order_type = 'MARKET', size = 3,
stop_distance = 10, stop_level = '', trailingStop = 'false', trailingStopIncrement = '',
timeInForce = 'FILL_OR_KILL', timeo=5)

ivanliu1989/RQuantAPI documentation built on Sept. 13, 2019, 11:54 a.m.