Jump to content

BUG - API ClosePositionRequest returns OK/200 but does nothing (on demo)


Recommended Posts

Hi, 
I have been integrating your API and I want to close a position (using your example client). For that list the currently open positions [1] and based on received data create a CloseOTCPositionV1Request [2]. After sending the above mentioned request [2], I receive HttpStatus OK/200 along with a CloseOTCPositionV1Response containing a dealReference [3].. Therefore I would expect this position to be closed, but I can repeate this multiple times!!! Also I can see the open position in the UI.

From my perspective this is a bug..

Thanks for clarification

Jaroslav

 

[1] PositionsItem{position=Position{contractSize=10000.0, createdDate='2022/03/07 08:09:11:000', createdDateUTC='2022-03-07T08:09:11', dealId='DIAAAAHUBFF4UAN', size=1.0, direction=BUY, limitLevel=null, level=151.958, currency='JPY', controlledRisk=false, stopLevel=null, trailingStep=null, trailingStopDistance=null}, market=Market{instrumentName='GBP/JPY Mini', epic='CS.D.GBPJPY.MINI.IP', marketStatus=TRADEABLE}}

[2] CloseOTCPositionV1Request{dealId='DIAAAAHUBFF4UAN', epic='null', expiry='null', direction=BUY, size=1.0, level=null, orderType=MARKET, timeInForce=null, quoteId='null'}

[3] RefID = 2EQC69M1FXHPRD0N1

 

INFO  [2022 03 08 - 18:36:40,524] [ForexApp] [main]: IgRestApi Client: re-connecting as sa_demo_forex2
INFO  [2022 03 08 - 18:36:40,833] [ForexApp] [main]: Listing positions..
INFO  [2022 03 08 - 18:36:40,834] [ForexApp] [main]: PositionsItem{position=Position{contractSize=10000.0, createdDate='2022/03/07 08:09:11:000', createdDateUTC='2022-03-07T08:09:11', dealId='DIAAAAHUBFF4UAN', size=2.0, direction=BUY, limitLevel=null, level=151.958, currency='JPY', controlledRisk=false, stopLevel=null, trailingStep=null, trailingStopDistance=null}, market=Market{instrumentName='GBP/JPY Mini', epic='CS.D.GBPJPY.MINI.IP', marketStatus=TRADEABLE}}
TRACE [2022 03 08 - 18:36:40,834] [ForexApp] [main]: Executing close position request for deal = DIAAAAHUBFF4UAN
DEBUG [2022 03 08 - 18:36:40,839] [ForexApp] [main]: json body: {"dealId":"DIAAAAHUBFF4UAN","epic":null,"expiry":null,"direction":"BUY","size":2.0,"level":null,"orderType":"MARKET","timeInForce":null,"quoteId":null}
DEBUG [2022 03 08 - 18:36:40,840] [ForexApp] [main]: conversation context was provided
TRACE [2022 03 08 - 18:36:41,041] [ForexApp] [main]: Executing close position request for deal = DIAAAAHUBFF4UAN ... OK - RefID = 2EQC69M1FXHPRD0N1
Link to comment

 I hope this helps someone - my problem was, that the Direction needs to be oposite from what it is in the Position.. So if Position is in the SELL direction, the ClosePosition needs to be in the BUY Direction.. 
From my perspective, this is a redundant variable which should not be mandatory - If I want to close position, i want the oposite of the open position implicitly..

Link to comment

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
  • image.png

  • Posts

    • Intrigued by Mande's "Onchain Credibility Hub"! DESO's user-owned data is another great idea for Web3. HMN's talent marketplace is a strong piece too. Bitget listing is cool, but focus should be on Mande's tech! Synergy possible: Mande verifies skills, HMN finds matching projects
    • Telcoin's definitely shaking things up with affordable mobile transfers! But MOB sounds interesting for secure everyday payments. Abra seems like a one-stop shop for global money stuff. Telcoin being on Bitget is cool, but competition is healthy! Maybe Telcoin can focus on low-cost remittances while MobileCoin tackles daily purchases. Telcoin's not the only player, but they're definitely a piece of the puzzle.
    • Telcoin is a frontrunner in leveraging blockchain technology for affordable and accessible mobile money transfers. Intrigued by this concept? Let's explore other projects working to revolutionize how we send and receive money around the world, with a focus on mobile solutions. MobileCoin (MOB), this project aims to provide a secure and private mobile-first cryptocurrency specifically designed for everyday transactions. Abra (ABRA), this global investment app allows users to buy, sell, and trade various cryptocurrencies and assets, including sending and receiving money internationally. So, is Telcoin the only game in town for mobile money transfers cause they got listed on Bitget? Maybe or maybe not! There are established players and innovative startups tackling this challenge. What do you think? Is Telcoin the future of mobile money transfers, or just a piece of the puzzle? Have you explored any other mobile money transfer projects? Share your thoughts in the comments!
×
×
  • Create New...
us