In broker setting, there is OCO group. What is it?
What is "use native oco group", "reduce size oco" and "overfill protection"?
What is OCO Group?
- TJ
- Posts: 7740
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1033 times
- Been thanked: 2221 times
Re: What is OCO Group?
OCO = One-Cancels-the-OtherIn broker setting, there is OCO group. What is it?
What is "use native oco group", "reduce size oco" and "overfill protection"?
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
- TJ
- Posts: 7740
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1033 times
- Been thanked: 2221 times
Re: What is OCO Group?
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.
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.
Re: What is OCO Group?
I encounter a problem which a stop order is executed twice more than intened:
assuming current in short position (marketposition=-1 )
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.
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;
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.
- TJ
- Posts: 7740
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1033 times
- Been thanked: 2221 times
Re: What is OCO Group?
not sure if this is the cause...I encounter a problem which a stop order is executed twice more than intened:
assuming current in short position (marketposition=-1 )
I found the above short position was covered by dollartrailing stop order.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;
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.
see post #3
viewtopic.php?f=16&t=6929
ps. you should save all the logs (both from IB and MC) for review.