Expayeray time

Created at 20 Oct 2021, 00:22
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!
EM

emmasystems

Joined 08.12.2015

Expayeray time
20 Oct 2021, 00:22


Please , is the right way to express the expire time of takeprofit before the order is closed or deleted.

var datetime = DateTime.Now.AddHours(5);
  PlaceLimitOrder(TradeType, Symbol, Volume, targetPrice, MyLabel, StopLossPips, TakeProfitPips, datetime )

{close pending()} or deletepending().

 


@emmasystems
Replies

amusleh
20 Oct 2021, 07:41

Hi,

There is no relation between take profit and pending orders expiry time.

To set expiry time you should use Server.Time not your system time (DateTime.Now).

You can find samples for placing/modifying/canceling pending orders here: cAlgo API Reference - PendingOrder Interface (ctrader.com)


@amusleh

emmasystems
20 Oct 2021, 12:39

RE:

amusleh said:

Hi,

There is no relation between take profit and pending orders expiry time.

To set expiry time you should use Server.Time not your system time (DateTime.Now).

You can find samples for placing/modifying/canceling pending orders here: cAlgo API Reference - PendingOrder Interface (ctrader.com)

(This is in reference to pending order  exipiration Time in which trade is deleted ,


@emmasystems

amusleh
21 Oct 2021, 09:38

RE: RE:

emmasystems said:

amusleh said:

Hi,

There is no relation between take profit and pending orders expiry time.

To set expiry time you should use Server.Time not your system time (DateTime.Now).

You can find samples for placing/modifying/canceling pending orders here: cAlgo API Reference - PendingOrder Interface (ctrader.com)

(This is in reference to pending order  exipiration Time in which trade is deleted ,

Hi,

Sorry, but I don't understand what you are looking for? test the cBot examples on API references.


@amusleh