PDA

View Full Version : client's data updation using VFX Backoffice API



Dilip
11-26-2015, 12:07 PM
Hello everybody...

there is no api/method like 'update client' or 'change client password' on 'BACKOFFICE API' page..... so if I want to change client's leverage using backoffice API, then how can I achieve that......


Regards
Dilip

Hassan-HS
11-29-2015, 08:30 AM
Hello Dilip :)


there is no api/method like 'update client' or 'change client password' on 'BACKOFFICE API'

You can't update clients,offices or groups in the current version of API. but I will check the possibility of developing this feature in the next patchs. I will update you soon please standby.


if I want to change client's leverage using backoffice API, then how can I achieve that......
The leverage is the percentage of initial margin referenced to the contract size.


So if you want to set the leverage 1:400 do the following:


1- Get the Contract Size for the desired symbol using GetSymbolByName (http://www.hybrid-solutions.com/support/index.php?/Knowledgebase/Article/View/2130)


'Make sure that you are connected and AllDataAreLoaded event is raised
If BOAPI.SymbolByName("GOLD") isnot nothing then
Msgbox (BOAPI.SymbolByName("GOLD").ContractSize)
End if

Suppose the Contract size for gold is equal 100000.
Update the Initial Margin for the desired client using ChangeParam (http://www.hybrid-solutions.com/support/index.php?/Knowledgebase/Article/View/4003)method.
Suppose you set the Initial Margin = 250
100000/250 = 400 so the leverage will be 1:400

Rawan-HS
11-29-2015, 08:57 AM
Dear Dilip

I have sent your request to our development department to check the possibility of adding this feature to our Backoffice API according to ticket #127826

Dilip
11-30-2015, 05:21 AM
Hello Hassan-HS,

According to your answer, by setting Initial Margin will change 'leverage' for specific symbol only (or only for one symbol), but that can cause changing leverage for all other 'symbols'..... isn't there a way to set common leverage......

Regards,
Dilip

Hassan-HS
12-01-2015, 08:25 AM
Hello,


Yes you have to loop over all symbols one by one and update it's initial margin parameter for special client/group/office you want. or you can speed up the process by sending the symbols ID's separated by comma "," if the new initial margin value is the same for the selected symbols

Dilip
12-01-2015, 08:38 AM
Hello Hassan-HS,
I think 'initial margin' is unique single quantity of client and same for every symbol, isn't it.... then in this case, we can only set leverage for specific symbols only having same contract-size.......

Hassan-HS
12-01-2015, 10:57 AM
Hi :)






I think 'initial margin' is unique single quantity of client and same for every symbol, isn't it.... then in this case, we can only set leverage for specific symbols only having same contract-size.......

No not for every symbol, you can set the initial margin for gold to be 250 and for the same client for silver to be 500.


The Initial margin parameter indicates the amount that the client should have in his Effective Margin to be able to buy 1 lot from this specific currency
Suppose the ID for GOLD is 6 and for EUR/USD 62 and for SILVER 72


'changing the initial margin for GOLD & EUR/USD
m_oBOAPI.ChangeParam("Hassan", VertexGeneral10.ParamTypeEnum.InitialMarginReqType , False, 250, "6,62")




'changing the initial margin for Silver
m_oBOAPI.ChangeParam("Hassan", VertexGeneral10.ParamTypeEnum.InitialMarginReqType , False, 500, "72")

Dilip
12-11-2015, 06:50 AM
Hello Hassan-HS,

how can we get or request quotes for specific symbol....
ClientSymbol API required symbol-code and client account...

it is obvious that we may not know code for every symbol.... so is it possible to query quotes with symbol name....
BO-API sample is not able to load symbols list after login as in plusfxbackoffice.......

thanks in advance.....

dilip

Hassan-HS
12-11-2015, 08:38 AM
Hello Sir :)

