Skip to content

Commit

Permalink
update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
degloff committed Apr 15, 2024
1 parent 1bf3afb commit 6b2d2a9
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 20 deletions.
62 changes: 43 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,20 @@
# Phoenix Prime FIX Client Examples
# Phoenix Prime FIX Client Examples Package

This package provides a reference implementation of FIX based trading client connecting to __Phoenix Prime__.
It illustrates how to use the FIX protocol of __Phoenix Prime__ for order execution and to obtain streaming market
data.

The project depends on the open sourced [Phoenix Prime FIX Foundation Package](https://github.com/mtxpt/phx-fix-base).
which illustrates how to properly set up the different outgoing FIX messages and how to parse the incoming FIX
messages. The underlying FIX engine is the open source FIX library and application framework [QuickFix](https://quickfixengine.org).
messages. The underlying FIX engine is the open source FIX library and application framework [QuickFIX](https://QuickFIXengine.org).

## Requirements

The project requires
- [Phoenix Prime FIX Foundation Package](https://github.com/mtxpt/phx-fix-base) phx-fix-base >= 1.0
- Python >= 3.11
- QuickFIX >= 1.15.1
- Dependencies as listed in `requirements.txt`


## Technical Overview of Phoenix Prime
Expand Down Expand Up @@ -66,7 +74,7 @@ SocketConnectHost=127.0.0.1
These configurations are usually passed to the FIX application in a
client specific configuration file `client.cfg` in the `[SESSION]` section.

Note that QuickFix also requires in the `[SESSION]` configuration section a reference to a
Note that QuickFIX also requires in the `[SESSION]` configuration section a reference to a
FIX schema file. __Phoenix Prime__ uses the schema provided in `phx/fix_spec/FIX44.xml`.


Expand Down Expand Up @@ -121,8 +129,8 @@ python3 main.py

For those who do not know enough about FIX you can learn more here

- [QuickFIX](http://www.quickfixengine.org/)
- [QuickFix documentation](https://quickfixengine.org/c/documentation/)
- [QuickFIX](http://www.QuickFIXengine.org/)
- [QuickFIX documentation](https://QuickFIXengine.org/c/documentation/)
- [Online FIX parser](https://www.esprow.com/fixtools/parser.php)
- [FIX 4.4 dictionary](https://www.onixs.biz/fix-dictionary/4.4/msgs_by_msg_type.html)
- [Proof blog](https://medium.com/prooftrading/proof-engineering-fix-gateways-264dcda8be71)
Expand All @@ -140,7 +148,7 @@ provide the argument `clean` to remove existing environment and rebuild all.
scripts/setup_all.sh [clean]
```

Note that `setup_all.sh` also builds a custom QuickFix version for `arm64` architecture.
Note that `setup_all.sh` also builds a custom QuickFIX version for `arm64` architecture.

Alternatively, a new Python environment can be created and the `requirements.txt` can
be installed directly as follows
Expand All @@ -149,45 +157,45 @@ be installed directly as follows
pip3 install -r requirements.txt
```

Note that `requirements.txt` does not install QuickFix for macOS with arm64 architecture
as the current QuickFix version 1.15.1 has some issues and requires a patch.
Note that `requirements.txt` does not install QuickFIX for macOS with arm64 architecture
as the current QuickFIX version 1.15.1 has some issues and requires a patch.


## QuickFIX

This project depends on [QuickFIX](http://www.quickfixengine.org/). Check their [license agreement](http://www.quickfixengine.org/LICENSE) for licensing information.
This project depends on [QuickFIX](http://www.QuickFIXengine.org/). Check their [license agreement](http://www.QuickFIXengine.org/LICENSE) for licensing information.

### Custom Build QuickFix for arm64 on macOS
### Custom Build QuickFIX for arm64 on macOS

Building QuickFix for Apple arm64 requires a patch. The following script
automates the patch and builds QuickFix for `arm64` from source:
Building QuickFIX for Apple arm64 requires a patch. The following script
automates the patch and builds QuickFIX for `arm64` from source:

```
scripts/build_quickfix_arm64.sh
scripts/build_QuickFIX_arm64.sh
```

If you use `setup_all.sh` you don't have to execute this build step as it is handled by `setup_all.sh` as well.


### Installing QuickFix on Windows
### Installing QuickFIX on Windows

The Python QuickFIX bindings also fail to install on Windows. Fortunately, for Windows there are
[prebuilt wheel packages](https://www.lfd.uci.edu/~gohlke/pythonlibs/#quickfix).
[prebuilt wheel packages](https://www.lfd.uci.edu/~gohlke/pythonlibs/#QuickFIX).

To set up the Python environment using Conda follow these steps:

- Install Conda or Miniconda
- Create a new environment with `conda create --name phx python=3.11`
- Activate the environment
- Install all dependencies first `pip install -r requirements.txt`
- Download the QuickFix wheel `quickfix‑1.15.1‑cp39‑cp39‑win_amd64.whl`
- Install the wheel `pip install quickfix‑1.15.1‑cp39‑cp39‑win_amd64.whl`
- List packages and check if `quickfix 1.15.1` shows up `conda list`
- Download the QuickFIX wheel `QuickFIX‑1.15.1‑cp39‑cp39‑win_amd64.whl`
- Install the wheel `pip install QuickFIX‑1.15.1‑cp39‑cp39‑win_amd64.whl`
- List packages and check if `QuickFIX 1.15.1` shows up `conda list`

Note that during the execution of `pip install -r requirements.txt` you should first see

```
Ignoring quickfix: markers 'platform_machine != "arm64" and sys_platform != "win32"' don't match your environment
Ignoring QuickFIX: markers 'platform_machine != "arm64" and sys_platform != "win32"' don't match your environment
```


Expand All @@ -207,6 +215,22 @@ Next navigate to `Settings` -> `Project` -> `Project Structure` and configure th
source folder and the `tests` directory as test folder.


## Developer Notes

We appreciate feedback and contributions. If you have feature requests, questions,
or want to contribute code or config files, don't hesitate to use the
[GitHub issue tracker](https://github.com/mtxpt/phx-fix-base/issues).


## License

The __Phoenix Prime FIX Client Examples Package__ is released under the
[BSD 3-Clause License](LICENSE).








Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ deepdiff
prometheus_client

# Phoenix Prime FIX foundation package
phx-fix-base @ git+https://github.com/mtxpt/phx-fix-base.git@master
phx-fix-base @ git+https://github.com/mtxpt/phx-fix-base.git@main

# arch other than arm64 and Windows should be able to install quickfix without a patch
quickfix; platform_machine != 'arm64' and sys_platform != 'win32'
Expand Down

0 comments on commit 6b2d2a9

Please sign in to comment.