Git Product home page Git Product logo

quickfixn's Introduction

QuickFIX/N

Build status NuGet Version

For tutorials on how to use QuickFIX/n, visit the website.

This README is about setting up your system to do QuickFIX/n development.

System Setup

  • This project uses .NET 6.

  • All scripts are in Powershell, and should work on both Windows and Unix-based platforms.

Code Generation

DDTool is a C#-based tool for analyzing DataDictionary files and regenerating the source for message and field classes.

Check out the DDTool directory to learn more, or you can just run this script:

pwsh scripts\Generate-Message-Sources.ps1

Build and Test

It is assumed that developers know how to use dotnet cli tools or their IDE of choice.

The simplest spin-up instructions are:

  • dotnet build - to build
  • dotnet test - to run all unit and acceptance tests (which use NUnit)

To run only UTs or only ATs:

  • dotnet test UnitTests
  • dotnet test AcceptanceTests

To get more detail in the test ouput:

  • dotnet test -l "console;verbosity=detailed" AcceptanceTest

To run a specific suite, use --filter, e.g.

  • dotnet test --filter Fix44Test AcceptanceTest (Fix44Test is the TestCaseSource function in Fix44.cs)

AcceptanceTest logs are output to bin/Debug/net6.0/log.

Credits

Connamara Systems

QuickFIXn is maintained and funded by Connamara.

The names and logos for Connamara are trademarks of Connamara Systems, LLC.

Licensing

This software is available under the QuickFIX Software License. Please see the LICENSE for the terms specified by the QuickFIX Software License.

quickfixn's People

Contributors

aelgasser avatar akamyshanov avatar andbjorn avatar apage avatar aswaney avatar brobits avatar cbusbey avatar daino3 avatar daniel-svensson avatar dckorben avatar dependabot-preview[bot] avatar formator avatar fourpastmidnight avatar gbirchmeier avatar huwmjenkins avatar jhickson avatar kennystone avatar kkozel avatar ligu avatar martinadams avatar mgatny avatar michaelwilner avatar mjwood7 avatar mvdtom avatar pvkv1799 avatar rob-hague avatar shanetrotter avatar staffanu avatar vbfox avatar zherr avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

quickfixn's Issues

wrong BeginString in generated FIX50 files

FIX50 generated files are serializing with the wrong BeginString (FIX.5.0 instead of FIX.T or whatever).

Task 1: Make an acceptance test that causes test app to send an application-level message. It should fail because the BeginString is wrong.

Task 2: Fix the BeginString and make the test pass.

FieldMap.GetField(XXXField) doesn't return?

QuickFix.FieldMap.GetField(XXXField) doesn't return anything.

This seems odd. Both QF/C++ and QF/J return stuff. I'm not sure where the precedent came from for our version.

I'm inclined to change them to be more in line with the other ports. Any objections?

Heartbeat not sent during constant traffic

I believe I've found a bug:

As an initiator, if you receive constant traffic for an amount of time greater than your heartbeat interval, you'll skip the heartbeat and therefore will/should be disconnected by the remote host.

I think the logic responsible is found in SocketInitiatorThread.Read, within the nested if/then statements.

Built in SSL

Would it be possible to integrate SSL into QuickFIX/n? We currently have to set up stunnel around the FIX connections so it would be fantastic to remove this requirement and allow it to be a configuration option.

rewrite atrun.exe

because it feels dirty to copy an executable from a different project

Cannot Access NoPartyIDsGroup on TradeCaptureReport

Hello, I am trying to process a trade capture report and I cannot parse a non-standard group. The exchange is sending NoPartyIDGroup on that message as an extension to FIX44. The fields are definitely there (453). IsSetField reports false. I converted the message to just a standard FIX message and IsSetField passed, but when I tried to access the group, it reported that the tag was not on the message.

Can´t connect to initiator (QuickFix .NET wrapper -> QuickFixN)

I was using .NET wrapper for quickfix and everything worked fine. Recently I was looking for a native alternative and I found this project. So I took my old project and basicly rewrite it. But now it seems that my initiator can´t even get a working connection since the OnLogon event is never called. My configuration file is still the same:

[DEFAULT]

ConnectionType=initiator

LogonTimeout=1
LogoutTimeout=1

ValidateFieldsOutOfOrder=Y
ValidateUserDefinedFields=Y
ValidateFieldsHaveValues=Y
AllowUnknownMsgFields=Y
SocketTcpNoDelay=Y

