Track the deal result from ExecuteMarketOrderAsync

Created at 21 May 2014, 18:05
How’s your experience with the cTrader Platform?
Your feedback is crucial to cTrader's development. Please take a few seconds to share your opinion and help us improve your trading experience. Thanks!
WJ

Wjack07

Joined 20.05.2014

Track the deal result from ExecuteMarketOrderAsync
21 May 2014, 18:05


Hi:

I am thinking to use  ExecuteMarketOrderAsync to place multiple orders at the same time, but also needs to monitor its executed results. Therefore I wrote something like this (but it doesnt work.) Any clue?

 

Order_Mark = ExecuteMarketOrderAsync(TradeType.Buy, m_symbol, m_volume);       

while (Order_Mark .IsExecuting )
{
             Print("waiting");
              Thread.Sleep(1000);
}

My idea is to check if the order is completed or not, but what I got is just endless "waiting", even if the order is already done (I can see that through the Journal)

Many thanks
Wjack07


@Wjack07
Replies

Spotware
22 May 2014, 09:20

cAlgo updates API objects between invocations of user's handlers.

While your code is executing cAlgo doesn't update any API objects. In next version of cAlgo we will add RefreshData() method. RefreshData() method will allow you to refresh state of all API objects explicitly. Probably next version of cAlgo will be released in couple of weeks.


@Spotware