API Support Forum
OEC API > FIX Support > Error order reject
Author Topic: Error order reject
(9 messages, Page 1 of 1)
Moderators: VPfau
LLolli4579
Posts: 11
Joined: Jun 28, 2016


Posted: Sep 26, 2016 @ 04:19 AM             Msg. 1 of 9
Hi,

When buy 1 contract E-Mini S&P500 I have error reject message " Order breaks limits "

What's the problem ?

Thanks
Luca
Luca Lolli
CMicciche902
Posts: 225
Joined:


Posted: Sep 26, 2016 @ 10:02 AM             Msg. 2 of 9
Please try placing an order again.
Chris M
LLolli4579
Posts: 11
Joined: Jun 28, 2016


Posted: Sep 26, 2016 @ 11:57 AM             Msg. 3 of 9
I have same error
Luca
Luca Lolli
CMicciche902
Posts: 225
Joined:


Posted: Sep 26, 2016 @ 12:06 PM             Msg. 4 of 9
Risk Violation error due to a number of already open positions:

"LLolli4579:2892:API002892 Max credit = $0.00, Order requires $2,616.90 and needs additional credit of ($16,827.91). Cash and credit balance ($14,211.01). (Max $62,363.28 | Used $76,574.30).",1,12:54:47.875

I have flattened all positions, try again.
Chris M
LLolli4579
Posts: 11
Joined: Jun 28, 2016


Posted: Sep 27, 2016 @ 12:33 AM             Msg. 5 of 9
Now is ok

Thanks
Luca
Luca Lolli
LLolli4579
Posts: 11
Joined: Jun 28, 2016


Posted: Oct 07, 2016 @ 02:35 AM             Msg. 6 of 9
Hi,

I have this error Order breaks limits.
Could you flat all position?
I can do this ?

Thanks
Luca
Luca Lolli
CMicciche902
Posts: 225
Joined:


Posted: Oct 07, 2016 @ 08:45 AM             Msg. 7 of 9
Your account has been flattened, without issue. The "Order Breaks Limits" limit is provided in our Risk Violation messages.

Explained here - https://gainfutures.com/api/html/9900566b-260a-4247-8326-9698b013e7b8.htm
Risk Violations

It is pretty easy to check high level reason of rejection via ResultComments. But to get details about risk violation that was a reason for reject, you need to capture messages in OnError event:
C#
Copy

static void Main(string[] args)
{
...
oecapi.OnError += new OEC.API.OnErrorEvent(oecapi_OnError);
...
}

static void oecapi_OnError(Exception ex)
{
Console.WriteLine("OnError: {0}", ex.Message);
}

Risk violation text will look like that:
Risk violation: 1540:API001540 Max credit = 0.0000000000 USD,Order requires [3600.00000 USD] and needs additional credit of 130.00000 USD (cash leveraged) Cash and credit balance 125.00000 USD ...

where 1540 is OEC.API.Account.ID, API001540 is Spec
Chris M
LLolli4579
Posts: 11
Joined: Jun 28, 2016


Posted: Oct 07, 2016 @ 09:06 AM             Msg. 8 of 9
Hi Chris,
thanks for all your help
I use MC with EasyLanguage.
Can I do flat all position ?

thank you
Luca
Luca Lolli
CMicciche902
Posts: 225
Joined:


Posted: Oct 07, 2016 @ 10:40 AM             Msg. 9 of 9
Is MC Multi Charts? If so, consult the third party vendor for technical support. This forum is for assistance with programming and interfacing to our API.
Chris M