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
  • General Statistics

    • Total Topics
      21,295
    • Total Posts
      90,940
    • Total Members
      41,422
    • Most Online
      7,522
      10/06/21 10:53

    Newest Member
    Chester
    Joined 08/02/23 06:56
  • Posts

    • For more up to date news on how markets will open, the latest earnings and economic news, watch IGTV live in the platform at 07:30am UK. Today’s coverage: Indices: European mkts expected up. FTSE100 24hr mkts another new record high FX: Little move despite Powell saying more US rate rises needed to combat inflation Equities: Earnings this morning - BDEV PZ SVT TTE.  VOW last night a disappointment. This evening - UBER DIS. ZOOM announces 15% cut in global workforce Commods: Gold up for third day.  Oil up after API drop in inventories. NY orange juice another new record high        
    • Elliott Wave Analysis TradingLounge Daily Chart, 8 February 23,   Uniswap / U.S.dollar(UNIUSD) UNIUSD Elliott Wave Technical Analysis Function: Follow trend     Mode: Motive Structure: Impulse Position: Wave III Direction Next higher Degrees: wave III of Motive Details: Wave 3 rise is likely towards the level of 15.37 Wave Cancel invalid Level: 4.946 Uniswap / U.S.dollar(UNIUSD)Trading Strategy: Uniswap is likely to recover well as price breaks through the MA50 and MA200 are bullish signals. and leads to the movement of wave III that is usually equal to 1.618 x the length of wave I at the level of 15.371. Uniswap / U.S.dollar(UNIUSD) Technical Indicators: The price is above the MA200 indicating an uptrend. The wave oscillators above Zero-Line momentum are bullish. TradingLounge Analyst: Kittiampon Somboonsod     Elliott Wave Analysis TradingLounge 4H Chart, 8 February 23,   Uniswap / U.S.dollar(UNIUSD) UNIUSD Elliott Wave Technical Analysis Function: Counter trend     Mode: Corrective Structure: Flat Position: Wave (B) Direction Next higher Degrees: wave ((2)) of Motive Wave Cancel invalid Level: 4.95 Details: Pullback of wave (B) when end, the price decline to wave (C)again. Uniswap / U.S.dollar(UNIUSD)Trading Strategy: Uniswap There is a strong recovery trend when the price breaks MA50 and MA200 is a good sign. But nevertheless, the price is in a phase of retracement in wave (2), when it finishes, the price resumes upward trend. Wait for wave ((2)) to complete. Uniswap / U.S.dollar(UNIUSD)Technical Indicators: The price is above the MA200, indicating an uptrend. The wave oscillators below Zero-Line Bearish momentum.
    • may I ask if anyone knows where is a good place where there is a forum on Excel Based Trading?
×
×
  • Create New...