FileStorePath=Store
FileLogPath=Log

CheckLatency=N
CheckCompID=Y

SendRedundantResendRequests=Y
ContinueInitializationOnError=Y

ResetOnLogon=Y
ResetOnLogout=Y
ResetOnDisconnect=Y
ForceResync=Y

HeartBtInt=30
StartTime=03:00:00
EndTime=22:00:00
UseLocalTime=Y

ReconnectInterval=20

UseDataDictionary=Y
DataDictionary=FXService.FXCM.xml

BeginString=FIX.4.4

[SESSION]

username=xxx
password=xxx
pin=xxx

SenderCompID=xxx
TargetCompID=xxx
TargetSubID=xxx

SocketConnectHost=fixdemo.fxcorporate.com
SocketConnectPort=8043

I don't know if this is a proper channel for this kind of problem but I appreciate any help.

Rename all interfaces to start with "I"

...in accordance with standard C# naming convention.

Existing interface names should be changed to empty sub-interfaces of the new-named interface in order to preserve compilation of existing projects. They should also be deprecated (with the System.Obsolete annotation).

Example: see IAcceptor and it's empty sub-interface Acceptor.

MessageCracker.Crack has no generic code path...

...if one does not want to implement ALL OnMessage methods.

I suggest tocreate an alternative TryCrack method that returns true (if an OnMessage method was found) or false (if not).

The Crack method should use OnCrack and still throw exception on false.

This allows those who want partial strong handling to work properly. It is in sync with .NET collection and other handling (TryGet, TryParse etc.).

DecimalConverter Convert issue

if CurrentCulture property is different than English(for example Turkish), convert method is not working properly.
To achieve this issue, you can change current thread CurrentCulture property to english culture before calling Message.GetDecimal() method.

To solve this issue, in Convert method on QuickFix.Fields.Converters.Convert class, Line System.Convert.ToDecimal(d) should be changed to System.Convert.ToDecimal(d, CultureInfo.InvariantCulture).

ValidateLengthAndChecksum issue

Altough we changed property ValidateLengthAndChecksum to false on OnCreate method, we saw "Could not parse message: Invalid body length" message on event log file. we expect to pass such as these errors.

when we check ReadFixMessage method on Parser class, BodyLength is being checked. so ValidateLengthAndChecksum setting for checking bodylength is becoming useless.

i think checking bodylength on ReadFixMessage method is not necessary.
if you agree with me, some codes which check bodylength on ReadFixMessage method should be removed.

Change occurrences of "QuickFIX.NET" to "QuickFIXn"

The former is an artifact from the early versions (name was changed because of trademark concerns).

Looks like we may only need to change the dir name, the sln reference to that dir, and any scripts that point to that dir.

Currency Field Types

From an email to quickfixn:

It seems all your currency fields (e.g. QuickFix.Fields.Currency/SettlCurrency/AllocSettlCurrency)
have been defined as DecimalField rather than StringField. These fields are for
currencies (e.g. "GBP") not a decimal amount.

Cannot cast generic 'Group' to 'NoMDEntriesGroup'

Hi all,

I'm trying to get a Group out of a message, but the generic group won't cast into the specific group variable.

The following code is based on the example shown on the website at http://quickfixn.org/tutorial/repeating-groups

public void OnMessage(QuickFix.FIX42.MarketDataIncrementalRefresh message, SessionID sessionID)
{
    MDReqID mdReqID = message.MDReqID;
    var noMDEntriesGroup = new QuickFix.FIX42.MarketDataIncrementalRefresh.NoMDEntriesGroup();
    for (int grpIndex = 1; grpIndex <= message.GetInt(Tags.NoMDEntries); grpIndex += 1)
    {
        noMDEntriesGroup = message.GetGroup(grpIndex, Tags.NoMDEntries);
        // code omitted here
    }
}

It generates the following error in Visual Studio

Error 1 Cannot implicitly convert type 'QuickFix.Group' to 'QuickFix.FIX42.MarketDataIncrementalRefresh.NoMDEntriesGroup'. An explicit conversion exists (are you missing a cast?)

According to the error message, I tried an explicit conversion to no avail (code follows). Doing this got rid of the Visual Studio error message, but resulted in an InvalidCastException at runtime.

noMDEntriesGroup = (QuickFix.FIX42.MarketDataIncrementalRefresh.NoMDEntriesGroup)message.GetGroup(grpIndex, Tags.NoMDEntries);

