Jump to content


  • Content count

  • Joined

  • Last visited

  • Days Won


Everything posted by Physicsman

  1. Hello Aniket, The API documentation needs to be updated. The version of Lightstreamer running on our servers is (v7.03). The client development kits (CDKs) matching v7.03 can be download at: https://lightstreamer.com/download/#ls70. You just have to pick the correct programming language CDK to match what you are using. Kind Regards, PM
  2. Best way to know if Market is closed

    Hi Superee, It is the MarketPrcingTimes fields. Since these are Forex 24H trading markets, we've been using a shortcut internally and that is probably what is causing you confusion. DayofWeek 0 is Sunday and DayofWeek 5 is Friday. Since we know that FX markets open on Sunday and close on Friday, we just take the current week's Sunday and Friday dates. The actual Date returned in the field is just today's date and close time of 22:00 hours. We're ignoring the date and appending the 22:00 hours close/open times to the Sunday Start and Friday End dates to get each weeks open/close. Kind Regards, PM
  3. Streaming Data and Historical Data

    Hi Sir Newton, If those are indeed actual price ticks the team will be able to correct it appropriately without losing the data. Kind Regards, PM
  4. Streaming Data and Historical Data

    Hi SirNewton, According to the Pricing team, an erroneous price tick was sent after market close on Friday resulting in the Saturday price bar. The team are working on removing this from the chart database. Kind Regards, PM
  5. Streaming Data and Historical Data

    Hi SirNewton, I'll look into this for you and reply back with our findings. Kind Regards, PM
  6. Closing trade

    Hi SirNewton, When you didn't include anything in the Close field the system should be closing your positions in the order they were opened going from first to second..., rather than closing them at random. Reading through the following link on the rule, it looks as though the NFA's aim of implementing this FIFO rule was to prevent clients from "hedging", which is to have simultaneous offsetting long and short positions in the same market. https://www.investopedia.com/terms/n/nfa-compliance-rule-2-43b.asp Kind Regards, PM
  7. Hi Superee, Check the OrderStatusReason code that is also included in the response. It provides more information on the error and its cause. Kind Regards, PM
  8. Closing trade

    Hi SirNewton, A couple of clarifying questions: Are you a US client? Did you have more than one open position in the same market, and you were attempting to close one of those open positions specifically? The error message you are seeing is related to the case when the answers to both questions above are true. US clients are forced by the US regulator to close positions in a First In First Out (FIFO) order. For example, if you buy GBP/USD, then a little time later add to your buy position, and after some more time buy a 3rd position in GBP/USD. As a US client you must close the positions in the order you opened them. If you try to close say the 2nd or 3rd position out of sequence, then you will receive this error message. If the above doesn't apply to you we can investigate further. Kind Regards, PM
  9. Hi Superee, In the first case, that is referring to any logs the user/developer such as yourself stores on the prices you are trading on. Should not need/want to keep logs on this type of information/transaction it is not required to successfuly use the API. In the second case, it is also referring to the logs (if any) kept by the user/yourself on the API responses received for each call you send. Specifically, you would check the OrderStatusReason code in the response for additional information as to why you are receiving a red card. PS: the API documentation site has been back up for the past couple of weeks so you can go back to user that over the PDF file should you prefer. Kind Regards, PM
  10. Hi SirNewton, Unfortunately I am not able to check any queries related to price discrepancies. Please contact client services who will have the relevant team investigate and reply to you with their response. Kind Regards, PM
  11. Hi SirNewton, The PriceTolerance does not change the prices you see at all. It only affects the potential prices you can be filled (trade executed) at. That is, with PriceTolerance = 2, you are allowing the system to fill you with up to 2 points of slippage, whereas a Tolerance of zero means fill me at the price I am seeing right now only. Were the market price to have moved by even 1 point by the time the server receives your order request then the order request is rejected and no trade is executed. Kind Regards, PM
  12. Real-time streaming and trading

    Hi SirNewton, 1) I'm not sure where Yahoo Finance are receiving their streamed prices from for those hours. You can only trade with us in within our open market hours. The GetMarketInformation call can query for the market hours we are open for each market you are looking to trade. 2) The Price field in the Prices stream is the Mid price. So you can check for the Bid, Offer or Mid price as you prefer. Kind Regards, PM
  13. Hi Superee, There's been a slight confusion in the error codes you are using that has sent you on a slight wild goose chase. The first set of codes (in green below) are the InstructionStatus and InstructionStatusReason codes. It is the 2nd set of codes (in red below) that are the OrderStatus and OrderStatusReason codes. 158 = Price tolerance exceeded. I see your in your trade request that you are overriding the default value of 2 to zero. A value of zero makes your trade request a "Fill or Kill" (FOK) order request. This means execute the trade at the price I am seeing right now and only this price. If the price should move by even 1 pip then kill my order and nothing done. If you loosen the price tolerance back to 2, then you are more likley to have the trade executed, although you can have up to 2 points of slippage. Note: if you are attempting to trade during volatile periods when the prices are moving very fast, you can still receive a 158 even with a price tolerance of 2. Kind Regards, PM
  14. Real-time streaming and trading

    Hello SirNewton, 1) Yes, you can begin trading immediately upon a market opening. 2) Live price streaming stops when a market closes. As far as I know all markets are closed by Friday 9pm GMT, although there may be exceptions I don't know about. 3) Different markets open at different times. There are many markets such as FX markets that open Sunday night at 10pm. Youu can always check the market open and close times for the markets you are interested in trading by making a GetMarketInformation call. 4) We maintain varying amounts of historical data depending upon the market and upon the timeframe. For example, for the most popular / major markets we store more historical data compared to some other markets. We also store a longer history for the longer timeframes, such as daily, weekly data etc. For intra-day data such as 5 minutes bars for example, we may store only a day or 2. Each "day" is from midnight (00:00) to 23:59 GMT. 5) The historical data is available immediately. For example, a GetLatestPriceBars "daily" timeframe call for 1 bar will return yesterday's (Monday 8th Feb) complete bar, and today's (Tuesday 9th Feb) partial bar up to the moment at which the call was received. 6) The AuditID is read from the live streaming Prices stream. There is a unique AuditId accompanying each price tick. 7) The minimum and maximum trade quantities are set on a per market basis. You can find the min/max trade sizes for each market by making a GetMarketInformation call. 8) Your trade call appears to cover all the required fields. The NewTradeOrderRequestDTO specifies the fields and also which ones are nullable. 9) For Spot FX markets, 1000 is the minimum trade size. Kind Regards, PM
  15. Hi Superee, I checked with a few of my test accounts and they are all working fine. Are you perhaps using a demo account? Demo accounts have a limited period of validity before they expire. Are you able to login with the account and can you perform any other API calls with it? Kind Regards, PM
  16. Hi Superee, ApiStopLimitOrderDTO also inherits from ApiOrderDTO and all of its properties, hence the link to that DTO in the documentation. Additionally, many of the Properties are nullable and can be dropped from the reqeusts. A valid trade request with attached stops/limits can be formed as in the following example: "IfDone": [ { "Stop": { "OrderId": 778252070, "StatusReason": 1, "Status": 2, "OrderTypeId": 2, "Price": 0, "Quantity": 1000, "TriggerPrice": 1.36261, "CommissionCharge": 0, "IfDone": [], "GuaranteedPremium": 0, "OCO": null, "AssociatedOrders": { "Stop": null, "Limit": null }, "Associated": false }, "Limit": { "OrderId": 778252069, "StatusReason": 1, "Status": 2, "OrderTypeId": 3, "Price": 0, "Quantity": 1000, "TriggerPrice": 1.36661, "CommissionCharge": 0, "IfDone": [], "GuaranteedPremium": 0, "OCO": null, "AssociatedOrders": { "Stop": null, "Limit": null }, "Associated": false } } ], Kind Regards, PM
  17. Best way to know if Market is closed

    Hi Ken, If you are subscribed to the live prices stream there is a field within the stream called StatusSummary. It indicates the current state of the market. Values are: 0 = Normal 1 = Indicative 2 = PhoneOnly 3 = Suspended 4 = Closed The only other alternative is to make a REST GetMarketInformation call that provides the market trading and break times. This will alow you to work out when a market is open or closed. Kind Regards, PM
  18. Is the API Documentation site down?

    Hello, You may temporarily use the address: https://platformapidocs.svc.cityindex.com/ to access the online documentation. This will be mapped to http://docs.labs.gaincapital.com/ soon, which remains it's permanent address. Kind Regards, PM
  19. Hello Superee, If your trade call is not using the actual live Bid/Offer prices at the time you send the call, you won't have it in your logs as to what price you received at the time the trade was made. I would suggest it is better to have the call to request the current Bid/Ask and use them in your trade call so you have it on record, but if that isn't something you check then it is your choice. Similarly, the MarkeName field is there should you or another user require it in the trade call. If you don't require it, you can leave that from your call. Kind Regards, PM
  20. Hi SirNewton, We don't have any plans to add an apache Kafka streaming server. As Superee already mentioned, please only use the LIVE URLs. References to Pre-production are going to be removed from the documentation during the next refresh as that is now purely an internal environment only. Kind Regards, PM
  21. Hello, Our API documentation site is currently down but should be back online in the next few days. In the meantime, you can refer to the API documentation as a PDF in the attached file. CIAPI User Guide.pdf In answer to your question, you'll have to subscribe to the live prices stream using the third party LightStreamer API. You can find documentation for the Lighstreamer API at: https://lightstreamer.com/doc. You'll also need to download the correct Lightstreamer client development kit (CDK) for the programming language you are using, and that matches the Lightstreamer version we have on our servers (v7.03). CDKs for v7.03 at: https://lightstreamer.com/download/#ls70. Kind Regards, PM
  22. Hello, We have a project to automate documentation updates so that de-synchronisation such as the examples above no longer happen. Until that is implemented, the documentation is still being updated manually. It looks as though the DTO fields page was not updated when new fields were added, although the page with the Trade calls were updated with the new fields. We're scheuling some updates to refresh the docs to clean up discrepancies such as this. Kind Regards, PM
  23. Hi, Are you using a Direct Market Access (DMA) account? Those are our account types that don't allow users to attach Stops/limits to close a specific position. Or do you have an account under US jurisdiction? There are certain restrictions for those accounts too. I checked the API JSON code you are sending and it is in a valid format. It should work - if your account supports it. Kind Regards, PM
  24. Hi Captain, We're looking into this for you and will reply as soon as we can. Kind Regards, PM
  25. Hello, 1) All clients use the same API, regardless of which brand they are with. That is why you have to use the correct Market ID for the markets that you can access and trade with your brand. 2) We use UTC (GMT) as the basis for time - it looks as though you've been converting the time to West Coast USA, which is -8 hours from GMT. When I run the conversion on the first bar above I see it as the bar starting on Thursday 21st Jan at midnight (00:00 hours). The second timestamp is the bar starting Friday 22nd Jan. The 2nd price bar is the one you want for Friday's OHLC prices. Kind Regards, PM