Can't close postions "Not currently long..."

Hi, admin

I have created a new sytem and I tested position open and close action.

position opening is working well.

But position closing action does not work properly even if i have a long position.

I got the error message like this.




<errortype>Can’t enter STC - Not currently long</errortype>

<comment><![CDATA[You can’t enter an order to Sell To Close (STC) because you do not have a long position in IBM.

If you want to enter a STC, make it conditional on a not-yet-executed STO order. C2CONDITIONALLINK]]></comment>


Fyi, this is my test link. password and system id are correct.



What do i wrong here ?

Please help me out.

Best regards



You are not currently long.

You have a Buy To open (BTO) order working at the time I write this (and the time you tried to submit a STC), but you do not at this moment have a long position. Thus an order to Sell To Close at market can’t be submitted.

If you want to enter an order to Sell To Close (that is, an order to close your long position) before the markets are open, and before your first order to open the long is executed, then you must make your Sell To Close order conditional upon the first Buy To Open. In other words, you need to say, “When the first Buy order is executed, then please make this order start working.”

Thank you for your reply.

I have a question now.

Can you please explain more clearly about this?

"you must make your Sell To Close order conditional upon the first Buy To Open"

I have no idea what does it means. sorry

Best regards

If you are using the API, you can learn the technical specs for specifying conditional orders in the API docs.

For a more general education about what we mean by “conditional orders” (essentially, orders that do not start “working” until after another, specific order is filled), you can see a fabulous video, featuring my melodious voice, by going to the Order Entry screen, and clicking Order Entry Help at the bottom of the order entry ticket. Then select the video about "conditional orders."

Main summary: You need to tell C2 that your closing order is “conditional on” the opening order being filled. It’s usually as simple as specifying a



These are not needed in cases where you use the “all in one” order entry command specifying both the entry and the exits in one API command.



Actually I have skipped description for conditional order.

Now I understood what is conditional order.