Jump to content

Recommended Posts

Hi Cinemizer,

Do you mean placing more than one entry order at a time? You can only place 1 entry order at a time, but if you are placing "Once Cancels the Other" (OCO) or If/Done orders, then more than one order is placed at the same time. However, those additional orders are conditional.

Kind Regards, PM

Share this post


Link to post

Hello,

How can I calculate or get the information about, how much value has got one PIP in a market trade ?

If I login by web surface to forex.com, before placing a trade I will be informed about it and also about required marge on the bottom of window.

But the function
POST https://ciapi.cityindex.com/TradingAPI/order/simulate/newtradeorder
informs me only about margin, but not about PI value of minimum quantity.

How can I get PIP value ?

 

Share this post


Link to post

One more question:

How can I get information by POST or GET about

* my trading resource
* net capital
* cash of my account
* of non realised P/L

THX !

Share this post


Link to post

Hi Cinemizer,

In answer to your question about obtaining PIP value.

This is calculated from field values obtained by making a GetMarketInformationCall. I believe you are a US client trading spot FX? The formula is then:

Spot FX Market: (Quantity * (TrailingStopConversionFactor || 1) * fxConversion) / QuantityConversionFactor

Kind Regards, PM

Share this post


Link to post

Hello Cinemizer,

In answer to your question about obtaining account resource information.

Usually, you obtain these values as live, updating numbers via the ClientAccountMargin stream. However, if you want a static snapshot of these values, you can use the GetClientAccountMargin HTTP Get call. 

Kind Regards, PM

Share this post


Link to post

Thx, but which values are these?

(Quantity * (TrailingStopConversionFactor || 1) * fxConversion) / QuantityConversionFactor

In return answer: ApiMarketInformationDTO

http://docs.labs.gaincapital.com/#Data Types/ApiMarketInformationDTO.htm

I have found:

"QuantityConversionFactor" but did not found return value as "fxConversion" and "TrailingStopConversionFactor".

And waht does "|| 1" mean ?  "OR" by 1 ?

Please write me the right formula from return values of ApiMarketInformationDTO to calculate PIP value.

 

By the way:

In this example:

http://docs.labs.gaincapital.com/#HTTP Services/GetMarketInformation.htm%3FTocPath%3DCIAPI%20Reference|HTTP%20Services|Market|_____2

GBP/USD ID will be written in the description text as: 401166448 but in the example below will be written:

GET https://ciapi.cityindex.com/TradingAPI/market/401166447/information

Theses are not the same market ID number. I guess, this is a failure. I do not know which ID is really the GBP/USD, but please correct the bad ID.

Share this post


Link to post

Hello,

TrailingStopConversionFactor should also be returned with the MarketInformation call along with the QuantityConversionFactor (see screenshot)

fxConversion is the actual conversion rate from the currency base pair you are trading to your account currency. So if you are trading GBP/USD, then USD is the pair base currency, therefore you will need to convert USD to GBP to obtain the PIP value in pounds, instead of a PIP value in USD. 

Example: quantity 1 CFD contract in GBP/USD is a PIP value of 1USD, which when converted back to account currency in pounds is PIP value = £0.80 approximately.

Yes, (TSCF || 1) means use TSCF unless its value is null then use 1 instead. || means OR as you correctly guessed.    

 

The code examples are not meant to be used verbatim. The marketIDs differs between brands such as City Index or FOREX.com etc. The examples are just generic representations of how the code should look like approximately. When using the code, you should for example follow the instructions described in: http://docs.labs.gaincapital.com/#How Do I/Find Market ID.htm%3FTocPath%3DHow%20Do%20I...%3F|_____1 to find the correct market ID that you have access.

Kind Regards, PM 

image.png

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×