SymbolPricesChanged (http://www.hybrid-solutions.com/support/index.php?/Knowledgebase/Article/View/2087) event is fired when any new quot done on the system, no need to call any method to get the new ticks for your symbols. (check the sample you will see that we updating the market watch using this event)

let me know if you need more help.

Dilip
12-12-2015, 06:58 AM
thank you Hassan,

i am developing a query based system so, using 'symbolpriceschanged' api, i have to maintain a dynamic class/structure for local storage to get latest quotes.... any other possible?

Hassan-HS
12-14-2015, 08:10 AM
Hello,


I got your point, you can use the code that you sent me it will update you with the latest tick



Dim tmpsym As COSymbol = m_oBOAPI.SymbolByName("IND GOLD FEB")

For value As Integer = 1 To 3
If m_oBOAPI.SymbolByName("IND GOLD FEB") IsNot Nothing Then
Dim tmpsym As COSymbol = m_oBOAPI.SymbolByName("IND GOLD FEB")
Dim tmpstr As String = ("Ask-" + tmpsym.Ask.ToString + "\n" + _
"Bid-" + tmpsym.Bid.ToString + "\n" + _
"High-" + tmpsym.High.ToString + "\n" + _
"Low-" + tmpsym.Low.ToString)
Message(tmpstr)
Message(tmpsym.ID.ToString)

End If
Next

Dilip
12-15-2015, 06:07 AM
Hello Sir,

the code above is not giving me latest values, as compared with plusfxbackoffice values.......


Dilip

Hassan-HS
12-15-2015, 07:47 AM
Hello :) ,




I believe there is a different with the symbols spreads, you have to select (http://www.hybrid-solutions.com/support/index.php?/Knowledgebase/Article/View/2065)the same account on the both sides (backoffice & backoffice API) to see the prices with the same spread value.

Dilip
12-15-2015, 08:11 AM
Hello Sir,

same account and symbol, with API and App. , but still found big difference in both ticks....
like code above always give 4 digits after decimal point, difference between ask and big prices are small and sometimes give equal values, etc....
so i think to use above code is bad idea to give live quotes.....

Dilip

Dilip
12-15-2015, 09:40 AM
test with BackOfficeAPI sample and found that quote price is different to plusfxbackoffice...
why there is so much difference in ticks with BackOfficeAPI and PlusFXBackOffice, even though we are using same credential for login.......

Dilip

Hassan-HS
12-15-2015, 09:41 AM
Hello,

Send me team viewer credentials let me check your code.

Tell me please more about your project.

Hassan-HS
12-15-2015, 12:10 PM
Dear :) ,

As per our team viewer session you have to use ClientSymbol (http://www.hybrid-solutions.com/support/index.php?/Knowledgebase/Article/View/2943) method to get the symbol prices with the spread value for a specific a account.

Dilip
12-17-2015, 05:42 AM
Dear Hassan Sir,

Thank you for support....

I want to ask that "Dim tmpsym As COSymbol = m_oBOAPI.SymbolByName("IND GOLD FEB")" is not giving proper ticks, so what this API meant for......
and "ClientSymbol" always give 50 pip fix spread value, and as per my knowledge, spread is a variable thing and always have positive value.....
also we have to select account to get proper tick, that means quotes may vary for every single account... is that so.....


Dilip

Hassan-HS
12-17-2015, 12:47 PM
Hello,

I talk about 10.2 BOAPI

In 10.2 API the following code return to you the Ask price without spread value for the selected account.
In 10.5 API it's returns the Ask price for the selected account with the spread value for the selected account.
Note: in the both versions the BO API selects the first account for the first client automatically.


m_oBOAPI.SymbolByID(SymbolID).Ask


The following code return to you the Ask price with spread value for specific account in both versions of API 10.2 & 10.5.
Note that in VertexFX system each client can has a unique spread value.


MsgBox(m_oBOAPI.ClientSymbol(SymbolID, 12347359).Ask)


Example

If the selected account is "12347359" and the spread for the client that has this account "12347359" equal 50 PIP

the following code will return 10.5 API , 1500.50
the following code will return 10.2 API , 1500.00


m_oBOAPI.SymbolByID(SymbolID).Ask




this code will return 10.5 API , 1500.50
this code will return 10.2 API , 1500.50


MsgBox(m_oBOAPI.ClientSymbol(SymbolID, 12347359).Ask)



Note : the prices on BO application display the prices according to the first node spread value until you select another account.

so if the spread value for the first node in the dealer tree is 50 pip that mean the BO will show you ask price with 50 pip spread.



let me know if you need more clarification.

Dilip
12-18-2015, 08:06 AM
Thank you Hassan,

Now, I am trying to get margin data of account using 'AccountSummaries' api.... for that doing 'SelectedAccount'.... but result in waiting....
So for multiple accounts I have to wait everytime until the status is in 'normal mode'.....
Also tried to get such information using 'COAccount' object and 'AccountByID' api.... but found no such info......
........ is there any way to get multiple account margin data without much waiting......


Dilip

Hassan-HS
12-19-2015, 09:35 AM
Hello,


I will check this issue and I will update you soon please standby.

Hassan-HS
12-22-2015, 11:01 AM
Hello :) ,


