Jump to content

All Activity

This stream auto-updates     

  1. Yesterday
  2. Hello, If you are reading the Bid/Offer prices from the live price stream using an automated process and not manually, in normal markets that should be enough time to reach our servers and fill the trade without error. Only during volatile "fast" markets would there be a chance of the trade request being rejected due to "Price Tolerance" reasons. The Price Tolerance specifies the amount of slippage you are willing to take in order to get a trade done. It is set at 2 by default for all markets. You can override this PriceTolerance value in your trade request call. There is a PriceTolerance field you can set in the newtradeorder call. If you set it to a larger value, such as 100, that should be more than sufficient to have your trade filled even if the market price moves. The markets would have to be extremely volatile to move >100 pips in a second or two for the trade to be rejected. Kind Regards, PM
  3. Hi, For the question in your 2nd post. I presume you meant the Cash values change immediately after you close all your open positions? This is because the back-end processes/calculates your new cash value for each open positoin closed separately, and there is a lag time time to the calculations. Since you are refreshing the APi call every second, you are seeing the Cash value update while it is still calculating the changes from each closed position. The value should stabilise after a short while to the final value of your Cash balance once the back-end has computed your final value from all the closed positions. Just one query: are you using a demo account for your testing? It is recommended you use a demo account while you are testing and setting up your system so you do not use your real-money account until you are ready to Live trade. Kind Regards, PM
  4. Hello, In answer to the question in your first post. The "Cash" displayed on the Web Trader platform is streamed and does not use the REST API GetClientAccountMargin call. The Cash value from the stream on the Web platform is updated after you close/modify your open positions. The GetClientAccountMargin call retrieves the latest current values for your account. That is why if you have open positions and are calling it repeatedly every second, then it will show the latest current value, which will change over time since you have open positions. This is not the recommended way. You should subscribe to the Lightstreamer ClientAccountMargin stream instead. Kind Regards, PM
  5. IN the mean time, since about 1 hour the Cash value on my webtrading plattform is: 11045,76 Euro but the answer from GET https ClientAccountMargin is: 11028,02 Euro. And one more very interesting thing: If I close all orders and all trades on my EUR/USD market and having no orders or trades on other markets, (it means, I have no positions or orders anywhere) the "Cash" value from GET https ClientAccountMargin is changing after every GET request, (which I make in about every second). Why? THX !
  6. It is fine, but if I get from live price stream the bid and offer prices and sending my trade request with them, it can be, that in the mean time, this values will be changed, so my trade request will be not placed and I get an error return message. For this is real better to set the trade with bidprice = last tick price * 10 offerprice = last tick price * 10 ? Which way is the best to set bidprice and offerprice if I accept any current price ? THX!
  7. Hi, I have placed more trades (Forex CFD UK plattform EUR/USD market) and reading in every second by GET https ClientAccountMargin: GET https://ciapi.cityindex.com/TradingAPI/margin/ClientAccountMargin The value "Cash" is on my Web Trading plattform is 11038,70 EUR and it is stable, not changing, during all trades are waiting to be executed, but the return value from GET is: 11054.40 and is continously changing, during the open trades are waiting to be executed. It seems, that the "Cash" value on the GET answer is moving according the current EUR/USD price, but is should not. It must be constant, like on the web plattform, but it is not. Why? What shall I do to have the same non changing "Cash" answer value, getting by https GET as showed on the top of the web plattform ? THX !
  8. Buy trade position margin is 0

    Hello, From the screenshot you have what is called a "hedged" trade, where you have equal and opposite sized trades in the same market. In this case you have bought 1000 in EUR/USD and have also sold 1000 in EUR/USD meaning you are effectively market neutral. In these cases, you are only charged margin on one leg of the trade - the first position opened. As you have also said, if you were to then place a further hedge trade for example by selling another 1000 in EUR/USD, then you will be charged margin only on the larger leg - the 2000 Sell position. The remaining 1000 buy position will continue to show zero for margin requirement. Did you mean to create a "hedged" trade or where you trying to buy 1000 to close your sell 1000 position? Kind Regards, PM
  9. Hello, The Bid price is the Sell price for a market and the Offer price is the Buy price. When sending a new trade request, read in from the live price stream the current Bid / Offer price and fill in the BidPrice & OfferPrice fields with those values. Kind Regards, PM
  10. Hi, Please describe me, what is the meaning of bidprice and offerprice in the POST: https://ciapi.cityindex.com/TradingAPI/order/newtradeorder What shall I setup for them, if I want to place immediatelly a buy trade order at actual price ? I mean, if I want to set a buy trade position at current price, which price shall I define for bidprice and offerprice ? It seems to work, if bidprice = last tick price * 10 offerprice = last tick price * 10 But I do not believe, that this is the right setting. THX !
  11. Hi, I am setting on UK CFD plattform a buy and a sell trade positions by https POST https://ciapi.cityindex.com/TradingAPI/order/newtradeorder after each other for 1000 PCS EUR/USD at the begining of my program and the web plattform shows, that the margin of the buy position in 0,00 ! The margin of the sell trade is every time not 0, showing the right marge value. If I place later other buy trades, it works. The margin of the new trades will be not 0,00, but the right value. It means, my https POST must be OK. Sometimes, if I place a new buy trade, the margin of the first trade with 0,00 margin, become the right value, or also if I close the sell trade. It means, somehow the system does not show the margin, only later if I place or close other trades. But this is no every time, sometimes the first trade remains 0,00. I attached a screenshot about it. It is german language, but you can find, what it means. What does it cause ? THX !
  12. Stream about open positions

    Hello, It sounds as though you are trying to replicate the functionality of the Open Positions panel from our trading platforms in your own application. The normal usage pattern is then: Subscribe to the Orders stream. Call ListOpenPositions to initially populate your Open Positions grid. Upon receving an update to your open positions from the Order stream, call GetOpenPosition to update your Open Positions grid with the latest updates. Kind Regards, PM
  13. Hello, Subscribe to the Orders stream, which will provide an update / information on any orders as soon as they are filled / cancelled etc. Kind Regards, PM
  14. Last week
  15. Hi, Is it possible to initialise a lightstreamer stream to get current info about, which positions are open at a market, I placed open positions (trades) ? I mean, the same info, which can be get by a GET http call of: https://ciapi.cityindex.com/TradingAPI/order/openpositions I would need about 2 times in a second an info about my open positions, to be able to detect, if one or more are executed. Or how can I get easyest way actual information about, if an open position was executed ? Is it possible to get a message if a position was executed, instead, asking every second by http GET ? THX !
  16. Hi, If I place a trade with an order ID with stop loss and take profit prices on UK CFD market, after reaching one of the triggers and terminating the Order ID, how can I get information about on which price and by which trigger (S/L or T/P) was terminated ? I mean, if stop loss or take profit price was reached, the ID disappear from my positions list and I want to know, on which price and by which trigger was it terminated. THX !
  17. Hello, Unfortunately, Trade/Order notifications cannot be switched off/disabled on the trading platforms. Kind Regards, PM
  18. Hi, On the web plattform of Forex CDF UK trading, if I place an order or a trade on the right side of the display appears a colored bar with the info about my order or trade. It appears for some seconds and scrolling down and disappears slowly. But if I place many orders at the same times, these are disturbing, because the whole right part of the display is full of them and it takes longer time, till all are disappeared. How can I setup it, that no info bar appear, if I place an order or trade? THX for helping!
  19. Placing Multiple Order

    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
  20. Placing Multiple Order

    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.
  21. Placing Multiple Order

    Hello CFDs use the same formula as spot FX so you can use the formula I provided already in my previous answer. Cordially, PM
  22. Placing Multiple Order

    Hi, I am an UK trader, trading with CFD-s. Please tell me, how can I calculate PIP value of a market. THX !
  23. 500 error?

    Hello Wertmandu, I'm surprised this call worked previously as it should not have done. This is because you are supplying a TradingAccountId of 0, instead of the actual trading account ID. It should only work when it has the correct ID. As a side note: you should send the OrderID as "null" or you can even drop this field entirely. Try the call with the correct TradingAccountId and see if that resolved the problem. Kind Regards, PM
  24. Placing Multiple Order

    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
  25. Placing Multiple Order

    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
  26. 500 error?

    Hello! I have been testing and developing a trading app for the past few months, however recently I have not changed anything in my api calls and have been getting 500 errors coming back. I was wondering if I need to make any changes to my code. Here is an example of a call POST https://ciapi.cityindex.com/TradingAPI/order/newtradeorder?UserName=****&Session=**** { "MarketID": 401484347, "Direction": "buy", "BidPrice": 1.10294, "OfferPrice": 1.10335 , "Quantity": 1000 , "OrderID": 0, "positionMethodId": 1, "TradingAccountId": 0, "MarketName": "EUR/USD", "isTrade": true } I made a call to account help and the practice account I am using for development is still active and I was able to use this up until last Tuesday when my server crashed. I got it all back up and running but I haven't had a trade since I got it back up. Was there an update to the api? Please let me know if I need to elaborate more.
  27. Placing Multiple Order

    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 !
  1. Load more activity
×