Jump to content

Recommended Posts

When I place an order, it doesn't seem to process. 

No open order exists, no positions are held:

====================== Place Order ==========================
2020-08-23 18:58:49 ET
https://ciapi.cityindex.com/TradingAPI/order/simulate/newtradeorder?UserName=XX&Session=cc
Parameters:
Array
(
    [OcoOrder] => 
    [Type] => 
    [LastChangedDateTimeUTCDate] => 
    [ExpiryDateTimeUTC] => 
    [Applicability] => 
    [Direction] => buy
    [ExpiryDateTimeUTCDate] => 
    [TriggerPrice] => 
    [BidPrice] => 1.17997
    [OfferPrice] => 1.18011
    [PriceTolerance] => 900
    [AuditId] => 8049808-0-0-0-R
    [MarketId] => 401484347
    [isTrade] => 1
    [OrderId] => 0
    [LastChangedDateTimeUTC] => 
    [Currency] => 
    [Quantity] => 100
    [QuoteId] => 
    [TradingAccountId] => 403013620
    [MarketName] => EUR/USD
    [PositionMethodId] => 1
    [Status] => 
    [IfDone] => Array
        (
        )

)

Result:
Array
(
    [Status] => 1
    [StatusReason] => 1
    [SimulatedCash] => 50000
    [ActualCash] => 50000
    [SimulatedTotalMarginRequirement] => 2.36
    [ActualTotalMarginRequirement] => 0
    [CurrencyId] => 11
    [Orders] => Array
        (
            [0] => Array
                (
                    [StatusReason] => 1
                    [Status] => 3
                )

        )

)

====================== Get Open Orders ==========================
https://ciapi.cityindex.com/TradingAPI/order/activeorders?UserName=XX&Session=cc

Parameters:
Array
(
    [TradingAccountId] => 
    [MaxResults] => 
)

Result:
Array
(
    [ActiveOrders] => Array
        (
        )

)
====================== Get Positions ==========================
https://ciapi.cityindex.com/TradingAPI/order/openpositions?TradingAccountId=403013620&UserName=XX&Session=cc

Result:
Array
(
    [OpenPositions] => Array
        (
        )

)
 

Share this post


Link to post

Hi,

The order request is being sent to the simulate trade endpoint, rather the the actual trade endpoint. The simulate trade endpoint as its name suggets, only simulates a trade (to calculate the potantial margin required) without actually placing the trade.

Send the request to the .../TradingAPI/order/newtradeorder endpoint to actually place the trade.

Kind Regards, PM

Share this post


Link to post

Of course I understand that it is being sent to the simulate trade endpoint. However, it does not actually simulate a trade.

Is there a simulated openpositions / activeorders / balance endpoint?

So is the simulation not a full functioning sandbox to test executions?

 

 

Share this post


Link to post

Hi,

No, as mentioned in my previous post the SimulateTrade call is used to calculate the potential margin requirement for the proposed trade details submitted. It is used in the deal ticket of our trading platforms.

The API reponse to the SimulatedTrade call provides the following information.

{
    "Status": 1,
    "StatusReason": 1,
    "SimulatedCash": 19002.12,
    "ActualCash": 19002.12,
    "SimulatedTotalMarginRequirement": 444.65,
    "ActualTotalMarginRequirement": 0,
    "CurrencyId": 6,
    "Orders": [
        {
            "StatusReason": 1,
            "Status": 3
        }
    ]
}

 

Kind Regards, PM

 

Share this post


Link to post

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
×