Jump to content
Sign in to follow this  
smironov

Create order directly via http POST

Recommended Posts

I’m trying to post string 

“{"OrderId”:0,“MarketId”:400481111,“Currency”:“CAD”,“AutoRollover”:true,“Direction”:“buy”,“Quantity”:100,“BidPrice”:1.01406,“OfferPrice”:1.01453,“AuditId”:“20110420-G2PREPROD3-0354883”,“TradingAccountId”:200009371,“IfDone”:null,“OcoOrder”:null,“Applicability”:“GTC”,“ExpiryDateTimeUTC”:null,“Guaranteed”:true,“TriggerPrice”:1.1}“

 via request "So, my question splits into two: 1. Is the URL I’m using correct? 2. Is the post-string correct? Is backend supposed to return some more or less descriptive message or it returns 404 for any incorrect data?

Share this post


Link to post

try something like this:

http://ciapipreprod.cityindextest9.co.uk/tradingapi/order/newstoplimitorder?

“ExpiryDateTimeUTCDate”:null,“IfDone”:[],“OrderId”:0,“MarketId”:400481126,“Status”:null,“ExpiryDateTimeUTC”:null,“Direction”:“buy”,“Quantity”:100000,“BidPrice”:0.88611,“QuoteId”:null,“OfferPrice”:0.88624,“AuditId”:“20110420-G2PREPROD3-0489458”,“TradingAccountId”:200009371,“TriggerPrice”:11,“Applicability”:“GTC”,“Currency”:null,“OcoOrder”:null}

it will lookup the default currency for the market if not supplied.

Share this post


Link to post

After posted 

{“OrderId”:0,“MarketId”:400481111,“Currency”:“CAD”,“AutoRollover”:true,“Direction”:“buy”,“Quantity”:100,“BidPrice”:1.02199,“OfferPrice”:1.02241,“AuditId”:“20110421-G2PREPROD3-0404602”,“TradingAccountId”:200009371,“IfDone”:null,“OcoOrder”:null,“Applicability”:“GTC”,“ExpiryDateTimeUTC”:null,“Guaranteed”:true,“TriggerPrice”:100}

I got

‘{“OrderId”:0,“Orders”:[{“CommissionCharge”:0,“GuaranteedPremium”:0,“IfDone”:null,“OCO”:null,“OrderId”:0,“Price”:0,“Status”:10,“StatusReason”:8}],“Quote”:null,“Status”:2,“StatusReason”:75}’

What does it mean? User 0x234

Share this post


Link to post

After posted 

{“OrderId”:0,“MarketId”:400481111,“Currency”:“CAD”,“AutoRollover”:true,“Direction”:“buy”,“Quantity”:100,“BidPrice”:1.02199,“OfferPrice”:1.02241,“AuditId”:“20110421-G2PREPROD3-0404602”,“TradingAccountId”:200009371,“IfDone”:null,“OcoOrder”:null,“Applicability”:“GTC”,“ExpiryDateTimeUTC”:null,“Guaranteed”:true,“TriggerPrice”:100}

I got

‘{“OrderId”:0,“Orders”:[{“CommissionCharge”:0,“GuaranteedPremium”:0,“IfDone”:null,“OCO”:null,“OrderId”:0,“Price”:0,“Status”:10,“StatusReason”:8}],“Quote”:null,“Status”:2,“StatusReason”:75}’

What does it mean? User 0x234

The StatusReason on the order shows it’s below the minimum quantity for that market.

Share this post


Link to post

After posted 

{“OrderId”:0,“MarketId”:400481111,“Currency”:“CAD”,“AutoRollover”:true,“Direction”:“buy”,“Quantity”:100,“BidPrice”:1.02199,“OfferPrice”:1.02241,“AuditId”:“20110421-G2PREPROD3-0404602”,“TradingAccountId”:200009371,“IfDone”:null,“OcoOrder”:null,“Applicability”:“GTC”,“ExpiryDateTimeUTC”:null,“Guaranteed”:true,“TriggerPrice”:100}

I got

‘{“OrderId”:0,“Orders”:[{“CommissionCharge”:0,“GuaranteedPremium”:0,“IfDone”:null,“OCO”:null,“OrderId”:0,“Price”:0,“Status”:10,“StatusReason”:8}],“Quote”:null,“Status”:2,“StatusReason”:75}’

What does it mean? User 0x234

@timothy Couldn’t you give me a list of the reasons?

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  
×