Thanks,
Logan

StartDay/EndDay not working properly

You are not accounting for being in-between days when doing your check for StartDay/EndDay for the CheckTime call which will cause SessionSchedule.IsSessionTime to fail... To repro just add a StartTime/EndTime of like 20:00:00 and 22:00:00 with a StartDay & EndDay that is valid. So today is Thursday and if my StartDay is Sunday and EndDay is Friday, my session never starts because the IsSessionTime fails.

Connect pending

Hi,

I downloaded quickFIXN Demo, I builded and run...

But I cannnot establish any connection, I try even to change protocol FIX (FIX42 to FIX44) because I have to set Username and Password.

But seems that I have another kind of problem

QFApp::Start() called
The thread '' (0xa84) has exited with code 0 (0x0).
The thread '' (0x1d40) has exited with code 0 (0x0).
.....

do you have any suggestion??

best regards
Alessio

Sequence numbers not being reset

I reconnected my FIX session today, having last received a message last week. The last sequence number received last week was 6202. When the connection came up today it seemed to be expecting the next sequence (6203) rather than resetting back to 1. The configuration I am using has a distinct start/end time, so the sequences should be getting reset automatically when the connection comes up on a new day.

This is a critical problem. Log attached

20111229-16:59:29.101 : 8=FIX.4.4|9=75|35=0|34=6202|49=TID|52=20111229-16:59:24.651|56=SID|112=TEST|10=116|
20111229-16:59:54.333 : 8=FIX.4.4|9=233|35=Q|34=177|49=SID|52=20111229-16:59:54.328|56=TID|128=ABN|17=tB_Exec_5|31=1|32=10000|37=tB_Ord_3|38=0|54=1|55=LLOY|58=Execution tB_Exec_5 received has quantity exceeding order. 10000 received, only 0 remaining.|127=C|10=216|
20111229-17:00:42.036 : 8=FIX.4.4|9=74|35=1|34=178|49=SID|52=20111229-17:00:42.033|56=TID|112=TEST|10=055|
20111229-17:02:25.297 : 8=FIX.4.4|9=77|35=A|34=179|49=SID|52=20111229-17:02:25.294|56=TID|98=0|108=60|10=097|
20120104-10:33:52.616 : 8=FIX.4.4|9=77|35=A|34=180|49=SID|52=20120104-10:33:52.429|56=TID|98=0|108=60|10=078|
20120104-10:33:52.710 : 8=FIX.4.4|9=75|35=A|34=1|49=TID|52=20120104-10:33:52.710|56=SID|98=0|108=60|10=221|
20120104-10:33:52.773 : 8=FIX.4.4|9=117|35=5|34=181|49=SID|52=20120104-10:33:52.773|56=TID|58=MsgSeqNum too low, expecting 6203 but received 1|10=132|
20120104-10:34:52.384 : 8=FIX.4.4|9=77|35=A|34=182|49=SID|52=20120104-10:34:52.381|56=TID|98=0|108=60|10=078|
20120104-10:34:52.389 : 8=FIX.4.4|9=75|35=A|34=4|49=TID|52=20120104-10:34:52.387|56=SID|98=0|108=60|10=235|
20120104-10:34:52.391 : 8=FIX.4.4|9=117|35=5|34=183|49=SID|52=20120104-10:34:52.389|56=TID|58=MsgSeqNum too low, expecting 6203 but received 4|10=141|

Initiator::Stop() doesn't kill connections

If an initiator is connected, Initiator::Stop() doesn't appear to have any effect. There's probably an exception getting swallowed.

If the initiator is in a disconnected state, then Stop() will kill the QF thread.

If don't call Stop(), then the QF thread will stay open. GUI apps will stay open in the background.

message serialization only uses in-built DD

There is no way to provide an alternate DD for message serialization (e.g. creation of OUTGOING messages only). Repeating groups will be serialized with the in-built DD only, which means it won't use alternate delimiter fields or field orderings.

Remove Ruby dependency

I'm not sure if we even want to do this.

