Page 1 of 2

Failed requests issue

PostPosted: Wed Sep 14, 2011 7:34 pm
by frAnton
Hi there,

it seems to me that there is an issue with the failed requests reporting. Sometimes it does not go through the onRequestFailed(), but inserts the record to the MESSAGES table instead.
I think that this is related to at what point the order has failed.
The good thing though is that teh failure gets reported somewhere. The thing that I would like to ask you to correct is to give the Client more details about the failure in the message. Right now it says that "Your order X7XXX765XX could not be executed(/)". It would be nice to have at least the Instrument Name in this message and the reason why the order failed.

thanks,
Anton.

Re: Failed requests issue

PostPosted: Thu Sep 15, 2011 6:31 am
by sunshine
Actually, successful execution of a request doesn't mean successful creation of an order.
The order can be rejected by the trading system for various reasons, for example, because of insufficient margin on your account. In this case, the trading system sends a record to the Messages table. Usually, this message includes the reason why the order is rejected.
Could you please provide additional information about the problem:
1) A full text of the error message
2) The number of the order.

Re: Failed requests issue

PostPosted: Thu Sep 15, 2011 9:07 am
by frAnton
sunshine wrote:Actually, successful execution of a request doesn't mean successful creation of an order.
The order can be rejected by the trading system for various reasons, for example, because of insufficient margin on your account. In this case, the trading system sends a record to the Messages table. Usually, this message includes the reason why the order is rejected.
Could you please provide additional information about the problem:
1) A full text of the error message
2) The number of the order.


Hi sunshine,

Here's two rejected orders my Client got yesterday:

1. Subject: 'Order 85379645 rejected'
Text: 'Your order 85379645 could not be executed(\)'

2. Subject: 'Order 85379653 rejected'
Text: 'Your order 85379653 could not be executed(\)'

This is what the Client received on the Messages table insert event. I would like to have more details in this message as at the moment the order failed all the Client knows was the RequestId and not the order #.

thanks,
Anton.

Re: Failed requests issue

PostPosted: Fri Sep 16, 2011 3:06 am
by sunshine
I have forwarded the issue to server-side developers. I will get back to you as soon as I'll get the reply from them.

Re: Failed requests issue

PostPosted: Fri Sep 16, 2011 8:04 am
by sunshine
Could you please also provide:
1) The name of the server you use (you can see it on the Trading Station status bar if you log in with your account, something like U100D1 or MiniReal).
2) The account identifier
3) A code snippet how do you create an order for which you get such error message (Your order could not be executed(\)). That is, which values you set in valuemap, e.g. which order type etc., and how you send a request. This will greatly help to understand what is going wrong.

Re: Failed requests issue

PostPosted: Sun Sep 18, 2011 10:03 pm
by frAnton
sunshine wrote:Could you please also provide:
1) The name of the server you use (you can see it on the Trading Station status bar if you log in with your account, something like U100D1 or MiniReal).
2) The account identifier
3) A code snippet how do you create an order for which you get such error message (Your order could not be executed(\)). That is, which values you set in valuemap, e.g. which order type etc., and how you send a request. This will greatly help to understand what is going wrong.


Hi sunshine,

here you go:
Message: 'Your order 85444919 cannot be executed(\)'

1. Minireal2
2. XXX
3.
/** Create Range order.*/
public string CreateRangeOrder(string sOfferID, string sAccountID,
int iAmount, double dRateMin, double dRateMax, string sBuySell,
double dPegStopOffset,
double dPegLimitOffset,
string ADescription)
{

O2GRequestFactory factory = mSession.getRequestFactory();

O2GValueMap valuemap = factory.createValueMap();
valuemap.setString(O2GRequestParamsEnum.Command, fxcore2.Constants.Commands.CreateOrder);
valuemap.setString(O2GRequestParamsEnum.OrderType, fxcore2.Constants.Order.MarketOpenRange);
valuemap.setString(O2GRequestParamsEnum.AccountID, sAccountID); // The identifier of the account the order should be placed for.
valuemap.setString(O2GRequestParamsEnum.OfferID, sOfferID); // The identifier of the instrument the order should be placed for.
valuemap.setString(O2GRequestParamsEnum.BuySell, sBuySell); // The order direction (Constants.Buy for buy, fxcore2.Constants.Sell for sell).
valuemap.setDouble(O2GRequestParamsEnum.RateMin, dRateMin); // The minimum dRate at which the order can be filled.
valuemap.setDouble(O2GRequestParamsEnum.RateMax, dRateMax); // The maximum dRate at which the order can be filled.
valuemap.setString(O2GRequestParamsEnum.CustomID, ADescription); // The custom identifier of the order.
valuemap.setInt(O2GRequestParamsEnum.Amount, iAmount);
//added to create stop/limit
valuemap.setString(O2GRequestParamsEnum.PegTypeStop, fxcore2.Constants.Peg.FromOpen);//FromClose); // The peg stop type
valuemap.setDouble(O2GRequestParamsEnum.PegOffsetStop, dPegStopOffset);
valuemap.setString(O2GRequestParamsEnum.PegTypeLimit, fxcore2.Constants.Peg.FromOpen); // The peg limit type
valuemap.setDouble(O2GRequestParamsEnum.PegOffsetLimit, dPegLimitOffset);


O2GRequest request = factory.createOrderRequest(valuemap);
mSession.sendRequest(request);
return request.RequestID;
}
Params:

sOfferID: 1;
sSAccountId: XXX;
iAmount: 1000;
dRateMin: 1.36612;
dRateMax: 1.36642;
sBuySell: S;
dPegStopOffset: 16;
dPegLimitOffset: -6;
ADescription: (xxxxxxxxxx)

hope this helps.

thanks,
Anton.


Added:
Based on my log it seems that only S orders are rejected by the server.
B orders execute just fine.

Re: Failed requests issue

PostPosted: Wed Sep 21, 2011 7:13 am
by sunshine
Thanks for your reply.
The server side developers investigated the issue and found that the order got rejected by a bank as the market moved.
They confirm the issue with a blank description of order reject and currently they are working on the fix.
Thanks again.

Re: Failed requests issue

PostPosted: Wed Sep 21, 2011 7:56 am
by frAnton
sunshine wrote:Thanks for your reply.
The server side developers investigated the issue and found that the order got rejected by a bank as the market moved.
They confirm the issue with a blank description of order reject and currently they are working on the fix.
Thanks again.


Hi sunshine,

thank you for the answer.
However, I am getting all Sell orders rejected with the same message 'your order could not be executed". And I have all Buy orders executed with no problem.
The 'market move' reason sounds very strange to me.
But anyway, when can we expect more info in this error message? Instrument Name, and teh reason why the order was rejected would be just fine.

thanks,
Anton,

Re: Failed requests issue

PostPosted: Wed Sep 21, 2011 6:55 pm
by frAnton
I have a chance to play with CreateRangeOrder() function, it does not create Sell orders for
fxcore2.Constants.Order.MarketOpenRange.

It is either fails on validation, what I basically expect if I pass wrong parameters.
Or it returns 'Your order cannot be executed' error regardless of how large the range is set.
Like for example:
The current rate was : 1.3564;
I called CreateRangeOrder() method from your examples having the range set at:
dRateMin: 1.3539;
dRateMax: 1.3589;
sBuySell: S;

It ended up with 'Your order cannot be executed' error.

thanks,
Anton.

Re: Failed requests issue

PostPosted: Thu Sep 22, 2011 8:43 am
by sunshine
Unfortunately I couldn't recreate the issue. Do you always get reject for Sell Market Range orders or in some cases? Which Time-In-Force and amount do you use for the Sell order?