You can request this report (http://Thttp://www.hybrid-solutions.com/support/index.php?/Knowledgebase/Article/View/4159) to get data for your all account that's belong for specific client.


let me know if you need any thing.

Dilip
12-23-2015, 06:59 AM
Hello Hassan,

according to this (http://www.hybrid-solutions.com/support/index.php?/Knowledgebase/Article/View/4159) report, 'msgbox' only showing '1' and nothing else.... how to get report

Dilip

Rawan-HS
12-23-2015, 09:27 AM
Dear

You can get the report data from ReportDataReceived (http://www.hybrid-solutions.com/support/index.php?/Knowledgebase/Article/View/2099) event

Dilip
12-23-2015, 09:33 AM
Private Sub m_oBOAPI_ReportDataReceived(ByRef NoRows As Boolean, ByRef Data() As String) Handles m_oBOAPI.ReportDataReceived

above event is not called after 'm_oBOAPI.RequestReport'.......

Rawan-HS
12-23-2015, 10:59 AM
Dear :)
It is working in my side , and I have made a small sample for you check it and tell me if you need any things :)

Dilip
12-23-2015, 12:02 PM
Hello Rawan Sir,

your sample shows 'NoRows'.....


Dililp

Rawan-HS
12-27-2015, 09:18 AM
Dear Dilip

It seem you are login with a dealer dose not have privilege on any accounts.

Dilip
12-29-2015, 04:19 PM
Hello sir,

what rights are needed to get accounts data?
and after getting that privilege... can we get such margin data using 'COAccount' object and 'AccountByID' api......

Dilip

Rawan-HS
12-31-2015, 12:34 PM
Dear Dilip

You can get the margin data for any selected account under your dealer tree through 2 ways:

-Using RequestReport (http://www.hybrid-solutions.com/support/index.php?/Knowledgebase/Article/View/2070) method and get the result from the server by ReportDataReceived (http://www.hybrid-solutions.com/support/index.php?/Knowledgebase/Article/View/2099) event , but you must check before that your dealer has a privilege for the requested report (contact the dealing room for the company that gave you the dealer)

-Using AccountSummaries (http://www.hybrid-solutions.com/support/index.php?/Knowledgebase/Article/View/2072)method ,but you must select the account At least one time (http://www.hybrid-solutions.com/support/index.php?/Knowledgebase/Article/View/2065). and to get the summaries data you should wait the OpenPositionsLoaded (http://www.hybrid-solutions.com/support/index.php?/Knowledgebase/Article/View/2105) event to fire

check this code




Public WithEvents m_oBOAPI As New CVertexFXBOAPI


Private Sub GetAccountSummaries_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)Handles GetAccountSummaries.Click
m_oBOAPI.SelectAccount(91884581)


End Sub

Private Sub BOAPI_OpenPositionAdded(ByRef pos As VertexFXBOAPI10.COOpenPosition) Handles BOAPI.OpenPositionAdded
Dim Balance As Double
Dim FlTP As Double
Dim Credit As Double
Dim Equity As Double
Dim MarginReq As Double
Dim MaginLevel As Double
Dim EffMargin As Double
m_oBOAPI.AccountSummaries(91884581, Balance, FlTP, Credit, Equity, MarginReq, MaginLevel, EffMargin)
MsgBox("Balance is :" & Balance & " MaginLevel :" & MaginLevel)

End Sub

Dilip
01-02-2016, 12:59 PM
Dear Rawan Sir,

'AccountSummaries' method give data by reference and required that we should select account first.... but will it gives data of/for all accounts....
because selecting account cause application in 'waiting' mode.....


Dilip

Rawan-HS
01-03-2016, 09:19 AM
Dear Dilip

I have created small sample to get the account summaries for all account by AccountSummaries method
Check the code and tell me if you need any things :)

Dilip
01-05-2016, 05:01 PM
Dear Rawan Sir,

thanks for your reply....
but I already had such discussion with Hassan sir... that we can only get margin data of account which we have selected at a time..... and account selection put application in waiting state, so we have to wait until the app status is normal....
In ReportRequest.... I am getting 'NoRows' flag as 'true'....

Regards,
Dilip

Hassan-HS
01-06-2016, 07:37 AM
Hello,


Send me your teamviwer credentials as private message let me check why you get no rows, As for the last reply Rawan means that you must select the account for one time (when login) to get the data whenever you want.


Note: if the account get selected the account info's keep refreshed while your BOAPI is connected (so no need to select any account more than one time).

Dilip
01-06-2016, 03:43 PM
Hello Hassan sir,

pls find attachment of updated example....



Regards,
Dilip

Rawan-HS
01-13-2016, 09:23 AM
Dear Dilip

We have found the issue why the requested report returned no rows , and this is because there are no real accounts under your dealer privilege.
you can request the account status report just for real accounts.

Dilip
01-16-2016, 07:19 AM
Hello Rawan sir,

According to your last reply, we can only get reports of real accounts..... that means for margin or open position reports we have to do such real transactions in real accounts with real money, is it.....
This is a speed-breaker, for testing the application.....

I request you and vertex team to add request-report functionality for demo accounts.... if possible.....


Regards,
Dilip

Hassan-HS
01-18-2016, 09:01 AM
Hello Dilip ;)



