Author |
Topic: No errors reported on risk violation (6 messages, Page 1 of 1) |
||||
---|---|---|---|---|---|
Moderators: VPfau | |||||
XGong81 Posts: 6 Joined: Apr 24, 2013 |
Hi, when I am placing an order which exceed buying power I am not getting any risk violation errors or notifications. I am using the new GFAPI and here is some code snippet:
gfClient.Logging.ErrorOccurred += this.ErrorOccured; gfClient.Messaging.Notifications.NotificationMessageReceived += NotificationMessageReceived; private void ErrorOccured(object sender, GF.Api.Utils.ErrorEventArgs e) { //Not getting called string sErrorMessage = e.Exception.Message; } private void NotificationMessageReceived(IGFClient client, GF.Api.Messaging.Notifications.NotificationMessageEventArgs e) { //Not getting called string sMessage = e.NotificationMessage.Message; } The API version is as follows: GF.Api.dll 4.0.3.21 GF.Api.Impl.dll 4.0.3.33 GF.Api.Values.dll 4.0.3.10 GF.Common.dll 4.0.3.3 Thanks in advance, xg Xingyu Gong
|
||||
ETrifonov Posts: 63 Joined: |
Hello Xingyu,
If you placing an order which exceed buying power, it will be rejected and will should receive order update. Not sure why you expecting reject message via GF.Api.Messaging.Notifications. Please GF API Notification documentation https://gainfutures.com/GFAPI/ https://gainfutures.com/GFAPI/?topic=html/d75ea6d3-3433-401e-a3ac-42681240e1e9.htm Thank you. Evgeny
|
||||
XGong81 Posts: 6 Joined: Apr 24, 2013 |
In the OEC api, I will get an error message from the OECClient.OnError handler. I thought GFApi will be similar.
Xingyu Gong
|
||||
ETrifonov Posts: 63 Joined: |
That handler is moved to GFClient.Logging.ErrorOccurred.
Evgeny
|
||||
XGong81 Posts: 6 Joined: Apr 24, 2013 |
Hi Evgeny,
Initially I was trying to catch the error from GFClient.Logging.ErrorOccured but it does not gets raised (Test and Production server) and then I tried Messaging. Xingyu Xingyu Gong
|
||||
ETrifonov Posts: 63 Joined: |
Hi Xingyu,
Please use ITradersApi.TraderError event to receive risk violation errors. https://gainfutures.com/GFAPI/?topic=html/E_GF_Api_Traders_ITradersApi_TraderError.htm Client.Traders.OnTraderError += this.ErrorOccured Thank you. Evgeny
|
||||