cancel order

Questions about MultiCharts and user contributed studies.
HummerH1
Posts: 66
Joined: 13 Sep 2011
Has thanked: 6 times
Been thanked: 1 time

cancel order

Postby HummerH1 » 05 Nov 2011

Hello

Is there a command I can use to cancel all orders or limit orders ive send to my broker?

User avatar
TJ
Posts: 7740
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 1033 times
Been thanked: 2221 times

Re: cancel order

Postby TJ » 05 Nov 2011

Hello

Is there a command I can use to cancel all orders or limit orders ive send to my broker?
Where do you want to use this command?

I assume you are looking for an EasyLanguage reserved word in a strategy and not a button to push in a panic while in manual chart trading.

In a strategy, when the condition is not met, you don't send the order.
If there is no order, there is nothing to be cancelled.

If you think your scenario MIGHT change intra-bar,
then use IntraBarOrderGeneration for your strategy.


To get a good foundation on creating strategies,
I would suggest you to read up on the ebook
The essential EasyLanguage programming guide

Another good book is
Getting Started with EasyLanguage
This book is not available anymore, but if you Google the web, you can still find a copy archived somewhere.

HummerH1
Posts: 66
Joined: 13 Sep 2011
Has thanked: 6 times
Been thanked: 1 time

Re: cancel order

Postby HummerH1 » 06 Nov 2011

Thanks
Ive read that.

Yes, it is in my strategies, using EL.

I'm sending limit orders to my broker.
Let say at 14:15 i close all my orders.

If the condition is not met until then, Id like to cancel it - so as if the condition is met after 14:15 it will not become an active order

When trading on a DOM window, there's a button doing that....

User avatar
TJ
Posts: 7740
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 1033 times
Been thanked: 2221 times

Re: cancel order

Postby TJ » 06 Nov 2011

Thanks
Ive read that.

Yes, it is in my strategies, using EL.

I'm sending limit orders to my broker.
Let say at 14:15 i close all my orders.

If the condition is not met until then, Id like to cancel it - so as if the condition is met after 14:15 it will not become an active order

When trading on a DOM window, there's a button doing that....
what is your symbol?
what is your chart resolution?
what is your session time?

HummerH1
Posts: 66
Joined: 13 Sep 2011
Has thanked: 6 times
Been thanked: 1 time

Re: cancel order

Postby HummerH1 » 06 Nov 2011

how all this related?

My symbol: E mini S&P500
Session: CME combined
chart resolution 15 mins with intrabargeneration

User avatar
TJ
Posts: 7740
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 1033 times
Been thanked: 2221 times

Re: cancel order

Postby TJ » 06 Nov 2011

Thanks
Ive read that.

Yes, it is in my strategies, using EL.

I'm sending limit orders to my broker.
Let say at 14:15 i close all my orders.

If the condition is not met until then, Id like to cancel it - so as if the condition is met after 14:15 it will not become an active order

When trading on a DOM window, there's a button doing that....
try this:

Code: Select all

if time < 1415 then
begin

{----- put your trading logic here -----}

end;

HummerH1
Posts: 66
Joined: 13 Sep 2011
Has thanked: 6 times
Been thanked: 1 time

Re: cancel order

Postby HummerH1 » 06 Nov 2011

Thanks.
I have done that.

But if before 14:15 ive sent a limit order
and the price is reached after 14:15, the order will be executed.... and i want to cancel that

User avatar
TJ
Posts: 7740
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 1033 times
Been thanked: 2221 times

Re: cancel order

Postby TJ » 06 Nov 2011

Thanks.
I have done that.

But if before 14:15 ive sent a limit order
and the price is reached after 14:15, the order will be executed.... and i want to cancel that
For non-IOG strategies:
Your order is only good for ONE bar.
MultiCharts evaluates your logic at the end of each bar.
If the condition meets your logic, the order is sent at the open of the next bar.
If the order is not filled at the end of next bar, and the condition is no longer met,
the order will expire. (ie. it will be automatically cancelled).

For IOG strategies:
Your order is only good for ONE tick.
MultiCharts evaluates your logic every tick.
If the condition meets your logic, the order is sent at the next tick (intrabar).
If the order is not filled at the next tick, and the condition is no longer met, the order will expire. (ie it will be automatically cancelled).
If the condition of the order still stands, the order will remain until it no longer meets the trading criteria.

Yohyon
Posts: 10
Joined: 03 Dec 2018
Has thanked: 1 time

Re: cancel order

Postby Yohyon » 19 Oct 2022

I read the response of TJ. Is it correct that this does not apply to a STP LMT order in the same way? When I sent a STP LMT order and I revise it at the beginning of the next bar (because my buyprice calculation has changed) I recieve an error message from IB: "Order rejected - reason: Stop price revision is disallowed after order has triggered."


Return to “MultiCharts”