Jump to content
Sign in to follow this  
zhan

Submit StopLimit Trade

Recommended Posts

Hi, for submitting a limit order using NewStopLimitOrderRequestDTO

 

  1. Do I need to fill up IfDone parameter?
    (I only need to submit a limit order) 
    If so, the order info to fill up (ApiIfDoneDTO) will be the same as
    NewStopLimitOrderRequestDTO for the Limit object and leave the Stop object as null?
     
  2. The version of CIAPI.dll is 8.0.0.0 which doesn't have Reference parameter.
     
  3. Do I always need to have BidPrice & OfferPrice when I submit the order?
    Do I get the bid & offer price from LightStreamer PRICES directly?
    Meaning I have to subscribe to get the price update and fill up the bid & offer price.
     
  4. I tried submitting some buy & sell order without IfDone parameter, however, those orders I submitted 
    is not done and they are still active for 2 days, so how to test for done and partial done trades?

 

Share this post


Link to post

Hello Zhan,

 

1) If you are submitting just a new limit order, then no you do not fill in the IfDone parameter. Only if you are creating an If/Done order then you fill in that property.

 

Leave the IfDone parameter as an empty array. The following is an example of the data posted with NewStopLimitOrderRequestDTO to create just a limit order:

 

{"isTrade":false,"BidPrice":17760,"Reference":null,"AuditId":"597132.0-0-0-0-R","IfDone":[],"OfferPrice":17761,"QuoteId":null,"MarketId":400616114,"TradingAccountId":400302796,
"Applicability":"GTC","ExpiryDateTimeUTC":null,"AutoRollover":false,"Currency":null,
"LastChangedDateTimeUTC":null,"MarketName":"Wall Street DFT","PositionMethodId":1,"Status":null,"OrderId":0,"Direction":"buy","TriggerPrice":18000,
"OcoOrder":null,"Quantity":1,"ExpiryDateTimeUTCDate":null,"Type":null,
"LastChangedDateTimeUTCDate":null}
 

 

2) Yes, when submitting the NewStopLimitOrderRequestDTO you need to fill the BidPrice and OfferPrice when you submit. You are correct, subscribe to the LightStreamer PRICES stream for the market you are placing the order. Get the Bid and Offer prices from the stream.

 

 

3) Subscribe to the LightStreamer ORDERS stream to check for orders that have been filled. When a limit or stop order is filled, the ORDERS stream will send details. An example of what it looks like is:

 

0,1|||||||||\u005C/Date(1423494089000)\u005C/||17786.0|\u005C/Date(1423494083000)\u005C/

|||17786.0|||Open|

 

You said your orders haven't been filled after 2 days. How far away did you put the limit prices from the current market price? When you look at the chart for the market, has the market price actually reached your limit order level to trigger it? If the market price never touched your limit order level, then it will not trigger and fill. 

 

 

4) I'm not sure what you are trying to do with a CIAPI.dll file? Can you provide more information about what you are trying to do with the file? Also, where did you get the CIAPI.dll file?

 

I assume you are writing your own trading front-end, or a connector for a front-end that you want to interface to our back-end systems via the API? You shouldn't need to do anything with a dll file. All you need are the REST web services calls and Lightstreamer subscriptions for streaming prices, orders etc.

 

If you still require Q4 looked at, please reply with more details so I can work out what you are trying to do.

 

Thanks!

Share this post


Link to post

Thanks Physicsman, noted on your replies.

 

With regards to the last question No. 4

(The version of CIAPI.dll is 8.0.0.0 which doesn't have Reference parameter.)

 

I'm sorry, I just realised what I have posted doesn't state clearly what I mean.

 

What I mean is the NewStopLimitOrderRequestDTO object that I'm using doesn't have Reference parameter but when I check the API document on the website there is a Reference parameter.

I would like to attach my own reference/order number so that when I receive a response I will know which order should I update in my database.

Share this post


Link to post

Hi Zhan,

 

I understand your question now. I'm assuming that you are sending your REST web service calls to our LIVE environment at the following address: https://ciapi.cityindex.com/tradingapi??

 

If you are, then it will accept the Reference parameter in NewStopLimitOrderRequestDTO object.

 

The example POSTed NewStopLimitOrderRequestDTO I gave earlier has the Reference parameter in it, although it was sent as null in that case. 

 

You can fill this parameter with a string to help you identify your orders.

 

{"isTrade":false,"BidPrice":17760,"Reference":null,"AuditId":"597132.0-0-0-0-R",...}

 

 

Share this post


Link to post

Hi Physicsman,

 

Thanks for your reply, I understood the REST web service call.

 

I got another question when I'm using NewStopLimitOrderRequestDTO object VS 2010 C#

 

I declared

NewStopLimitOrderRequestDTO order = new NewStopLimitOrderRequestDTO();

order.Reference

 

This Reference instance variable is missing and I can't find it in object viewer

 

 

 

Hi Zhan,

 

I understand your question now. I'm assuming that you are sending your REST web service calls to our LIVE environment at the following address: https://ciapi.cityindex.com/tradingapi??

 

If you are, then it will accept the Reference parameter in NewStopLimitOrderRequestDTO object.

 

The example POSTed NewStopLimitOrderRequestDTO I gave earlier has the Reference parameter in it, although it was sent as null in that case. 

 

You can fill this parameter with a string to help you identify your orders.

 

{"isTrade":false,"BidPrice":17760,"Reference":null,"AuditId":"597132.0-0-0-0-R",...}

Share this post


Link to post

Hi Zhan,

 

I'd like to take one step back to get clear some details so that we are not talking at cross purposes, and thus confusing each other! :D 

 

Your code is interacting with our API via REST web service calls? That is, using the example of NewStopLimitOrderRequestDTO you are firing this order call with the Reference parameter to https://ciapi.cityindex.com/tradingapi??

 

I have sent a NewStopLimitOrderRequestDTO to the API with the Reference parameter " demo123" using the test harness and the API is accepting it fine. Additionally, our front end trading platforms also connect to our back end via the API, and they are sending order calls with a empty Reference parameter and again everything is fine.

 

Is your program code trying to interact in a different way with our API?

 

Thanks for the clarification.

Share this post


Link to post

Marking this thread as solved after private communication exchange.

 

Issues arising due to the use of an external CIAPI library rather than from a user created CIAPI library.

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
Sign in to follow this  
×