API Support Forum
OEC API > API Support > A few questions
Author Topic: A few questions
(6 messages, Page 1 of 1)
Moderators: VPfau
CRamasamy4419
Posts: 19
Joined: Jun 01, 2020


Posted: Jun 07, 2020 @ 11:50 PM             Msg. 1 of 6
I'm still on the test environment and using 9300 for my FIX protocols. I have a few questions:
1. My test market order, future limit buy and future limit sell order are all getting rejected. The messages are getting sent properly. What I'm receiving is `OrderId: 1591591303 Status: Rejected Side: Sell` or `OrderId: 1591591303 Status: Rejected Side: Buy`. Is this because I'm on test environment? Or because I'm on 9300? Or both? The criteria I'm sending is ['symbol', 'maturity', 'quantity'] for market orders, ['symbol', 'maturity', 'quantity', 'price'] for limit buy/sell orders. The reason is showing "order breaks limits"
2. What are these ID fields and where can i get them from: `SecurityReqID`, `MDReqID`?

Thanks.
Edited by CRamasamy4419 on Jun 07, 2020 11:54 PM

Edit: It think I got the answer to my first question - the test environment will reject order back if that's outside of trading hours. So that's a good thing I learned and I'll be able to use it as an edge case.
Edited by CRamasamy4419 on Jun 08, 2020 07:59 AM
CMicciche902
Posts: 367
Joined:


Posted: Jun 08, 2020 @ 08:53 AM             Msg. 2 of 6
You're getting rejected since you have an open position and working orders which require margin in your account. The risk server is responding with "order breaks limits."

Line 6: 00:02:06.903 DEBUG - From provider: Error Text=Risk violation: 10058:API010058 Not enough liquidity to cover margin. Margin Required: $108,000.00, Deficit: $49,500.00, Net Liq: $58,500.00. Cash $50,000.00, P&L $8,500.00
Line 12: 00:02:09.679 DEBUG - From provider: Error Text=Risk violation: 10058:API010058 Not enough liquidity to cover margin. Margin Required: $108,000.00, Deficit: $48,925.00, Net Liq: $59,075.00. Cash $50,000.00, P&L $9,075.00
Line 18: 00:08:03.021 DEBUG - From provider: Error Text=Risk violation: 10058:API010058 Not enough liquidity to cover margin. Margin Required: $108,000.00, Deficit: $52,375.00, Net Liq: $55,625.00. Cash $50,000.00, P&L $5,625.00
Line 24: 00:08:05.825 DEBUG - From provider: Error Text=Risk violation: 10058:API010058 Not enough liquidity to cover margin. Margin Required: $108,000.00, Deficit: $52,950.00, Net Liq: $55,050.00. Cash $50,000.00, P&L $5,050.00
Line 30: 06:25:56.245 DEBUG - From provider: Error Text=Risk violation: 10058:API010058 Not enough liquidity to cover margin. Margin Required: $108,000.00, Deficit: $30,525.00, Net Liq: $77,475.00. Cash $50,000.00, P&L $27,475.00
Line 36: 06:25:58.936 DEBUG - From provider: Error Text=Risk violation: 10058:API010058 Not enough liquidity to cover margin. Margin Required: $108,000.00, Deficit: $30,525.00, Net Liq: $77,475.00. Cash $50,000.00, P&L $27,475.00
Line 76: 08:00:03.675 DEBUG - From provider: Error Text=Risk violation: 10058:API010058 Not enough liquidity to cover margin. Margin Required: $168,000.00, Deficit: $84,725.00, Net Liq: $83,275.00. Cash $71,918.48, P&L $11,356.52
Line 82: 08:00:09.119 DEBUG - From provider: Error Text=Risk violation: 10058:API010058 Not enough liquidity to cover margin. Margin Required: $168,000.00, Deficit: $84,725.00, Net Liq: $83,275.00. Cash $71,918.48, P&L $11,356.52
Line 88: 08:00:11.831 DEBUG - From provider: Error Text=Risk violation: 10058:API010058 Not enough liquidity to cover margin. Margin Required: $168,000.00, Deficit: $84,725.00, Net Liq: $83,275.00. Cash $71,918.48, P&L $11,356.52
Line 148: 08:06:34.099 DEBUG - From provider: Error Text=Risk violation: 10058:API010058 Not enough liquidity to cover margin. Margin Required: $152,000.00, Deficit: $67,975.00, Net Liq: $84,025.00. Cash $71,918.48, P&L $12,106.52
Line 154: 08:07:58.469 DEBUG - From provider: Error Text=Risk violation: 10058:API010058 Not enough liquidity to cover margin. Margin Required: $152,000.00, Deficit: $66,325.00, Net Liq: $85,675.00. Cash $71,918.48, P&L $13,756.52
Line 160: 08:08:01.187 DEBUG - From provider: Error Text=Risk violation: 10058:API010058 Not enough liquidity to cover margin. Margin Required: $152,000.00, Deficit: $66,325.00, Net Liq: $85,675.00. Cash $71,918.48, P&L $13,756.52
Line 166: 08:08:52.299 DEBUG - From provider: Error Text=Risk violation: 10058:API010058 Not enough liquidity to cover margin. Margin Required: $152,000.00, Deficit: $66,325.00, Net Liq: $85,675.00. Cash $71,918.48, P&L $13,756.52
Line 172: 08:08:55.010 DEBUG - From provider: Error Text=Risk violation: 10058:API010058 Not enough liquidity to cover margin. Margin Required: $152,000.00, Deficit: $66,325.00, Net Liq: $85,675.00. Cash $71,918.48, P&L $13,756.52
Line 178: 08:41:37.446 DEBUG - From provider: Error Text=Risk violation: 10058:API010058 Not enough liquidity to cover margin. Margin Required: $152,000.00, Deficit: $78,700.00, Net Liq: $73,300.00. Cash $71,918.48, P&L $1,381.52
Line 184: 08:41:40.084 DEBUG - From provider: Error Text=Risk violation: 10058:API010058 Not enough liquidity to cover margin. Margin Required: $152,000.00, Deficit: $78,700.00, Net Liq: $73,300.00. Cash $71,918.48, P&L $1,381.52
Line 240: 08:43:46.746 DEBUG - From provider: Error Text=Risk violation: 10058:API010058 Not enough liquidity to cover margin. Margin Required: $168,000.00, Deficit: $86,700.00, Net Liq: $81,300.00. Cash $77,965.09, P&L $3,334.91


