Re: [Quickfix-developers] sendToTarget Format
Brought to you by:
orenmnero
From: Shane T. <str...@co...> - 2008-03-13 13:10:21
|
Parjeet, Create the message for the exact type you want and use its constructor with QuickFix types. Dim message As QuickFix41.OrderCancelRequest(New OrigClOrdID("123"), New ClOrdID("321"), New Symbol("LNUX"), New Side(Side.BUY)) message.set(new Text("Cancel My Order!")); OrdType is similar, use the QuickFIX namespace: message.setField(new OrdType(OrdType.LIMIT)); -- Shane Trotter Connamara Systems, LLC On 3/13/08, Parjeet Singh <par...@oa...> wrote: > QuickFIX Documentation: http://www.quickfixengine.org/quickfix/doc/html/index.html > QuickFIX Support: http://www.quickfixengine.org/services.html > > > This is a simple question but I need bit of clarifications: I am not > sure few scenarios. > > I have coded to SendMessage in this way: > > > Private Function SendMessageRequest(ByVal intQuoteReqID As Integer) As > Boolean > > strQuoteReqID = CStr(intQuoteReqID) > > > message.setField(New StringField(40, "C")) > > message.setField(New StringField(167, "FOR")) > message.setField(New StringField(131, strQuoteReqID)) > message.setField(New StringField(146, "1")) > message.setField(New StringField(55, "AUD/USD")) > > Try > Session.sendToTarget(message, "OAKVALE-PRICES-TEST", > "BARX-PRICES-TEST") > > Catch e As SessionNotFound > MsgBox(e.Message) > End Try > > > At the moment I am hard coding that is the Tag and Description. > message.setField (New StringField (40,"C")) > > - Is there any way I can avoid hard coding and use data dictionary for > ordType Tag and description etc. > > > - At the moment I am calling above code from onLogon..........is this > correct place to call above function or I have to use toApp call back > > Public Sub onLogon(ByVal Param As QuickFix.SessionID) Implements > QuickFix.Application.onLogon > System.Console.WriteLine("Logon: " & Param.GetType.FullName) > > Dim s As Session = Session.lookupSession(Param) > > > If (s.isLoggedOn = True) Then > If (s.receivedLogon = True) Then > intQuoteReqID = intQuoteReqID + 1 > SendMessageRequest(intQuoteReqID) > End If > End If > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Microsoft > Defy all challenges. Microsoft(R) Visual Studio 2008. > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > _______________________________________________ > Quickfix-developers mailing list > Qui...@li... > https://lists.sourceforge.net/lists/listinfo/quickfix-developers > |