How i get a Pending order Submitted Time

Created at 26 May 2016, 20:25
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!
Capilta's avatar

Capilta

Joined 01.10.2013

How i get a Pending order Submitted Time
26 May 2016, 20:25


Dear,

how i get my pending order submitted time. In the Pending Order Object i can't fine submitted time.

 

Please help me. Thanks

 


@Capilta
Replies

Jiri
26 May 2016, 21:40

I believe you can't. However, you can save the information into comment or expiration time.

DateTime expiration = Time.AddYears(1);
string comment = Time.ToString();

TradeResult order = PlaceLimitOrder(TradeType.Buy, Symbol, 1000, 1, "", null, null, expiration, comment);
if (order.IsSuccessful)
{
    DateTime orderExpiration = (DateTime)order.PendingOrder.ExpirationTime;
    DateTime timeFromExpiration = orderExpiration.AddYears(-1);
    Print("From expiration: " + timeFromExpiration);

    DateTime timeFromComment = DateTime.Parse(order.PendingOrder.Comment);
    Print("From comment: " + timeFromComment);
}

Log:

26/05/2016 18:39:31.984 | cBot "New cBot" was started successfully for EURUSD, h1.
26/05/2016 18:39:32.015 | Placing Limit Order to Buy 1000 EURUSD (Price: 1.00000, ExpireTime: 26/05/2017 18:39:32)
26/05/2016 18:39:32.155 | → Placing Limit Order to Buy 1000 EURUSD (Price: 1.00000, ExpireTime: 26/05/2017 18:39:32) SUCCEEDED, PendingOrder OID18905301
26/05/2016 18:39:32.155 | From expiration: 26/05/2016 18:39:32
26/05/2016 18:39:32.155 | From comment: 26/05/2016 18:39:32
26/05/2016 18:39:32.187 | cBot "New cBot" was stopped for EURUSD, h1.

 


@Jiri

fxwisdom1@gmail.com
30 May 2018, 13:32

RE:

tmc_ said:

I believe you can't. However, you can save the information into comment or expiration time.

DateTime expiration = Time.AddYears(1);
string comment = Time.ToString();

TradeResult order = PlaceLimitOrder(TradeType.Buy, Symbol, 1000, 1, "", null, null, expiration, comment);
if (order.IsSuccessful)
{
    DateTime orderExpiration = (DateTime)order.PendingOrder.ExpirationTime;
    DateTime timeFromExpiration = orderExpiration.AddYears(-1);
    Print("From expiration: " + timeFromExpiration);

    DateTime timeFromComment = DateTime.Parse(order.PendingOrder.Comment);
    Print("From comment: " + timeFromComment);
}

Log:

26/05/2016 18:39:31.984 | cBot "New cBot" was started successfully for EURUSD, h1.
26/05/2016 18:39:32.015 | Placing Limit Order to Buy 1000 EURUSD (Price: 1.00000, ExpireTime: 26/05/2017 18:39:32)
26/05/2016 18:39:32.155 | → Placing Limit Order to Buy 1000 EURUSD (Price: 1.00000, ExpireTime: 26/05/2017 18:39:32) SUCCEEDED, PendingOrder OID18905301
26/05/2016 18:39:32.155 | From expiration: 26/05/2016 18:39:32
26/05/2016 18:39:32.155 | From comment: 26/05/2016 18:39:32
26/05/2016 18:39:32.187 | cBot "New cBot" was stopped for EURUSD, h1.

 

It's a nice solution but not so elegant. Anyhow, thank you


@fxwisdom1@gmail.com