Jump to content
Sign in to follow this  
Vincent

Modify or remove an exisiting trade's stop or limit

Recommended Posts

Hi,

 

This is what I know so far, please correct me if I am wrong:

 

When openning a new trade, you use this API:

http://docs.labs.cityindex.com/#HTTP%20Services/Trade.htm%3FTocPath%3DCIAPI%2520Reference|HTTP%2520Services|Trades%2520and%2520Orders|_____12

 

When closing an existing trade, you use this API to open an trade with trade direction opposite to the existing trade and use the existing trade's order id for the "close" property.

http://docs.labs.cityindex.com/#HTTP%20Services/Trade.htm%3FTocPath%3DCIAPI%2520Reference|HTTP%2520Services|Trades%2520and%2520Orders|_____12

 

Here are the things I am not certain yet:

 

1. What is best way to modify an existing trade's stop or limit? For example, changing the stop level or limit level.

 

2. What is best way to remove an existing trade's stop or limit?

 

3. I noticed that a stop level is not compulsory on City Index platform. Is it true?

 

Thanks.

Share this post


Link to post

Hello Vincent,

 

Answers to your numbered queries follows:

 

1) To modify a stop loss or take profit limit order attached to an open trade then use the UpdateTrade method. http://docs.labs.cityindex.com/#HTTP Services/UpdateTrade.htm

 

2) To remove/delete an attached stop or limit order use the CancelOrder method. http://docs.labs.cityindex.com/#HTTP Services/CancelOrder.htm

 

3) Correct. You can open a trade without a stop attached. However, our risk systems uses a margin auto-closeout function. Large open losses will reduce your net equity, which is the funds available to cover the margin for open trades. 

 

If your margin level is at or below the margin close out level, we may close all or any of your open positions in markets that are open immediately and without notice at the next available 'our price'. 
 
We strongly recommend that you monitor your margin level carefully as you should not expect to receive a margin call or warning prior to closure. 
 
To find out more about the margin close out level, please refer to Section 11 of our Terms and Policies http://www.filesandimages.com/Brand/CityIndex/PDF/CI-100120013001-General-Terms-Published-10.01.12.pdf.

 

 

Share this post


Link to post

Hi,

 

1) For UpdateTrade method (http://docs.labs.cit...UpdateTrade.htm), it asks for an UpdateTradeOrderRequestDTO (which inherits NewTradeOrderRequestDTO). Is it mean if I want to update a limit level of an existing trade, I need to get that trade info and convert it into UpdateTradeOrderRequestDTO. Then update its Limit ApiStopLimitOrderDTO.TriggerPrice and sent it back through UpdateTrade method (http://docs.labs.cit...UpdateTrade.htm).

 

2) Can CancelOrder method be use to cancel an "order" as well?

 

Thanks.

Share this post


Link to post

Hi,

 

1) You can use the ListActiveStopLimitOrders method (http://docs.labs.cityindex.com/#HTTP Services/ListActiveStopLimitOrders.htm), to retrieve all your active stop/limit order information. Parse the data for the order you want to update into UpdateTradeOrderRequestDTO then update the TriggerPrice as required.  POST using UpdateTrade method. 

 

2) Do you mean resting entry orders? Then yes, CancelOrder method is used to delete attached stop loss, take profit limit orders AND resting Stop or Limit entry orders. 

 

Tip!

A good way to figure out how to use the API is via the Firefox browser with Firebug plugin, or Chrome browser with the Developer Tools. Use your account credentials to login to our web platform "Advantage Web" (https://trade.loginandtrade.com/advantageweb/home.html?ts=1417089543178#). 

 

Perform various operations, such as placing a trade, adding stops/limits, modifying then cancelling these orders etc. The Firebug or Developer Tools plugins show all the API calls made for each action so you can emulate it in your program to perform the same action. 

 

All of our front end trading platforms use the CIAPI to interface with our back-end servers. 

 

Hope that helps!  :)

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  
×