fvmt / quickfix-python-sample Goto Github PK
View Code? Open in Web Editor NEWSample python quickfix venue and trader applications.
License: GNU General Public License v3.0
Sample python quickfix venue and trader applications.
License: GNU General Public License v3.0
This line segfaults:
trade.setField(fix.TransactTime(int(datetime.utcnow().strftime("%s"))))
I have corrected it by just using this:
trade.setField(fix.TransactTime())
I am attempting to implement the client.py script as part of a Python3 build. I am getting a repeated error which seems to crash python on occasion. I have tried running this inside/outside of pipenv for containment. I am using FIX Spec 4.2.
It seems the issue is with the following line from the put_order()
method.
fix.Session.sendToTarget(trade, self.sessionID)
The error is as follows...
raise AttributeError("'%s' object has no attribute '%s'" % (class_type.__name__, name))
AttributeError: 'Application' object has no attribute 'sessionID'
Segmentation fault: 11
Any thoughts on this? Thanks in advance.
I want to send a message encoded in EUC-KR.
So, I tried sending a message using an example/ sample below, but I ended up getting an error.
https://github.com/fvmt/quickfix-python-sample
def put_order(self):print("Creating the following order: ")
trade = fix.Message()
trade.getHeader().setField(fix.BeginString(fix.BeginString_FIX42)) #
trade.getHeader().setField(fix.MsgType(fix.MsgType_NewOrderSingle)) #39=D
trade.setField(fix.ClOrdID(self.genExecID())) #11=Unique order
test_msg = '한글테스트'
trade.getHeader().setField(fix.MessageEncoding('EUC-KR')) # MessageEncoding
trade.setField(fix.EncodedTextLen(len(test_msg.encode('euc-kr'))))
trade.setField(fix.EncodedText(test_msg.encode('euc-kr')))
trade.setField(fix.HandlInst(fix.HandlInst_MANUAL_ORDER_BEST_EXECUTION)) #21=3 (Manual order, best executiona)
trade.setField(fix.Symbol('SMBL')) #55=SMBL ?
trade.setField(fix.Side(fix.Side_BUY)) #43=1 Buy
trade.setField(fix.OrdType(fix.OrdType_LIMIT)) #40=2 Limit order
trade.setField(fix.OrderQty(100)) #38=100
trade.setField(fix.Price(10))
trade.setField(fix.TransactTime(int(datetime.utcnow().strftime("%s"))))
print (trade.toString() )
fix.Session.sendToTarget(trade, self.sessionID)
I got the following error message
Your Input : Successful Logon to session 'FIX.4.3:CLIENT1->EXECUTOR'.
1
Putin Order
Creating the following order:
Traceback (most recent call last):
File "client.py", line 903, in
args = parser.parse_args()
File "client.py", line 880, in main
print ("Putin Order")
File "client.py", line 142, in put_order
trade.setField(fix.EncodedTextLen(len(test_msg.encode('euc-kr'))))
File "C:\ProgramData\Anaconda3\lib\site-packages\quickfix.py", line 40319, in init
quickfix.StringField.init(self, 355, data)
File "C:\ProgramData\Anaconda3\lib\site-packages\quickfix.py", line 910, in init
this = _quickfix.new_StringField(*args)
NotImplementedError: Wrong number or type of arguments for overloaded function 'new_StringField'.
Possible C/C++ prototypes are:
FIX::StringField::StringField(int,std::string const &)
FIX::StringField::StringField(int)
How can I solve this problem?
Hi,
When I try to make a connection in the log directory I get this message:
20190814-13:18:18.915796000 : Initiated logon request
20190814-13:18:18.933123000 : Socket Error: Connection reset by peer.
20190814-13:18:18.933173000 : Disconnecting
I have no idea but I can't connect to the remote server. According to them, I do not execute requests to their server. I followed all instruction for the installation.
To install quickfix I used this command:
pip install quickfix
Do I have to make any other configurations/settings? I suspect that there is an issue with the ports or maybe the installation of quickfix is not correct. Any suggestions?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.