View Full Version : How to get symbol's tick size or value via API

karolis

03-26-2014, 02:36 PM

Hello,

I have two questions regarding Backoffice API:

1. How to get symbol's tick size (e.g. 0.0001)

2. How to get symbol's tickvalue (e.g. 10 usd per tick)

Thanks,

Karolis

Hassan-HS

03-27-2014, 12:23 AM

Hello,

You can calculate the point of symbol as following...

Dim point as double

Dim vSymbol As VertexFXBOAPI10.COSymbol

For i As Integer = 1 To Dealer.SymbolsCount

vSymbol = Dealer.SymbolByIndex(i)

If Not vSymbol Is Nothing Then

Point =10 ^ -(Math.Abs(Dealer.SymbolByIndex(i).PipLoc))

End If

Next

2. How to get symbol's tick value (e.g. 10 usd per tick)

Please explain more, i don't understand you what you want exactly...

Hassan-HS

03-27-2014, 08:30 AM

To calculate the profit or the loss use the following formulas based on the following symbol settings:

Symbol Settings:

Contract Size

Ref Symbol

Direct/Indirect

Multiplication/Division

Formulas:

Direct & Ref symbol calculation = multiplication

Profit/ loss = Amount * ( Contract size * (Close price - Open Price ) * Ref Close Price)

Direct & Ref symbol calculation = Division

Profit/ loss = Amount * ( Contract size * (Close price - Open Price ) * (1/ Ref Close Price))

Indirect & Ref symbol calculation = multiplication

Profit/ loss = Amount * ( Contract size * ((1/Close price) - (1/Open Price) ) * Ref Close Price)

Indirect & Ref symbol calculation = Division

Profit/ loss = Amount * ( Contract size * ((1/Close price) - (1/Open Price) ) * (1/ Ref Close Price))

Example

Gold Setting Is :

Gold Contract Size=100

Ref Symbol=(USD)

Direct

Multiplication

Buy 1.0 lot Gold at price 2.00 and close it at 2.01 ------> profit= 1 / (USD)

that means 0.01 profit = 1/USD price.

karolis

03-28-2014, 08:08 AM

Dear Hassan-HS,

Thanks for answering the first question. For the second question, I was referring to dollar value of one tick, but I successfully calculated it by using the result from the first formula you provided.

Just a suggestion: it would be very helpful for all users if you provided some very brief comments in the code for methods. I saw PipLoc, but just did not know what that means, as there was no description of the property in IntelliSense.

One more question I have, is how to transfer a trader from one group to another?

Thanks for help in advance :)

Karolis

Hassan-HS

03-28-2014, 09:36 AM

You are welcome :)

Dim point as double

Dim vSymbol As VertexFXBOAPI10.COSymbol (http://www.hybrid-solutions.com/support/index.php?/Knowledgebase/Article/View/2022/0/cosymbol)

For i As Integer = 1 To Dealer.SymbolsCount

vSymbol = Dealer.SymbolByIndex(i)

If Not vSymbol Is Nothing Then

Point =10 ^ -(Math.Abs(Dealer.SymbolByIndex(i).PipLoc))

End If

Next

PibLoc: property returns a a number that represents the location of the pip.

Ex:

PipLoc = -4 ' means the the one location is after the decimal with 4 digits. => ( 0.0001)

How to convert PipLoc -X to this Style 0.XXXX ?

10 ^ PipLoc

One more question I have, is how to transfer a trader from one group to another?

You cant transfer client between groups using the API, but i will check the possibility to ad this in next version of API