PDA

View Full Version : Transactions history



Dataflow
05-09-2014, 01:49 PM
Dear Sir,

We are using the Backoffice API 10.2 and we were trying to get a history of tickets orders once we have connected to the application.

Can you provide us what is the method we should use if we want for example to get the ticket orders between 2 dates and greater than a certain ticketID already saved at my side.

We tried to use the requestReport but we don't get anything and sometimes we get .

Can you clarify please.

Thank you

Regards

Hassan-HS
05-09-2014, 04:08 PM
Dear Sir,

Thank you for your post :)

This following sample describe to you how to get the current opened positions using RequestReport (http://www.hybrid-solutions.com/support/index.php?/Knowledgebase/Article/View/2070)method.

for more info please click here (http://www.hybrid-solutions.com/support/index.php?/Knowledgebase/Article/View/4163)



Dim Request As String

Dim ClientID As String = Cstr(m_oBOAPI.RootID)

Dim SymbolID As String

Dim AccountType As String

Dim PositionType As String

SymbolID = "" ' all symbols

PositionType = "1" ' Buy , "-1'Sell , "" All

AccountType = "1" ' normal account , "2" for coverage account

Request = ClientID & , & AccountType & , & SymbolID & , & PositionType

MsgBox(m_oBOAPI.RequestReport(VertexFXBOAPI10.Mana gerReportsTypeEnum.DetailOpenPositionsReport ,Request))


Notes:

This event ReportDataReceived (http://www.hybrid-solutions.com/support/index.php?/Knowledgebase/Article/View/2099)fired when receive a data report from the server.

You can request reports as you need but note that you have to wait the result for the report inquiry before request another report.


To get Market Order History Report (http://www.hybrid-solutions.com/support/index.php?/Knowledgebase/Article/View/4165)




Dim Request As String
Dim ClientID As String = CStr(Dealer.BO.RootID)
Dim DateFrom As String = ""
Dim DateTo As String = ""
Dim SymbolID As String = ""
DateFrom = IIf(ChBeginning.Checked, "", MDI.Dealers.StringValues.DateToString(DateTimeFrom .Value))
DateTo = IIf(ChNow.Checked, "", MDI.Dealers.StringValues.DateToString(DateTimeTo.V alue))

Dim OrderID As String = IIf(cmOrder.Text.ToUpper = "All".ToUpper, "", cmOrder.Text)
Dim Ticket As String = IIf(cmbTkt.Text.ToUpper = "All".ToUpper, "", cmbTkt.Text)
Dim AccountID As String = IIf(cmbAccount.Text.ToUpper = "All".ToUpper, "", cmbAccount.Text)
Dim Type As String = ""
' All "CP" for liquidate "OP" for New
If cmbType.Text.ToUpper = "New".ToUpper Then
Type = "OP"
ElseIf cmbType.Text.ToUpper = "Liquidate".ToUpper Then
Type = "CP"
End If


Dim BuySell As String = "" 'All "1" for buy, "-1" for sell
Select Case cmbBS.Text.ToUpper
Case "All".ToUpper
BuySell = ""
Case "Buy".ToUpper
BuySell = "1"
Case "Sell".ToUpper
BuySell = "-1"
End Select
Dim Amount As String = IIf(cmbAmmount.Text.ToUpper = "All".ToUpper, "", cmbAmmount.Text)


Dim Price As String = IIf(cmbPrice.Text.ToUpper = "All".ToUpper, "", cmbPrice.Text)
Dim IPAddress As String = IIf(cmbIP.Text.ToUpper = "All".ToUpper, "", cmbIP.Text)
Dim Status As String = "" ' All "20" New Accepted/ "21" invalid price / "44" quoted then Timer expired / "45" quoted then client reject
Select Case cmbStatus.Text.ToUpper
Case "All".ToUpper
Status = ""
Case "Accepted".ToUpper
Status = "20"
Case "Invalid Price".ToUpper
Status = "21"
Case "Price changed - timer expired".ToUpper
Status = "44"
Case "Price changed - client reject".ToUpper
Status = "44"
End Select

Dim Who As String = IIf(cmbWho.Text.ToUpper = "All".ToUpper, "", cmbWho.Text.ToUpper)



If cmbSymbol.Text.ToUpper = "All".ToUpper Then
SymbolID = ""
Else
Dim vSymbol As VertexFXBOAPI10.COSymbol
vSymbol = Dealer.BO.SymbolByName(cmbSymbol.Text.ToUpper)
If vSymbol Is Nothing Then
Exit Sub
End If
SymbolID = vSymbol.ID

End If
Request = ClientID & "," & DateFrom & "," & DateTo & "," & OrderID & "," & Ticket & "," & AccountID & "," & Type & "," & BuySell & "," & Amount & "," & SymbolID & "," & Price & "," & IPAddress & "," & Status & "," & Who
BO.RequestReport(VertexFXBOAPI10.ManagerReportsTyp eEnum.MarketOrdersHistoryReport, Request)




For more info please click here (http://www.hybrid-solutions.com/support/index.php?/Knowledgebase/Article/View/4165)

Dataflow
05-12-2014, 07:39 AM
Thank you for your reply. :)

We have found the same function but using the transactionLog . Is there any difference between these 2 types?

While using the transactionLog in the API 10.2, when we fill From date and To Date we get data but we fill only from Date with empty to date we dont get anything.

Can you advise please.

In addition, If we want to use this function requestreport to get tickets that have IDs greater than a certain TicketID for example >740000 , is there any possibility here?

Thank you in advance

Regards

Hassan-HS
05-12-2014, 08:31 AM
Hello,

Transaction Log: This report will show you the entire transactions (New, Liquidate,Money Transaction, TP/SL orders, Limit/Stop orders) done in your whole system or for a certain account(s)/ office(s).
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).

Please check this article (http://www.hybrid-solutions.com/support/index.php?/Knowledgebase/Article/View/2443)to know the differences between the reports.

When you pass a empty dates that means you want to retrieve data from beginning till now, and that its a huge data so its take a while. so please check the waiting mode state (http://www.hybrid-solutions.com/support/index.php?/Knowledgebase/Article/View/2090) of the API if its in waiting mode or not and update me with the result.

Simply you can pass the date of the TicketID Ex:740000 as FromDate, and keep the ToDate filed empty.

Dataflow
05-13-2014, 01:07 PM
Dear Sir,

Thank you for your replies.
We would like to ask about the tickets that we are taking from vertex.

We are taking only liquidate tickets but we would like to know until when the client can update or delete his tickets.Is there any flag saying that the tickets has been executed at the custodian level?

We think once the ticket is executed the client must not have the access to do any changements.
Are we right?

Please how can we have more info about this issue.

Regards

Hassan-HS
05-13-2014, 02:25 PM
Hello,

Sure you can retrieve all pending and manage orders transactions using Transaction Log report by passing TransTyp parameter as following.....

"4" to retrieve TP/SL Order
"5" to retrieve Limit/Stop Order

Hassan-HS
05-13-2014, 02:29 PM
Hello,


Would be great if you give me an example

Dataflow
05-14-2014, 05:03 AM
What I mean is when the account holder can edit a ticket or delete a ticket.he can always do that or there is flag that the ticket is executed and can not be modified anymore.

For example when a client buy 0.1 EUR/USD at a price. he can change his mind and delete it but if this ticket is executed and already is entered in the account's statement can he do this delete?

Hassan-HS
05-14-2014, 07:35 AM
Hello,



What I mean is when the account holder can edit a ticket or delete a ticket.he can always do that or there is flag that the ticket is executed and can not be modified anymore.



Let's make it clear.... the difference between orders & positions:

1-Positions: The orders that price already hit (executed).

The client cannot change the price or the amount, but he can close or manage it ( put Stop-Loss or Take-Profit).


2-Orders: The pending orders (that price is not hit yet) .

The client can change the price and the amount, and he can cancel it.

I- Limit Type: (Buy Limit, Sell Limit, Buy Stop, Sell Stop)

II- SLTP Type: it's a manage order for a open position (Buy manage, Sell manage)

check the attached picture (1 is position, to is order.)


337

Dataflow
05-14-2014, 08:52 AM
Sorry but the image is not opening.

Hassan-HS
05-14-2014, 09:56 AM
Dear,


check it now...

Dataflow
05-14-2014, 10:35 AM
Sorry i didnt get it.

Hassan-HS
05-14-2014, 11:03 AM
Please check this

338

Dataflow
05-14-2014, 12:38 PM
Thank you , i just saw the picture .

We are taking in our application the orders that have transtype=2 ==>Liquidate .

what we should add to filter for Positions: The orders that price already hit (executed).

We only want the orders that are executed.

Thank you once again

Regards

Hassan-HS
05-14-2014, 01:13 PM
Hello,


You have to send the following parameters with this values to retrieve the executed limit orders.



Trans as "3" which means delete.
TransType as "5" which means "Limit/Stop Orders"
Method as "Done"

You have to send the following parameters with this values to retrieve the executed manage orders.


Trans as "3" which means delete.
TransType as 4 which means "TP/SL Orders"
Method as "Done"

Hassan-HS
05-21-2014, 04:10 PM
Dear Sir,


I suggest a better way to monitor the transaction at the real time, you can use TransactionLog (http://www.hybrid-solutions.com/support/index.php?/Knowledgebase/Article/View/2109)event which is raised on each transaction that done in your system.




Event TransactionLog(ByRef Account As VertexFXBOAPI10.COAccount, ByRef TicketOrder As Integer, ByRef Trans As Short, _
ByRef TransType As Short, ByRef TransSubType As Short, ByRef IP As String, ByRef Amount As Double, _
ByRef WhoType As Short, ByRef WhoID As Integer, ByRef Method As String, ByRef Commission As Double, _
ByRef Interest As Double, ByRef Price As Double, ByRef ClosePrice As Double, ByRef SymbolID As Integer, _
ByRef BuySell As VertexGeneral10.OperationTypeEnum, ByRef TicketOrder2 As Integer, ByRef TransTime As String, _
ByRef TransID As Integer, ByRef RefSymbolPrice As Double, ByRef ProfitLoss As Double)



This scenario is for the executed limit orders.


If the Trans equal 3 that means the transaction is delete
And if the TransType equal 5 that means "Limit/Stop Orders"
And the Method is "Done"

Thats means the (Limit/Stop) order #(TicketOrder2) is executed and the position is #(TicketOrder2)
This scenario is for the executed manage orders.


Trans equal 3 which means delete.
TransType equal 4 which means "TP/SL Orders"
Method equal "Done"

Thats means the (TP/SL) order #(TicketOrder2) is executed and the position is #(TicketOrder2)

Dataflow
06-04-2014, 12:07 PM
Dear sir,
we are using the _transactionlog event to get the transactions that occur on the spot.
However we didn't understand how we get a transaction time (transtime) of year 2004 of a transaction that is taking place now.

Thank you in advance.

Regards.

Hassan-HS
06-04-2014, 02:24 PM
Hello,

When the order is taking place the transaction-log (http://www.hybrid-solutions.com/support/index.php?/Knowledgebase/Article/View/2109)is raised, in this case the TicketOrder2 parameter hold the ID of the order that placed in 2004, so you can generate a Transaction-log report using this query to get the all info about this order including the time of the order:


StartFromClientID = API.RootID
FromDate=""
ToDate=""
TicketOrder= the order ID (TicketOrder2 )
Trans ="1"
transType ="5"
Account =""
BuySell =""
LotsAmount =""
SymbolID =""
Price= ""
ClosePrice =""
WhoType =""
WhoID =""
IP=""
Method=""



vParams = StartFromClientID & "," & FromDate & "," & ToDate & "," & TicketOrder & "," & Trans & "," & transType & "," & Account & "," & BuySell & "," & LotsAmount & "," & SymbolID & "," & Price & "," & ClosePrice & "," & WhoType & "," & WhoID & "," & IP & "," & Method
API.RequestReport(VertexFXBOAPI10.ManagerReportsTy peEnum.TransactionsLogReport, vParams)




The result will be received using this event (http://www.hybrid-solutions.com/support/index.php?/Knowledgebase/Article/View/2099).

Dataflow
06-05-2014, 06:31 AM
Hello,
we used TransactionLog event and we got the following transaction:

2004-06-14 09:43:00.000 1411755 1 2 411157 -1 0.10000 168 16690.00000 0

When we called the RequestReport and gave as parameters two transtime From: 04-06-2014 and To: 05-06-2014 we received the following transaction when the ReportDataReceived event fired:

2014-06-04 00:00:00.000 1411755
1 2 411157 -1 0.10000 168 16690.00000 0

both transactions have the same TicketOrder 1411755 colored above in yellow
but they have different transTime colored above in red

notice that they both have action 1 colored in green which is "New"

Please can you clarify what is the difference between these two transactions.
What is the position of the account? Is he holding 0.2(0.1 from each transaction)?

If these transactions are the same, why each event is giving us different dates?

Hassan-HS
06-05-2014, 06:59 AM
Hello,

The transactions are the same, but the TransTime is different because the transaction report returns the TransTime as server time, and you can convert it to dealer time as following.



Public StringValues As New VertexGeneral10.CStringValues
TransTimeAsDealerTime = StringValues.FormatGMTDate(TransTime, API.GMTOffset, API.ServerGMTOffset, VertexGeneral10.GMTConvertTypeEnum.ServerToClient, "-", , VertexGeneral10.DateFormatsEnum.YYYYspMMspDD_HHspN NspSS)



Was this answer helpful? your feedback about this answer is important, let me know what you think.

Dataflow
06-10-2014, 05:21 AM
We tried it and it worked.
We had the date 14/06/2004 and now we have the date 04/06/2014.
Is this what we should have got?

Thank you in advance.

Hassan-HS
06-10-2014, 06:34 AM
Hello,

According to your previous post this is what you will get,and this case happens due to wrong date conversion (string to date), now till me is the API met all your requirements?

Dataflow
06-13-2014, 09:24 AM
Hello,
how can we get from the transactionlog event or the RequestReport event the ID of the custodian(Depository) where each order is made? For example, Alpari, Penson etc.

We'll be waiting your reply as soon as possible.
Thank you in advance.

Hassan-HS
06-13-2014, 12:52 PM
Hello,


I'm sorry, I'm not sure about "the ID of the custodian(Depository)" could you tell me what it means?

Hassan-HS
06-15-2014, 12:15 PM
Hello,
I'm still waiting your reply, however if you mean how to monitor the covered orders with the LPs please read the following:

You can monitor the covered orders using the coverage account for each LP, which is mirror all orders covered with LP in your VertexFX Back Office.

ex:

when the bridge cover a order with LP X, it will reflect it on the coverage account which is 10000.

BO Coverage Account ///////// LP Name

10000//////////////////////////////// X


So when the event fire and the account ID equal 10000, that means this order already opened with LP X.


Note:

If you do not mind, please tell me the idea of ​​your project, so i can guide you to the best way to perform it.

Dataflow
06-16-2014, 06:37 AM
Dear Sir,

We are doing a project like a bridge between the 2 systems.

We are doing a project that take from your API all the tickets that are liquidate for all clients that we have for the
username in order to put them in tables.

we are trying to do a bridging reconciliation
We reconcile Dataflow ClientID with VertexFX ClientID and Dataflow Symbols with VertexFX Symbols

and here we need A custodian Id to reconcile it with our system.

till now everything went good but we need to know the tickets'' depository or custodian because this detail
is mandatory at my side.

I mean by Custodian where the client(account) has purchased his item ex 0.1 EUR/USd at Alpari or penson or ....

Is this info available at your side.

Hassan-HS
06-17-2014, 06:35 AM
Hello,


Do you want to map VertexFX orders with Dataflow orders, so you need to key for each order or something else? is the custodian something like liquidity provider?

Dataflow
06-17-2014, 09:18 AM
yeah maybe it is something like that.
like the bank where the order will be liquidate.

yeah we are mapping the orders from vertex and insert them in our dataflow orders tables.

So can you advise us about the liquidity provider? what can be?

Hassan-HS
06-17-2014, 09:59 AM
Hello,


You can mapping our orders/position using it's ID, anyway please provide with a full cycle of your project.

Dataflow
06-26-2014, 11:01 AM
Dear sirs,
we have a time mismatch problem for the same TicketOrder.
The company that we are working for has an application designed by you. The transactionLog event when fired in this application gives a time of 7:36 for the TicketOrder 1425993.
However in your API 10.2.0 it gives a time of 3:36 for the same TicketOrder.
We figured out that the time shown in the company application is in GMT. Is this correct?
What about your API?
Is there any conversion method so we can have it in GMT time or in our local time?
Please advise us how to solve this issue.

Regards.

Hassan-HS
06-26-2014, 11:36 PM
The transactions are the same, but the TransTime is different because the transaction report returns the TransTime as server time, and you can convert it to dealer time as following.

Code:


Public StringValues As New VertexGeneral10.CStringValues
TransTimeAsDealerTime = StringValues.FormatGMTDate(TransTime, API.GMTOffset, API.ServerGMTOffset, VertexGeneral10.GMTConvertTypeEnum.ServerToClient, "-", , VertexGeneral10.DateFormatsEnum.YYYYspMMspDD_HHspN NspSS)

Dataflow
06-27-2014, 11:50 AM
Dear sir,
if I have a date of 27/06/2014 2:44 PM beirut-lebanon time how can i transform it to the server time.
I tried the following
VertexGeneral10.CStringValues stringValues = new CStringValues();
string serverFromDate = stringValues.FormatGMTDate((string.Format("{0:" + GlobalModule.FormatDispDate + " HH:mm:ss}".ToString(), dtFrom.Value)), m_oBOAPI.GMTOffset, m_oBOAPI.ServerGMTOffset, VertexGeneral10.GMTConvertTypeEnum.ClientToServer, "-", ":", VertexGeneral10.DateFormatsEnum.YYYYspMMspDD_HHspN NspSS);

Notice that dtFrom.Value = 27/06/2014 2:44 PM.

It didn't work.

Any advice.
Thank you in advance.

Hassan-HS
06-28-2014, 08:19 PM
Hello,


I will update you soon please standby.

Hassan-HS
06-29-2014, 07:56 AM
Hello,


You have to pass the time as 24 hours format....




Dim BeirutGMT As integer=3
Dim serverFromDate As String
serverFromDate = stringValues.FormatGMTDate("27/06/2014 14:44", BeirutGMT , m_oBOAPI.ServerGMTOffset, VertexGeneral10.GMTConvertTypeEnum.ClientToServer, "/", ":", VertexGeneral10.DateFormatsEnum.DDspMMspYYYY_HHspN N)

Dataflow
06-30-2014, 07:45 AM
Dear sir,
the first time i called the function above the ServerGMTOffset parameter was 0.0 .
The second time it became -4.0.
Therefore when I try to convert, the first time I have a date and the second i have another date for the same vDate parameter.
Can you explain this issue to us?

Thank you in advance.
Regards.

Hassan-HS
06-30-2014, 07:56 AM
Hello,

Please call ServerGMTOffset after AllDataAreLoaded event is raised.

Dataflow
07-07-2014, 01:21 PM
Dear Sir,
we have downloaded and installed the vertext backoffice api 10.2.0 on a new computer and we tried to connect.
The connection couldn't be established. Instead of having "connected" as status we are always having "connecting..." although it is working on another PC.
Any advice regarding this issue?

Thank you in advance.

Hassan-HS
07-07-2014, 03:16 PM
Dear Sir,

In some cases Windows vista/Windows 7 prevent some executable codes from running/executing probably. This happens because of Data Execution Prevention (DEP) this happens in some cases.

To disable the DEP please read this article (http://www.hybrid-solutions.com/support/index.php?/Knowledgebase/Article/View/3540/0/experienced-windows-7-connectivity-issues)

Dataflow
07-09-2014, 09:49 AM
Dear Sir,
the whoID that we get in the API has the form of Clt-2.
However in the application that our client has this field has the form of Clt-description where description is supposed to be the username of the dealer.
How can we obtain the whoID from the API with the same format of that obtained in our client's application?
Please can you advise us regarding this matter?

Thank you in advance.

Hassan-HS
07-09-2014, 11:12 AM
Hello,

You are welcome :D

You can use this code....


If WhoType = "1" Then
If Not BO.DealerUsername(WhoID) Is Nothing Then
TLWhoType = "DLR" & "-" & " ( " & CStr(BO.DealerUsername(WhoID)) & " ) "
Else
TLWhoType = "System"
End If
Else
If Not BO.ClientByID(WhoID) Is Nothing Then
TLWhoType = "Clt" & "-" & " ( " & CStr(BO.ClientByID(WhoID).FullName) & " ) "
Else
TLWhoType = "System"
End If

End If

Hassan-HS
07-09-2014, 11:12 AM
Hello,

You are welcome :D

You can use this code....


If WhoType = "1" Then
If Not BO.DealerUsername(WhoID) Is Nothing Then
TLWhoType = "DLR" & "-" & " ( " & CStr(BO.DealerUsername(WhoID)) & " ) "
Else
TLWhoType = "System"
End If
Else
If Not BO.ClientByID(WhoID) Is Nothing Then
TLWhoType = "Clt" & "-" & " ( " & CStr(BO.ClientByID(WhoID).FullName) & " ) "
Else
TLWhoType = "System"
End If

End If

Dataflow
07-10-2014, 02:11 PM
Dear sir,
I'm afraid my previous request wasn't clear enough.
In our client's application when we have the transaction log we get under the who column dlr-bbcorpAbed ,dlr-dealerYoussef or clt-***(***) etc.. and when we order the markeOrder Report we get under the who column bbcorpAbed or dealerYoussef etc..
Can you advise us how can we get the same thing in using the API?

Thank you in advance for your help.
Regards.

Hassan-HS
07-10-2014, 04:24 PM
Hello,

We are not sure that we understood the question.

But if you mean that you call the MarketOrderHistory report and you want to convert the "Data(row, 11)" which represent who column to be like the client terminal and back-office applications value, yes certainly you can using the code in the previous post.

otherwise please send me your team-viewer ID so you can explain what do you want easily. :)

Dataflow
07-11-2014, 05:28 AM
Dear sir,
we prefer, if possible, to take your email so we can send you print screen images that can clarify what we need.

Thank you in advance.
Regards.

Hassan-HS
07-11-2014, 08:11 AM
Hello,


You can post it here, i'm waiting your reply.

Hassan-HS
07-13-2014, 10:14 AM
Hello,

I've seen the images that's sent by you over the ticket #88484. I think that the issue is with the request that sent to the server by your application, so I've created a vb.net 2010 sample that requests the both reports and handle the result that's fetched from the sever.

All you have to do is re-reference the BO API dll with the sample and check how to send/handle the reports.