PDA

View Full Version : vertex back office API



abdulsattar
01-13-2011, 11:41 AM
Hello,

We have developed an Market making(MM) application .net
The requirement is all the trades done in MM i.e working,rejected and executed shown in vertex BO.
So i have the sample application what i need to know how to communicate with our MM using the API and all the trades done on the MM will be shown in vertex BO.
Please let me know if any sample or how can we achieve this using API.

Regards
Abdul

Yousef-HS
01-13-2011, 01:06 PM
Dear Abdulsattar,

Please provide more information about your request, it will be much better if you can provide us with an example (not attachment), however, i would like to ask, did you program on VertexFX backoffice API or VertexFX client API?

I would recommend you visiting VertexFX API samples that is located here (http://hybrid-solutions.com/node/558), you will find samples of our APIs that will help you a lot. However, in order to reach your point, we would like to have more explanation about your case.

Thank you

abdulsattar
01-13-2011, 02:29 PM
Hello ,

I will explain the requirement.
We need BO system to manage all the positions and trades done by our application.
we don't have any BO for our application to manage all this.
Our application is developed using .net (C#.net) using FIX 4.4 protocol.
We need to use know how to communicate vertex API to our application so that all the positions and trades done by our applications are shown in the BO.
I need to know how to send the trades done by our application to vertex using the API.
Please let me know.

Yousef-HS
01-13-2011, 03:10 PM
Dear Abdulsattar,

Great I got your point,

As you have Trasnactions at your FIX software developed using .NET:


You need VertexFX Backoffice with login info, if you do not have it register for a DEMO here http://hybrid-solutions.com/node/76 and here is the Backoffice API http://hybrid-solutions.com/vertexfxboapi.exe with a help on BO API that can be found on this link http://www.hybrid-solutions.com/VertexFXBackofficeAPI-WEB/webframe.html

As guide lines you need first to establish Connection with the BO API at the accout with privileges to create new positions and here is the Connect procedure


Object.SetLoginInfo Username , Password , ServerIP , ServerPort
Object.Login()



Use this method to login to the server and load all data, after it finishing the data loading the AllDataAreLoaded event fires, then all other events fire in its specific cases. Before calling this method you have to set the login information by using the SetLoginInfo method.




object.NewPosition(AccountID as Integer , BuySell as VertexGeneral.OperationTypeEnum,Amount as Double, Symbol as VertexGeneral.Csymbol,Price as Double)



When you call this function at the event you want which is the event of making a trade at your software, it'll reflect all transactions to the VertexFX BO..

Hope this helps, please let us know if you need any further assistance.

abdulsattar
01-14-2011, 12:31 PM
Hello Yousef,

Thank you for your reply.
I am trying the demo sample when i tried to connect it showed me error.
I have attached the screen shot.
Please let me know the problem
We are using the sample vertexfxboapi9.5.15.exe

Regards
Abdul Sattar

Yousef-HS
01-16-2011, 10:19 AM
Dear abdulsattar,

From your attached pictures i have seen that your account is already logged in, the status shows that you were connected and waiting data to be loaded from the server, but let's make sure that you have the right code in the right place, let's start with the login button (which works on your side) but not loading the data still.

All what you have to do for start receiving the API events or to be able using its methods, are to reference the {VertexFX Backoffice API} Dll, then define Object of type CVertexFXBOAPI class, after that call the following two methods:

Object.SetLoginInfo
Object.Login

The SetLoginInfo Syntax: Object.SetLoginInfo Username , Password , ServerIP , ServerPort

This method sets the login information that are used in the Login method that login to the server as a dealer.

Login Object Syntax: Object.Login()

Login Button Usage (Button name is btnLogin):



Private Sub btnLogin_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnLogin.Click
MGeneral.m_oBOAPI.Disconnect()
MGeneral.m_oBOAPI.SetLoginInfo(txtUserName.Text, txtPassword.Text, txtServerIP.Text, CInt(txtPort.Text))
lvwFloating.Items.Clear()
lvwSymbols.Items.Clear()
lvwMarketChat.Items.Clear()
lvwLimitChat.Items.Clear()
MGeneral.m_oBOAPI.Login()
End Sub



Use this method to login to the server and load all data.Once the user is logged in the platform will load data from the server; When completed, the following event will fire to ensure that all data are loaded, and you can start reading data, and perform your transactions.



Private Sub m_oBOAPI_AllDataAreLoaded() Handles m_oBOAPI.AllDataAreLoaded
m_oBOAPI.SwitchChat(True)
End Sub



Hint: It's better that you don't try to make any action while the software is in waiting mode. You will have to wait till all data are fully loaded so the API gets ready to communicate.

Please keep in mind that the codes are already in our Version 9.5.9 of VertexFX Backoffice API that you can download by visiting this link http://hybrid-solutions.com/vertexfxboapi.exe and that these codes are VB.NET examples.

Please let us know if you need any further assistance.

abdulsattar
01-17-2011, 11:13 AM
Dear Yousef Najjar

We are able to connect on the demo and able to see and data.
After this process i want to know how to open a position as soon as a trade is done in our application.
Please provide a sample as the above.

Regards
Abdul Sattar

Yousef-HS
01-17-2011, 11:57 AM
Dear Abdulsattar,

I'm glad that the previous posts helped. To open new position with specific price for specific account.

New Position Syntax:



object.NewPosition(AccountID as Integer , BuySell as VertexGeneral.OperationTypeEnum,Amount as Double,Symbol as VertexGeneral.Csymbol,Price as Double)



Object: Evaluates to CVertexFXBOAPI.
AccountID: Selected account ID.
BuySell: Buy or Sell as OperationTypeEnum.
Amount: Lots amount.
Symbol: The Symbol of the new position of type CSymbol.
Price: The price for the new position.

Once the new position is done, an event called NewPosResult will raise. Here is the syntax of NewPosResult:


Object_NewPosResult( Result As VertexFXBOAPI.NewOrderResultEnum)

Object: Evaluates to CVertexFXBOAPI.
Result: Result of new position of type NewOrderResultEnum.

NewPosResult will return the data from the server with one of the following conditions:

1. DoneResult: Appears if the condition is accepted.
2. NotEnoughMoney: Appears when the account doesn't have enough money.
3. TradingIsClosed: Appears when the market is closed or trading is closed for this account.
4. Unable_MarketConditions: Appears when unable to get a quote on this symbol due to market conditions.
5. Unable_BadConnection: Appears when unable to get a quote due to a bad connection.
6. PositionIsClosed: Appears when position is closed.
7. PositionIsPending: Appears when position is in pending mode.

When the result returns, you should do the action on your software, for example: If the result shows NotEnoughMoney then use a message box for this case or let a label shows the result.

Please keep in mind that the codes are already in our Version 9.5.9 of VertexFX Backoffice API that you can download by visiting this link http://hybrid-solutions.com/vertexfxboapi.exe and that these codes are VB.NET examples.

Please let us know if you need any further assistance.

abdulsattar
01-18-2011, 03:26 PM
Hello Yousef

is vertex backoffice API sample provided by you supported on windows 64bit editions
i tried the sample it gave me com exception error.
80040154

Please let me know it runs on 64bit edition

Regards
Abdul Sattar
IT Specialist

abdulsattar
01-19-2011, 08:51 AM
Hello Yousef,

I need little help
If in my application suppose a trade happens
example :symbol="EUR/USD", price="1.3345" ,Ordertype="Limit",Qty="10",timeinforce="day"
this is limit pending order in my application
i need to open this same order in vertex BO API
with the same details as the above example
how can we initiate the process
Please let me know with an example.

Regards
Abdul Sattar
IT Specialist

sina2
01-19-2011, 09:12 AM
Hello Abdulsatar

Did you try to compile your project using X86 CPU which makes your 32 software works in 64? if not try it from Menu-->properties--> compile tab--> chose CPU useage to X86 instead of any CPU.:D

Yousef-HS
01-19-2011, 09:39 AM
Hello Yousef,

I need little help
If in my application suppose a trade happens
example :symbol="EUR/USD", price="1.3345" ,Ordertype="Limit",Qty="10",timeinforce="day"
this is limit pending order in my application
i need to open this same order in vertex BO API
with the same details as the above example
how can we initiate the process
Please let me know with an example.

Regards
Abdul Sattar
IT Specialist

Dear Abdulsatar,

I hope that this finds you in a good health and that our posts are helping you in your project. There is an event called ChatOrderReceived in our Backoffice API that will fire when an order is received.

Syntax



Object_ChatOrderRecieved(MarketOrLimitOrder As VertexGeneral.MarketOrLimitOrderEnum, AccountID As Integer, OrderID As Integer, NewOrLiq As VertexGeneral.NewOrLiquidateEnum, BuySell As VertexGeneral.OperationTypeEnum, Lots As Double, SymbolID As Integer, Price As Double, OpenPrice As Double, HitPrice As Double, RefHitPrice As Double, OrderTime As String, FromSystem As Boolean)




Object: Evaluates to CVertexFXBOAPI.
MarketOrLimitOrder: To recognize the order (market or limit order ) of type MarketOrLimitOrderEnum.
AccountID: Account ID.
OrderID: Order ID.
NewOrLiq: To recognize the order ( New order , or Liquidate order) of type NewOrLiquedateEnum.
BuySell: Buy or Sell of type OperationTypeEnum.
Lots: Lots Amount.
SymbolID: Symbol ID.
Price: Requested price as double
OpenPrice: Open price as double, if NewOrLiq is of type LiquidateType
HitPrice: The order hit price if the MarketOrLimitOrder is of type LimitOrderType, SLOrderType or TPOrderType
RefHitPrice: Reference symbol hit Price for this order if the MarketOrLimitOrder is of type LimitOrderType, SLOrderType or TPOrderType
OrderTime: The order requested time (in server time)
FromSystem: Boolean variable telling you that the order from the system or not, this value is True in the case of account liquidation, otherwise it is False


The upper syntax is to know that you have a new order on chatting (an order waiting for accept or reject or re-quote), and you will have all of the received order info via the parameters of this event.

Below is a code which is taken from our BackOffice sample that may help you in your application.




Private Sub m_oBOAPI_ChatOrderRecieved(ByRef MarketOrLimitOrder As VertexGeneral.MarketOrLimitOrderEnum, ByRef AccountID As Integer, ByRef OrderId As Integer, ByRef NewOrLiq As VertexGeneral.NewOrLiquidateEnum, ByRef BuySell As VertexGeneral.OperationTypeEnum, ByRef Lots As Double, ByRef SymbolID As Integer, ByRef Price As Double, ByRef OpenPrice As Double, ByRef HitPrice As Double, ByRef RefHitPrice As Double, ByRef OrderTime As String, ByRef FromSystem As Boolean) Handles m_oBOAPI.ChatOrderRecieved
If MarketOrLimitOrder = VertexGeneral.MarketOrLimitOrderEnum.MarketOrderTy pe Then
Dim vListViewItem As ListViewItem

vListViewItem = m_ofrmMain.lvwMarketChat.Items.Add("O_" & OrderId & " (" & OrderTime & ")")
vListViewItem.SubItems.Add(AccountID)
If NewOrLiq = VertexGeneral.NewOrLiquidateEnum.NewType Then
vListViewItem.SubItems.Add("N")
Else
vListViewItem.SubItems.Add("L")
End If
Dim bs As String = ""
Select Case BuySell
Case VertexGeneral.OperationTypeEnum.BuyType
bs = "Buy"
Case VertexGeneral.OperationTypeEnum.SellType
bs = "Sell"
Case VertexGeneral.OperationTypeEnum.BuyStopType
bs = "Buy Stop"
Case VertexGeneral.OperationTypeEnum.SellStopType
bs = "Sell Stop"
End Select
vListViewItem.SubItems.Add(bs & " " & Lots & " " & m_oBOAPI.SymbolByID(SymbolID).Name.ToString)
vListViewItem.SubItems.Add(Price)
vListViewItem.SubItems.Add("")
vListViewItem.SubItems.Add(Price)

Else

Dim vListViewItem As ListViewItem
vListViewItem = m_ofrmMain.lvwLimitChat.Items.Add("O_" & OrderId & " (" & OrderTime & ")")
vListViewItem.SubItems.Add(AccountID)
Try
Select Case MarketOrLimitOrder
Case VertexGeneral.MarketOrLimitOrderEnum.LimitOrderTyp e
vListViewItem.SubItems.Add(m_oGenerals.BuySellDesc (BuySell, True).ToString)
Case VertexGeneral.MarketOrLimitOrderEnum.TPOrderType
vListViewItem.SubItems.Add("TP")
Case VertexGeneral.MarketOrLimitOrderEnum.SLOrderType
vListViewItem.SubItems.Add("SL")
End Select
Catch ex As Exception
Message(ex.Message)
End Try

Dim bs As String = ""
Select Case BuySell
Case VertexGeneral.OperationTypeEnum.BuyType
bs = "Buy"
Case VertexGeneral.OperationTypeEnum.SellType
bs = "Sell"
Case VertexGeneral.OperationTypeEnum.BuyStopType
bs = "Buy Stop"
Case VertexGeneral.OperationTypeEnum.SellStopType
bs = "Sell Stop"
End Select
vListViewItem.SubItems.Add(bs & " " & Lots & " " & m_oBOAPI.SymbolByID(SymbolID).Name.ToString)
vListViewItem.SubItems.Add(Price)
vListViewItem.SubItems.Add("")
vListViewItem.SubItems.Add(HitPrice)
vListViewItem.SubItems.Add(Price)
End If
End Sub


Please keep in mind that the codes are already in our Version 9.5.9 of VertexFX Backoffice API that you can download by visiting this link http://hybrid-solutions.com/vertexfxboapi.exe and that these codes are VB.NET examples.

Please let us know if you need any further assistance.



Hello Abdulsatar

Did you try to compile your project using X86 CPU which makes your 32 software works in 64? if not try it from Menu-->properties--> compile tab--> chose CPU useage to X86 instead of any CPU.:D

Dear sina2,

This is a good way for windows compatibility, as this way is used by developers to insure the highest amount of users who can benefit from the application they develop.

Yousef-HS
01-20-2011, 10:55 AM
Hello Yousef

is vertex backoffice API sample provided by you supported on windows 64bit editions
i tried the sample it gave me com exception error.
80040154

Please let me know it runs on 64bit edition

Regards
Abdul Sattar
IT Specialist


Dear Abdulsattar,

Our Sample-Compiled project is not 64-bit friendly-app, but to run your sample on your 64-bit machine please follow sina2's post which shows the way to do the compatibility fix for this case.
As sina2 mentioned in his post, doing the following steps is the way to run the sample on your 64-bit machine

1. From Project Menu choose Properties.
2. A property page will appear, choose (Compile) tab.
3. Click on (Advanced Compile Options).
4. A window will appear, at the bottom there will be a drop down combo under the label that is called (Target CPU), Choose X86 instead of Any CPU.
5. Click (Ok) and try to run your application via debugger or compile your application and run it.

I have tested this way and worked 100%. I would like to thank sina2 for his useful post.

abdulsattar
01-20-2011, 01:12 PM
Hello Sina2,

Yes very true i forgot to compile it is working thanks :)

abdulsattar
01-20-2011, 01:13 PM
Hello Yousef,

Thank for your sample code and examples.

:)

abdulsattar
01-20-2011, 01:14 PM
Hello Yousef,

Yes very true i forgot to compile in x64 bit many thanks

Yousef-HS
01-20-2011, 01:40 PM
Hello Yousef,

Thank for your sample code and examples.

:)


Hello Yousef,

Yes very true i forgot to compile in x64 bit many thanks


Dear Abdulsattar,

I am glad that we could help you on your project. Please let us know if you need any further assistance.
Best of luck.