Cancel orders

Questions about MultiCharts and user contributed studies.
User avatar
Posts: 61
Joined: 26 Feb 2011
Location: Sweden
Has thanked: 8 times
Been thanked: 8 times

Cancel orders

Postby larssan » 19 Oct 2011


In a auto trading code I sometimes move working orders.
For example in a trailing stop:

Code: Select all

var0 = LowestFC( Low, 5 ) ;
Sell ( "ChTrLX" ) next bar at var0 stop ;

This works fine most of the time but in one specific market it's not possible to move orders.
So in order to get the same result as in the code above you would need to cancel the working order and create a new one at the latest level.

So, my question is if it's possible to code that ?

Something like:

Code: Select all

var0 = LowestFC( Low, 5 ) ;
If var0[0] <> var[1] then "cancel order"
Sell ( "ChTrLX" ) next bar at var0 stop ;

Cheers, Lars

User avatar
Henry MultiСharts
Posts: 8479
Joined: 25 Aug 2011
Has thanked: 1211 times
Been thanked: 2720 times

Re: Cancel orders

Postby Henry MultiСharts » 20 Oct 2011

Hello Lars.
Unfortunately that is not possible to cancel the order from the script.
If the order was not filled-it will be cancelled on the next recalculation.
You can either send the order again or not.

Return to “MultiCharts”