What is OCO Group?

Questions about MultiCharts and user contributed studies.
ppan
Posts: 106
Joined: 31 Jan 2007
Has thanked: 2 times

What is OCO Group?

Postby ppan » 28 Apr 2011

In broker setting, there is OCO group. What is it?
What is "use native oco group", "reduce size oco" and "overfill protection"?

User avatar
TJ
Posts: 6584
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 970 times
Been thanked: 1907 times

Re: What is OCO Group?

Postby TJ » 28 Apr 2011

ppan wrote:In broker setting, there is OCO group. What is it?
What is "use native oco group", "reduce size oco" and "overfill protection"?


OCO = One-Cancels-the-Other

eg.
you are long @100, you can enter a profit target @110 and a stop loss @90.

when your profit target is filled, the stop loss order is automatically cancelled.


see post #3
viewtopic.php?f=16&t=6929

User avatar
TJ
Posts: 6584
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 970 times
Been thanked: 1907 times

Re: What is OCO Group?

Postby TJ » 28 Apr 2011

Native OCO orders are generated by the broker and supported by the broker's server, instead of MultiCharts.

OCO complications

Complication arises when you have partial filled orders.

eg.
you are long 200 shares of XYZ,
your profit target is hit, but only 100 shares were filled.
What to do with the stop loss order?

3 things can happen:

1. The stop loss order is killed, leaving you long 100 shares with no protection.

2. Leaving the stop loss order there,
but if the market turns against you, the stop loss order could sell 200 shares for you, leaving you short 100 shares. (ie over filled)

3. reduce the stop loss size.
there are 2 ways to do this:
a) kill the order, then re-submit a new order with smaller size
[edit] your new order will be at the end of the queue, which can result in larger slippage.
b) amend the original order with reduced size
[edit] not all broker/exchange support "amend". Also, it takes time to amend, the latency can cause execution problem in a fast market.

ppan
Posts: 106
Joined: 31 Jan 2007
Has thanked: 2 times

Re: What is OCO Group?

Postby ppan » 29 Apr 2011

Thanks very much.

justmake
Posts: 42
Joined: 21 Dec 2010
Has thanked: 15 times
Been thanked: 1 time

Re: What is OCO Group?

Postby justmake » 10 May 2011

I encounter a problem which a stop order is executed twice more than intened:

assuming current in short position (marketposition=-1 )

Code: Select all

if MarketPosition=-1 then
begin
buytocover FROM ENTRY ("SE") next bar var1 stop; //stop 1
setstopposition;
setdollartrailing(900);      //stop 2
setpercenttrailing(1000,6);  //stop3
end;


I found the above short position was covered by dollartrailing stop order.
and then long positon is entered twice after that at broker (IB) while no long entry on the chart (async mode).

There are 3 stops for the Short position as in the code indicated. Does dollartrailing stop (stop 2) and percenttrailing stop order (stop 3) cancel each other if one is executed?
How about the buy stop order (stop 1)? how can i write it in Power language so that it will be canceled if one of the stop order is exected?

I use 5 min time frame chart, it seems to me what happend is the statment
"if MarketPosition=-1" is evaluated at the beginning of very 5 min, so if one of the stop is executed within 5 min finished. then the program still consider
marketposition=-1 and still executed 2 other stop orders and thus have 2 extra long entries.

Please let me know if this is true and how to avoid this problem.

thanks.

User avatar
TJ
Posts: 6584
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 970 times
Been thanked: 1907 times

Re: What is OCO Group?

Postby TJ » 10 May 2011

justmake wrote:I encounter a problem which a stop order is executed twice more than intened:

assuming current in short position (marketposition=-1 )

Code: Select all

if MarketPosition=-1 then
begin
buytocover FROM ENTRY ("SE") next bar var1 stop; //stop 1
setstopposition;
setdollartrailing(900);      //stop 2
setpercenttrailing(1000,6);  //stop3
end;


I found the above short position was covered by dollartrailing stop order.
and then long positon is entered twice after that at broker (IB) while no long entry on the chart (async mode).

There are 3 stops for the Short position as in the code indicated. Does dollartrailing stop (stop 2) and percenttrailing stop order (stop 3) cancel each other if one is executed?
How about the buy stop order (stop 1)? how can i write it in Power language so that it will be canceled if one of the stop order is exected?

I use 5 min time frame chart, it seems to me what happend is the statment
"if MarketPosition=-1" is evaluated at the beginning of very 5 min, so if one of the stop is executed within 5 min finished. then the program still consider
marketposition=-1 and still executed 2 other stop orders and thus have 2 extra long entries.

Please let me know if this is true and how to avoid this problem.

thanks.


not sure if this is the cause...
see post #3
viewtopic.php?f=16&t=6929


ps. you should save all the logs (both from IB and MC) for review.


Return to “MultiCharts”