PL Code to Cancel Pending Orders Needed

Questions about MultiCharts and user contributed studies.
sptrader
Posts: 742
Joined: 09 Apr 2010
Location: Texas
Has thanked: 483 times
Been thanked: 274 times
Contact:

PL Code to Cancel Pending Orders Needed

Postby sptrader » 30 Jun 2016

Is there a function to "Cancel all pending orders for a strategy" ? (using IB broker)..
I enter a position manually and exit with an auto strategy , it works great but pending orders are not cancelled..(stops, limit orders etc.)..
* How can I cancel all pending orders (after the position is closed with a profit or loss) with PL code ?
Last edited by sptrader on 05 Jul 2016, edited 1 time in total.

User avatar
Smoky
Posts: 507
Joined: 03 Dec 2010
Location: Thailand
Has thanked: 97 times
Been thanked: 115 times

Re: PL to cancel pending orders

Postby Smoky » 01 Jul 2016

Maybe with MC10 ...

IB API send back to MC all status order, auto-trading and manual order.

make this test. open MC with IB connected, use IB workstation to send yours trades, you will see them on MC !

waiting for new order engine too ;-)

tony
Posts: 420
Joined: 14 Jun 2013
Has thanked: 30 times
Been thanked: 81 times
Contact:

Re: PL to cancel pending orders

Postby tony » 01 Jul 2016

Is there a function to "Cancel all pending orders for a strategy" ? (using IB broker)..
I enter a position manually and exit with an auto strategy , it works great but pending orders are not cancelled..(stops, limit orders etc.)..
* How can I cancel all pending orders (after the position is closed with a profit or loss) with PL code ?
It would be helpful to see your code. There should be a reference to market position in your signal where these pending orders are generated. When your signal is calculated after you are flat so now MP=0 and the signal says MP<>0 then that statement is false and the orders should be cancelled.

sptrader
Posts: 742
Joined: 09 Apr 2010
Location: Texas
Has thanked: 483 times
Been thanked: 274 times
Contact:

Re: PL to cancel pending orders

Postby sptrader » 01 Jul 2016

Is there a function to "Cancel all pending orders for a strategy" ? (using IB broker)..
I enter a position manually and exit with an auto strategy , it works great but pending orders are not cancelled..(stops, limit orders etc.)..
* How can I cancel all pending orders (after the position is closed with a profit or loss) with PL code ?
It would be helpful to see your code. There should be a reference to market position in your signal where these pending orders are generated. When your signal is calculated after you are flat so now MP=0 and the signal says MP<>0 then that statement is false and the orders should be cancelled.
************************************************************
Tony: I generate the open orders using "chart trader" in MC...(example, limit order below current position, trying to get lower basis on the position, profit target hit before limit order, so position is closed but limit order remains on chart and on IB.)..


Return to “MultiCharts”