Need support to get value of last running trade open price

Created at 28 Aug 2017, 17:17
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!
HI

hiba7rain

Joined 20.07.2014

Need support to get value of last running trade open price
28 Aug 2017, 17:17


Hi, Need to know how to get the open price of last running trade for the purpose of cbot to execute next order I.e for buy need the cbot to open next buy trade only if current price is higher than last running buy trade open price by say 20 pips And for sell cbot to on next sell only if current price lower than last running sell trade opening price by 20 pips Thanks for the support

@hiba7rain
Replies

Spotware
28 Aug 2017, 17:23

Dear hiba7rain,

You can find this information in History which is a collection of Historical Trades

Best Regards,

cTrader Team


@Spotware

hiba7rain
28 Aug 2017, 21:01

Thanks but still can't get it
@hiba7rain

Spotware
29 Aug 2017, 08:55

Dear hiba7rain,

See a code sample below demonstrating how to get the entry price of the last trade.

var price = History.FindLast().EntryPrice;

Let us know if this is what you are looking for.

Best Regards,

cTrader Team


@Spotware

hiba7rain
30 Aug 2017, 17:02

Thanks for your support I'll check it
@hiba7rain