How to fix rejecting invalid message: quickfix.IncorrectDataFormat - quickfix

I have a QuickFIX initiator getting 1.23E-6 in tag 270 from market data. Then I saw QuickFIX/J throw the following error:
Rejecting invalid message: quickfix.IncorrectDataFormat: Incorrect data format for value, field=270
Any idea how to avoid the rejection and parse the correct value?
I also receive the scientific format of number from my 35=8 message in tag 44 (price), but I could just getString then convert them into BigDecimal with no issue.

The real problem here is that your counterparty should not be sending a scientific-notation value in that field. The field has type "Price", and per spec, that should be a whole or decimal number, thus that's what the QF engine is validating.
So, I don't know who your counterparty is, but maybe you want to check with their support and see if this might be a legit bug on their end.
(I can't explain why your 35=8/tag-44 message is being accepted. There must be a detail to your situation that I'm not aware of.)
If you need to work around this anyway: An easy cheat way to make the engine accept this message is to simply change the field's type to "string" in your Data Dictionary xml file. Of course, that will require you to always explicitly convert the string to BigDecimal, but it sounds like you will not have a problem with that.

Related

C# BsonDocument.Parse and invalid JSON

Am I missing something? BsonDocument.Parse() appears to allow invalid JSON input where there is valid document before the invalid characters start?
For example I would consider invalid, but parses fine:
{
"_id": ObjectId("5731080e61737e37f84c848d")
}
This is not a typo(
What happens is it will parse the initial document and ignore anything after the initial document.
Surely it should treat this as invalid?
This is likely because the parser simply parses the first document then stops, but I'd argue if anything else is in the token stream it should be considered a fail.
BsonDocument.Parse() appears to allow invalid JSON input where there is valid document before the invalid characters start?
Yes, the JsonReader allows the reading of multiple top-level documents, in accordance with how many formats output a document per-line. Looks like the BsonDocument.Parse only read until the end of the first document, while the JsonReader knows there is more to read and waiting to read the next one (which will throw exception).
Surely it should treat this as invalid?
I've opened a ticket CSHARP-1676 for this case. Perhaps if there is an extra 'text' after the first document it should also throw FormatException. Feel free to watch/upvote the ticket to receive updates.
This is based on mongocsharpdriver v2.2.x
Update: The ticket has been resolved and targeted for release v2.2.5. See ticket for more information.

Invalid signature returned when previewing 7digital track

I am attempting to preview a track via the 7digital api. I have utilised the reference app to test the endpoint here:-
http://7digital.github.io/oauth-reference-page/
I have specified what I consider to be the correct format query, as in:-
http://previews.7digital.com/clip/8514023?oauth_consumer_key=MY_KEY&country=gb&oauth_nonce=221946762&oauth_signature_method=HMAC-SHA1&oauth_timestamp=1456932878&oauth_version=1.0&oauth_signature=c5GBrJvxPIf2Kci24pq1qD31U%2Bs%3D
and yet, regardless of what parameters I enter I always get an invalid signature as a response. I have also incorporated this into my javascript code using the same oauth signature library as the reference page and yet still get the same invalid signature returned.
Could someone please shed some light on what I may be doing incorrectly?
Thanks.
I was able to sign it using:
url = http://previews.7digital.com/clip/8514023
valid consumer key & consumer secret
field 'country' = 'GB'
Your query strings parameters look a bit out of order. For OAuth the base string, used to sign, is meant to be in alphabetical order, so country would be first in this case. Once generated it doesn't matter the order in the final request, but the above tool applies them back in the same order (so country is first).
Can you make sure there aren't any spaces around your key/secret? It doesn't appear to strip white space.
If you have more specific problems it may be best to get in touch with 7digital directly - https://groups.google.com/forum/#!forum/7digital-api

FIX Message Can 35=X does not have Symbol or SecID/SecIDSource

Hi I need help to understand, if 35=X message should contain Symbol/SecID within the repeating group.
The FIX Specification indicates that under the repeating group both 55 and 48/22 are optional.
I received a message from my client without a symbol tag, please help me undersatnd if that was a bad formed message
20150923-15:06:14.976 : 8=FIXT.1.19=33635=X34=19153349=SENDER52=20150923-15:06:14.63756=RECEIVER268=8279=0269=1270=99.609375271=289279=0269=1270=99.6171875271=241279=0269=1270=99.625271=154279=0269=1270=99.6328125271=139279=0269=0270=99.6015625271=268279=0269=0270=99.59375271=244279=0269=0270=99.5859375271=171279=0269=0270=99.578125271=21610=198
You are advised to treat the default FIX message and field definitions as a set of suggested definitions.
In practice, no commercial FIX counterparty uses these definitions as-is. Every counterparty I've connected to makes modifications, adding or removing fields from messages or groups, creating new fields, or sometimes adding entirely new messages. No counterparty supports every message and field.
When connecting to a counterparty, do not assume anything. Your counterparty should provide documentation on how they expect their interface to be used, and which messages and fields they will send and which they expect to receive from you.
You need to read their specs and modify your FIXnn.xml DataDictionary file to match what they will be sending you.
If their spec says they will send you Symbol and/or SecurityID in a 35=X message, you need to make sure your DD file matches that.
This page might be helpful to you. (It's technically for the C# QuickFIX/n, but the DD file is the same for all QF versions.)
http://quickfixn.org/tutorial/custom-fields-groups-and-messages.html

entry must be roll rate entry type?

while sending marketDataRequest, fix Server responded me with error message.
entry must be roll rate entry type
I do not understand why i'm getting s error. Here is my code.
MarketDataRequest mkrReq = new MarketDataRequest(new MDReqID(
"Mkar-12345"), new SubscriptionRequestType(
SubscriptionRequestType.SNAPSHOT_PLUS_UPDATES),
new MarketDepth(0));
NoMDEntryTypes group1 = new NoMDEntryTypes();
group1.set(new MDEntryType(MDEntryType.BID));
mkrReq.addGroup(group1);
group1.set(new MDEntryType(MDEntryType.OFFER));
mkrReq.addGroup(group1);
MarketDataRequest.NoRelatedSym symGroup = new MarketDataRequest.NoRelatedSym();
symGroup.set(new Symbol("EUR/USD"));
mkrReq.addGroup(group1);
mkrReq.addGroup(symGroup);
This looks like a counterparty-specific error, not a FIX or QuickFIX one. Only someone familiar with your counterparty can answer this question.
Simply put, you are sending a message that is technically and syntactically correct, but is not what your counterparty wants to see. Obviously, they want those MDEntries to be of a specific type and format, and your message doesn't conform.
You will have to check your counterparty's documentation to determine exactly what that means (or ask them directly).

QuickFixn Outgoing Connection

I was hoping someone can shed some light on how the Quickfixn engine handles outgoing FIX messages... I have an outgoing connection set up, and I'm getting heartbeats. When I generate an outgoing message however, it gets rejected because it says that tag 58 is invalid for this message type... (35=AE) ... Normally, if this was an inbound connection, I could just modify the Data Dictionary and everything would be fine... but seeing as how this is an outgoing connection, plus I have my
UseDataDictionary property set to 'N' ... what does the quickfix engine use to validate the outgoing message? Can something be changed to allow the engine to pass the message ? Or is the only resolution not to include this tag in my outgoing message?
Any help on this matter would be greatly appreciated.
Edit-
The message is getting rejected by the quickfix engine. The message that I'm constructing and the respective reject message are:
8=FIX.4.4 9=400 35=AE 34=38 49=XXX 52=20130528-23:11:04.040 56=YYY 31=1.3022 32=1000000.00 39=0 55=EUR/USD 58=ABCD 60=20130528-22:34:52.000 64=20130531 75=20130529 570=N 571=ABCD 5495=0 5971=1302200.00 552=1 54=2 37=ABCD 453=3 448=LP1-DBAB 447=D 452=17 448=XXX 447=D 452=1 448=XXX 447=D 452=19 15=EUR 120=USD 10=082
8=FIX.4.4 9=130 35=3 34=38 49=YYY 52=20130528-23:11:04.283 56=XXX 45=38 58=Tag not defined for this message type 371=58 372=AE 373=2 10=033
I've seen incoming messages get rejected by the quickfix engine because the data dictionary didn't have the correct specs for the message... I thought this might be the same thing but the outgoing connection doesn't seem to use the data dictionary.
Your FIX library does not reject a message. The message is sent to the counter-party instead, which then rejects your message as invalid upon receiving and validating it. And the reason for that is because tag 58, if present, must be a part of “NoSides repeating group (tag 552), which in your case it is not, making the message ill-formed. What you have to do is send a "logically" correct message. I recommend you refer to the appropriate FIX protocol specification for a reference on how to construct a correct message.
Vlad's answer is correct, but I want to alert you to one other danger in your question.
I have my UseDataDictionary property set to 'N'
I am 90% sure you don't want to do this. Whatever you think you're gaining by using =N is probably based on a misunderstanding of something.
Without a DD, you can't read messages with repeating groups, because the engine won't know what fields go in what group.
In practice, every venue uses repeating groups. Therefore, you'll need to set UseDataDictionary=Y and you need to specify an xml file with DataDictionary=<file>.
The only reason we allow =N in QF/n is to be consistent with QF/C++ and QF/j.