Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Message DirectionFormatBodyAdditional info (possible values)Example(Multi-leg)Example(Limit)
RequestJSON
Code Block
languagejs
{
	ticket:string,
	accountId:int,
	order:
	{
		Id:int,
		* SecurityId:int,
		* Quantity:double,
		* Type:int,		
		* Side:int,
		Price:double,
		StopPrice:double,
		Comment:string,
		TimeInForce:int,
		ExpireDate:int,
		AllOrNone:bool,
		Exchange:string
		TrailingStopAmountType:int,
		TrailingStopAmount:double,
		TrailingLimitAmountType:int
		TrailingLimitAmount:double 
		Legs: [order],
		ExtendedHours: string
		Contingent: 
		{
			PriceType: string,
			Direction: string,
			Threshold: double,
			SecurityId: int
		}
		"ExecutionInstructions":
[
			{
				"Key": "PerTradeCommission",
				"Value": double
			},
			{
				"Key": "PerContractComission",
				"Value": double
			}
		]

{







}



	}
}
* field is required

public enum OrderTrailingType
{
Absolute,
Persentage
}

 

Contingent:

PriceType values:

  • Ask
  • Bid
  • Last
Direction values:
  • Gt
  • Lt
ExtendedHours:
  • PRE
  • POST
  • ALL
  • REGPOST
  • PREREG
  • PREPOST

 

Trailing:
  • AmountType:

    0 - for absolute value (price change)

    1 - for percentage changes

 

PerContractCommission is specified for all securities at once. For example, if you intend to purchase 100 Apple stocks and levy a 2-cent fee on each stock, the PerContractCommission should be set to "2" ($2 split between 100 stocks — 2 cents per stock).

PerTradeCommission is applied to the entire transaction.

 

 

 

{

 "accountId":140,

 

"executionTarget":1,

"order":{

"

TrailingLimitAmount

Legs":[

{

"Id":0,

"

Legs

SecurityId":

[

4,

{

"

Quantity

SecurityName":

100

"AAPL",

"Side":

0

"Buy",

"

SecurityId

Quantity":

5

100,

"

AllOrNone

Precision":

0

2,

"

Id

TickSize":0.01

},

{

"

Quantity

Id":

1

0,

"

Side

SecurityId":

0

21418463,

"

SecurityId

SecurityName":

738931

"AAPL Feb 2020 315 Call",

"

AllOrNone

Side":

0,

"

Id

SellShort"

:0}

,

{

"Quantity":1,

"

Side

IsOption":

4

true,

"

SecurityId

Precision":

738930

2,

"

AllOrNone

TickSize":0.01,

"

Id

Strike":

0

}

]

315,

"

Price

Type":

0

"Call",

"

StopPrice

ExpirationType":0

}
],

"

Type

Price":

0

302.96,

"

AllOrNone

StopPrice":0,

"

Exchange

Precision":

"Auto"

2,

"

TrailingStopAmount

Type":

0

1,

"TimeInForce":0

}

}
{

"executionTarget":1,

"accountId":263,

"order":{

"Price":115.74,

"Exchange":"Auto",

"TrailingLimitAmount":0,

"AllOrNone":0,

"TrailingStopAmount":0,

"Type":1,

"Quantity":100,

"SecurityId":4,

"Side":0,

"TimeInForce":0,

"StopPrice":0

}

}
ResponseJSON
{   
 ResponseCode:int, 
 ticket:string,
 result:int
}
Where 'result' is your OrderId

Verification Order Errors 

  

...