Chris M

Edited by CMicciche902 on Jun 08, 2020 08:55 AM
Edited by CMicciche902 on Jun 08, 2020 09:12 AM
CRamasamy4419
Posts: 19
Joined: Jun 01, 2020


Posted: Jun 08, 2020 @ 09:54 AM             Msg. 3 of 6
Thanks, Chris.
What about the securityReqID?
CMicciche902
Posts: 367
Joined:


Posted: Jun 08, 2020 @ 10:31 AM             Msg. 4 of 6
This isn't used in order messages. Are you using this for Security List or Definition requests?
If so, review http://gainfutures.com/GFAPI/?topic=html/0f30696e-680b-40a1-b935-1bdfbd9dd14d.htm#SecurityReqID or http://gainfutures.com/GFAPI/?topic=html/e7687a06-7c48-4bf2-9ef4-fa73087f908c.htm

Name = SecurityReqID
Type = STRING
Number = 320

Used In:
SecurityListRequest(x)
SecurityList(y)
SecurityDefinitionRequest(c)
SecurityDefinition(d)
Chris M
CRamasamy4419
Posts: 19
Joined: Jun 01, 2020


Posted: Jun 08, 2020 @ 11:32 AM             Msg. 5 of 6
I'm not trying to use it in the order messages, I'm trying to use it to pull a list of securities.

I've reviewed those documentations, but they don't really tell much - am I supposed to generate them, or is client supposed to send in response to something before i send the request over?
CMicciche902
Posts: 367
Joined:


Posted: Jun 08, 2020 @ 04:01 PM             Msg. 6 of 6