Пример #1
0
    def getSecuritiesList(self):
        msg = fix50.SecurityListRequest()
        header = msg.getHeader()
        header.setField(fix.SenderCompID(self.usrID))
        header.setField(fix.TargetCompID(self.targetCompID))
        msg.setField(fix.SecurityReqID('ListRequest1'))
        msg.setField(fix.SecurityListRequestType(4))

        fix.Session.sendToTarget(msg)
Пример #2
0
    def compose_security_list_request(self, security_request_id):

        security_list_request = quickfix44.SecurityListRequest()

        security_list_request.setField(
            quickfix.SecurityReqID(security_request_id))
        security_list_request.setField(
            quickfix.SecurityListRequestType(
                quickfix.SecurityListRequestType_ALL_SECURITIES))

        return security_list_request
Пример #3
0
 def derivativeSecurityListRequest(self):
     msg = fix.Message()
     header = msg.getHeader()
     header.setField(fix.BeginString(fix.BeginString_FIXT11))
     header.setField(fix.MsgType("z"))
     header.setField(fix.SenderCompID("pjseoane232"))
     header.setField(fix.TargetCompID("ROFX"))
     msg.setField(fix.SecurityReqID(self.ListaContratos))
     msg.setField(fix.SecurityListRequestType(4))
     #msg.setField(fix.MarketID("ROFX"))
     #msg.setField(fix.MarketSegmentID("DDF"))
     fix.Session.sendToTarget(msg)
Пример #4
0
    def securityListRequest(self):
        #pag 73

        msg = self.buildMsgHeader('x')

        msg.setField(fix.SecurityReqID('ListRequestA'))
        msg.setField(fix.SecurityListRequestType(4))
        msg.setField(fix.MarketID('ROFX'))
        msg.setField(fix.MarketSegmentID('DDF'))
        #msg.setField(fix.Currency('ARS'))
        #msg.setField(fix.TradingSessionID("0"))

        #msg.setField(fix.Symbol('RFX20Jun20'))
        #msg.setField(fix.SecurityExchange('ROFX'))
        msg.setField(fix.CFICode("FXXXSX"))

        fix.Session.sendToTarget(msg)
        return
Пример #5
0
    def securityListRequest(self):
        #pag 73

        msg = fix50.SecurityListRequest()

        msg.setField(fix.SecurityReqID("listaXX"))
        msg.setField(fix.SecurityListRequestType(0))

        #group = fix50.SecurityListRequest()
        #group.setField(fix.NoRelatedSym(1))

        msg.setField(fix.Symbol('DOSep19'))
        msg.setField(fix.SecurityExchange('ROFX'))
        # msg.addGroup(group)

        # msg.setField(fix.MarketSegmentID("DDF"))   #1300
        # msg.setField(fix.MarketID('ROFX'))  #1301

        # msg.setField(fix.Symbol("RFX20Sep19"))
        # msg.setField(fix.SecurityExchange('ROFX'))
        # msg.setField(fix.CFICode("FXXXSX"))

        fix.Session.sendToTarget(msg, self.sessionID)
Пример #6
0
    easyfix.enable_logging()

    app = easyfix.InitiatorApp.create('example.cfg')
    app.start()

    while not app.logged_on:
        time.sleep(0.1)

    print("Logged in!")

    # Send message using normal Quickfix messages
    m = fix44.SecurityListRequest()
    m.setField(fix.SecurityReqID(str(uuid.uuid4())))
    m.setField(
        fix.SecurityListRequestType(
            fix.SecurityListRequestType_ALL_SECURITIES))
    fix.Session.sendToTarget(m, app.session_id)

    # Send an order
    m = fix44.NewOrderSingle()
    m.setField(fix.ClOrdID(str(uuid.uuid4())))
    m.setField(fix.SecurityID('25'))
    m.setField(
        fix.SecurityIDSource(
            fix.SecurityIDSource_MARKETPLACE_ASSIGNED_IDENTIFIER))
    m.setField(fix.Side(fix.Side_BUY))
    m.setField(fix.OrderQty(0.01))
    m.setField(fix.Price(123))
    m.setField(fix.OrdType(fix.OrdType_LIMIT))

    # Python QuickFIX UtcTimeStampField doesn't accept a `datetime` object, we