I request you and vertex team to add request-report functionality for demo accounts.... if possible.....

Unfortunately this feature can't be done due to the following reasons:


It is one of those illogical features.
That's affect the performance of the system when fetching the reports.


As I told you you can change the account type from demo to real type as following steps:Open the accounts tree and you will find all the available accounts in your system. To make any editing on the accounts tree, just perform a right click on the desired Office/Client - Edit - you will see the two options: “Edit Account” and “Edit Office/Client”. As it is showing in the following pictures:

435
436






















From here, you can Edit any Information about this account, and after you finish press on the Submit button to save the changes.
Note that you need to uncheck the "Demo account check box"
After that, this account will be shown in the report you need even if it not has a real money.

437




If you don't want to do this steps in your system you can easily request a Demo Backoffice (http://www.hybrid-solutions.com/sales/request/demo-backoffice-request.html) on our system please mention that you a ISV partner (if you don't please join our ISV program (http://www.hybrid-solutions.com/sales/partnership/isv-program.html) first)

Dilip
01-23-2016, 07:24 AM
After updating backoffice API version...... 'CreateAccount' method fails with just change of 'MarginAccount' flag, and causing application to crash abnormally..... though that method was working fine with version 10.2.x,.....


Regards,
Dilip

Hassan-HS
01-24-2016, 08:09 AM
Hi Dilip,


Would you please send me a screenshot of the error and which version of BOAPI do you use.