In an ideal world, the whole project is ".NET" (it's incredibly easy to install ruby on windows, though).

This would mean all code generation and testing is converted to native .NET somehow.

One possibility: http://ironruby.net/

Very low priority.

fieldorder field is ignored in group

when trying send message which has group(for example Instrument block in Market Data Request), group tags are not sent in order according to fieldOrder array property in the group.

Reject message which reject reason is "REPEATING_GROUP_FIELDS_OUT_OF_ORDER" can be received related to this issue.

NullReferenceException in SocketReader.cs

To reproduce:

Run Examples.SimpleAcceptor with its default config

Run UIDemo with its default config

UIDemo => click Connect button, wait till it connects, then click Disconnect

In SimpleAcceptor's event logs, you'll see:

20111117-17:47:56.010 : SocketReader Error: System.NullReferenceException: Object reference not set to an instance of an object.
   at QuickFix.SocketReader.Read() in C:\dev\quickfixn\QuickFIX.NET\SocketReader.cs:line 28
20111117-17:47:56.010 : shutdown requested: Object reference not set to an instance of an object.
20111117-17:47:56.010 : shutdown
20111117-17:48:20.764 : shutdown requested: reactor is shutting down

If you run it in a debugger, that's all the stacktrace you'll get.

At time of creating this bug, the code lines are:

24        public void Read()
25        {
26            try
27            {
28                if (tcpClient_.Client.Poll(1000000, SelectMode.SelectRead)) // one-second timeout

The variable that's null is tcpClient_.Client.

I suspect that SocketReader::Disconnect() is getting invoked, shutting down the socket, while something else is still running Socket::Read() in a loop somewhere.

support for writing messages to XML

Message.ToXML and the like.

Need investigation to determine full scope of this work (i.e. see the interfaces for QF/C++ and QF/J and port them).

SessionSettings does not release config file

After calling Load(StreamReader) in SessionSettings constructor, FileStream.Close() method should be called. Otherwise file is still being used by other process.

if i create SessionSettings object and delete config file, we get exception which Message is "The process cannot access the file because it is being used by another process".

Character Encoding

if it is possible, can you provide to change character encoding(Default is UTF8) for sending and receiving messages?

repeating group serialization bug

FIX5 says fields within repeating groups do not need a specific order, except that the delimiter must come first.

FIX.4.4 (and earlier?) says that fields within repeating groups must match the order specified in the message definition. (see Section "FIX PROTOCOL SYNTAX", sub-section "FIX 'Tag=Value' SYNTAX" -> Message Format -> Item 4)

Thus, we will provide a boolean config option named something like "ExactOrderForRepeatingGroupFields=Y/N" to specify whether messages will be serialized with fields in the prescribed full order or not. If Y, then the FIX.4.4 behavior will be obeyed. If N, then FIX.5 behavior will be used.

Message.GetMsgType() is broken

Added unit test MessageTests:TestGetMsgType() to confirm failure.

Related question: why have both this function and Message.IdentifyType? Kinda redundant.

Remove all TODO/FIXME comments

Remove all TODO/FIXME comments.

If they can be fixed easily, fix them.

If they are non-trivial, remove the comment and create a new issue for it.

message constructor parameter differences

The generated constructors for certain messages have different parameter lists than those for C++ and Java.

Example:
For ExecutionReport, C# takes a symbol. C++ and Java do not. See pasted code fragments below.

C++:

    ExecutionReport(
        const FIX::OrderID& aOrderID,
        const FIX::ExecID& aExecID,
        const FIX::ExecType& aExecType,
        const FIX::OrdStatus& aOrdStatus,
        const FIX::Side& aSide,
        const FIX::LeavesQty& aLeavesQty,
        const FIX::CumQty& aCumQty,
        const FIX::AvgPx& aAvgPx )
    : Message(MsgType())

C#:

    public ExecutionReport(
        QuickFix.Fields.OrderID aOrderID,
        QuickFix.Fields.ExecID aExecID,
        QuickFix.Fields.ExecType aExecType,
        QuickFix.Fields.OrdStatus aOrdStatus,
        QuickFix.Fields.Symbol aSymbol,
        QuickFix.Fields.Side aSide,
        QuickFix.Fields.LeavesQty aLeavesQty,
        QuickFix.Fields.CumQty aCumQty,
        QuickFix.Fields.AvgPx aAvgPx
    ) : this()

I suspect maybe there is a different interpretation of the "Instrument" component. In the XML, the component is marked Required=Y, but all the fields inside are Required=N. I think the C# generator is considering the first field of this component to be required, and thus putting it in the ctor parameter list, whereas C++ and Java must just ignore it completely.

Unable to run multiple instances

Is there a reason I'm unable to run multiple instances of a vb.net program with quickfix? It fails on instantiating the SocketInitiator.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.