PDA

View Full Version : RequestReport and active symbols for an account



Justina
02-12-2014, 10:31 AM
Hello,

I have run into trouble while trying to get various reports using the RequestReport method. There is an event ReportDataReceived, however, it does not fire. Function returns an enum value (which is success) and so I am quite lost at how I can reach the report I, supposedly, have received.

Could you please explain and illustrate with examples how to use this method (especially the parameter "params") and receive the data for further processing?



Additionally, could you give me an example of how to get active symbols for an account/client? I have seen the example where you can get all the symbols (all 130+), however, this is not what I need and I can't find a way around this.

Any help will be appreciated.

P.s. I am using C#, not VB.

Hassan-HS
02-12-2014, 11:09 AM
Hello :D ,



I have run into trouble while trying to get various reports using the RequestReport method. There is an event ReportDataReceived, however, it does not fire. Function returns an enum value (which is success) and so I am quite lost at how I can reach the report I, supposedly, have received.



When the function returned success that means your request has been sent to the server.

The main reason for not raising ReportDataReceived (http://www.hybrid-solutions.com/support/index.php?/Knowledgebase/Article/View/2099) event is sending an invalid parameters to the server, so your request will be rejected.





Additionally, could you give me an example of how to get active symbols for an account/client? I have seen the example where you can get all the symbols (all 130+), however, this is not what I need and I can't find a way around this.

Any help will be appreciated.

I think that you have to use the client API to fetch all visible symbols for a selected account ( using SymbolByIndex (http://www.hybrid-solutions.com/support/index.php?/Knowledgebase/Article/View/2036)) .

Justina
02-12-2014, 12:14 PM
Please give me an example of how the parameters should look so that they wouldn't be rejected.

Hassan-HS
02-12-2014, 12:26 PM
Hello,


tell me whats the type of the report that you want: (Reports Types (http://www.hybrid-solutions.com/support/index.php?/Knowledgebase/Article/View/2893))

Justina
02-12-2014, 12:39 PM
Let's say PendingOrdersReport and MarketOrdersHistoryReport

Hassan-HS
02-12-2014, 01:12 PM
Dear,



i will update you soon please stand by

Hassan-HS
02-12-2014, 03:56 PM
Hello,


1-MarketOrdersHistoryReport




Private Sub btnReport_Click(sender As System.Object, e As System.EventArgs) Handles Report.Click, btnReport.Click

Dim RootId As String = CStr(m_oBOAPI.RootID)
Dim FromDate As String = "01/01/2014 00:00:00"
Dim ToDate As String = "" ' Now
Dim OrderID As String = "" 'All
Dim Ticket As String = "" ' All
Dim AccountID As String = "" ' All
Dim Type As String = "" ' All "CP" for liquidate "OP" for New
Dim OrderType As String = "" 'All "1" for buy, "-1" for sell
Dim Amount As String = "" ' All
Dim SymbolID As String = "" 'All
Dim Price As String = "" 'All
Dim IPAddress As String = "" 'All IPs
Dim Status As String = "" ' All "20" New Accepted/ "21" invalid price / "44" reqauted then Timer expired / "45" reqauted then client reject
Dim Who As String = "" ' All The Dealers

Dim Request As String
Request = RootId & "," & FromDate & "," & ToDate & "," & OrderID & "," & Ticket & "," & AccountID & "," & Type & "," & OrderType & "," & Amount & "," & SymbolID & "," & Price & "," & IPAddress & "," & Status & "," & Who

MsgBox(m_oBOAPI.RequestReport(VertexFXBOAPI10.Mana gerReportsTypeEnum.MarketOrdersHistoryReport, Request))
End Sub





2-PendingOrdersReport



Private Sub btnReport_Click(sender As System.Object, e As System.EventArgs) Handles Report.Click, btnReport.Click
Dim RootId As String = CStr(m_oBOAPI.RootID)
Dim FromDate As String = "01/01/2014 00:00:00"
Dim ToDate As String = "" ' Now
Dim AccountID As String = "" ' All
Dim OrderType As String = "" 'All
Dim lots As String = "" ' All
Dim SymbolID As String = "" 'All
Dim Price As String = "" 'All

Dim Request As String
Request = RootId & "," & FromDate & "," & ToDate & "," & AccountID & "," & OrderType & "," & lots & "," & SymbolID & "," & Price

MsgBox(m_oBOAPI.RequestReport(VertexFXBOAPI10.Mana gerReportsTypeEnum.PendingOrdersReport, Request))
End Sub

Justina
02-20-2014, 10:00 AM
Hello,

Thank you for your answers, Hassan.
We've dealt with previous problems, but now I have another question.

What exactly is Market Orders History report and when does it return data? Because right now it returns an empty array both in API and BO.

Hassan-HS
02-20-2014, 12:37 PM
Hello,
Market Orders History Report

This report will show you the entire market orders done in your whole system or for a certain account(s)/ office(s).



Private Sub Report_Click(sender As System.Object, e As System.EventArgs) Handles Report.Click, btnReport.Click
Dim ClientID As String = Cstr(m_oBOAPI.RootID)
Dim FromDate As String = "01/01/2014 00:00:00"
Dim ToDate As String = "" ' Now
Dim OrderID As String = "" 'All
Dim Ticket As String = "" ' All
Dim AccountID As String = "" ' All
Dim Type As String = "" ' All "CP" for liquidate "OP" for New
Dim OrderType As String = "" 'All "1" for buy, "-1" for sell
Dim Amount As String = "" ' All
Dim SymbolID As String = "" 'All
Dim Price As String = "" 'All
Dim IPAddress As String = "" 'All IPs
Dim Status As String = "" ' All "20" New Accepted/ "21" invalid price / "44" quoted then Timer expired / "45" quoted then client reject
Dim Who As String = "" ' All The Dealers
Dim Request As String
Request = ClientID & , & FromDate & , & ToDate & , & OrderID & , & Ticket & , & AccountID & , & Type & , & OrderType & , & Amount & , & SymbolID & , & Price & , & IPAddress & , & Status & , & Who
MsgBox(m_oBOAPI.RequestReport(VertexFXBOAPI10.Mana gerReportsTypeEnum.MarketOrdersHistoryReport, Request))
End Sub






What exactly is Market Orders History report and when does it return data? Because right now it returns an empty array both in API and BO.



For more details about the parameters and returned data please check the attached file.

Justina
02-20-2014, 02:41 PM
Very well. May I request similar documents for all of the report types? It would save a lot of time for both you and me.

Hassan-HS
02-20-2014, 03:13 PM
Dear,

Please check the attached pdf