Cancel order if condition is not met any longer

Questions about MultiCharts and user contributed studies.
raven
Posts: 31
Joined: 17 Oct 2009
Been thanked: 1 time

Cancel order if condition is not met any longer

Postby raven » 13 Aug 2010

An order is placed (tick chart) but not filled and some time later a condition isn’t met any longer – how to cancel this order?

Simplified Example (tick chart):

Code: Select all

var: counter(0) ;

condition1 = ... ;
if condition1 then counter = 1 ;

condition2 = counter = 0 ;
if condition2 then buy 1 contract next bar openD(0) + 5 points limit ;
In such a case MC places the limit order and doesn’t care, if later counter changes to 1 (order stays valid or is even filled).

Any help is very much appreciated. Thank you.

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

Re: Cancel order if condition is not met any longer

Postby TJ » 10 Jun 2011

An order is placed (tick chart) but not filled and some time later a condition isn’t met any longer – how to cancel this order?

Simplified Example (tick chart):

Code: Select all

var: counter(0) ;

condition1 = ... ;
if condition1 then counter = 1 ;

condition2 = counter = 0 ;
if condition2 then buy 1 contract next bar openD(0) + 5 points limit ;
In such a case MC places the limit order and doesn’t care, if later counter changes to 1 (order stays valid or is even filled).

Any help is very much appreciated. Thank you.

Assuming IOG is not enabled,

The strategy is evaluated at the EOB (End of Bar),
if the condition is met, the order is sent at the beginning of next bar.
The order is good for the next bar only.
The order will be automatically withdrawn if it is not filled by the end of the bar.

The evaluation will repeat itself at the end of the bar.


Return to “MultiCharts”