How to get the specific order ID that was filled?  [SOLVED]

Questions about MultiCharts .NET and user contributed studies.
User avatar
orad
Posts: 121
Joined: 14 Nov 2012
Has thanked: 50 times
Been thanked: 20 times

How to get the specific order ID that was filled?

Postby orad » 16 Jan 2015

Hi,

I can use the OnBrokerStategyOrderFilled method to get notified about an order that was filled at the broker. It tells me if the order was buy or sell, the quantity and average fill price, but how can I get the specific order ID, or reference to the Order object that was filled?
protected override void OnBrokerStategyOrderFilled(bool is_buy, int quantity, double avg_fill_price)
{
// what's the specific order ID that was filled?
}
Thanks!

User avatar
Henry MultiСharts
Posts: 9165
Joined: 25 Aug 2011
Has thanked: 1264 times
Been thanked: 2957 times

Re: How to get the specific order ID that was filled?

Postby Henry MultiСharts » 21 Jan 2015

Hello orad,

You can get the name and order ID using TradeManager - please see the Order members for TradeManager Namespace.

User avatar
orad
Posts: 121
Joined: 14 Nov 2012
Has thanked: 50 times
Been thanked: 20 times

Re: How to get the specific order ID that was filled?

Postby orad » 21 Jan 2015

Hi Henry,

I'm trying NOT to heuristically find the order that was filled (using current time or avg_fill_price for example), instead get a definite reference to the order that was filled. By looking at the collection of orders, how can I say which one is the one that I just got a notification for? What if I get multiple fill notifications? I know when I submit an order to a broker, they generate an ID for it and will show that in their "Orders and Positions" during the lifecycle of the order. Is there any way in MC.NET to use that ID to track the fill status of an order?

Thanks!

User avatar
Henry MultiСharts
Posts: 9165
Joined: 25 Aug 2011
Has thanked: 1264 times
Been thanked: 2957 times

Re: How to get the specific order ID that was filled?  [SOLVED]

Postby Henry MultiСharts » 22 Jan 2015

With TradeManager you can configure filters for different fields. You can use the attached code as a reference. In MultiCharts 9.1 we will add explicit methods for order control with the new auto trading / backtesting engine.
Attachments
TradeManagerFilters.pln
(2.06 KiB) Downloaded 1136 times

User avatar
orad
Posts: 121
Joined: 14 Nov 2012
Has thanked: 50 times
Been thanked: 20 times

Re: How to get the specific order ID that was filled?

Postby orad » 22 Jan 2015

Wonderful! I'm very happy with MultiCharts.NET and your great support. Keep up the good work. :)

User avatar
orad
Posts: 121
Joined: 14 Nov 2012
Has thanked: 50 times
Been thanked: 20 times

Re: How to get the specific order ID that was filled?

Postby orad » 13 Nov 2015

In MultiCharts 9.1 we will add explicit methods for order control with the new auto trading / backtesting engine.
Is this shipped or going to next release?

User avatar
Henry MultiСharts
Posts: 9165
Joined: 25 Aug 2011
Has thanked: 1264 times
Been thanked: 2957 times

Re: How to get the specific order ID that was filled?

Postby Henry MultiСharts » 16 Nov 2015

Hello orad,

Adding this functionality has been postponed. There is no ETA for it at the moment.
Please follow the corresponding feature request to get the latest updates: MC-1497.


Return to “MultiCharts .NET”