Jump to content

Physicsman

Administrators
  • Content count

    601
  • Joined

  • Last visited

  • Days Won

    9

Physicsman last won the day on January 9

Physicsman had the most liked content!

1 Follower

About Physicsman

  • Rank
    Staff

Profile Information

  • Gender
    Male
  • Location
    London, Great Britain

Recent Profile Visitors

1,072 profile views
  1. 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
  2. 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
  3. 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
  4. 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
  5. 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
  6. 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
  7. 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
  8. Hello, Unfortunately, Trade/Order notifications cannot be switched off/disabled on the trading platforms. Kind Regards, PM
  9. 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
  10. 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
  11. 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
  12. 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
  13. 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
  14. Hi JPL, The API AppKey can be obtained by contacting the client services team. We're not able to create one from a forum rewquest unfortunately. Kind Regards, PM
  15. Market Order

    Hi JPL, Price tolerance is in Pips. The default setting is 2 for all markets. Kind Regards, PM
×