History comparison

Created at 24 May 2020, 18:29
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!
TW

twoheartzin1soul

Joined 24.01.2020

History comparison
24 May 2020, 18:29


hello guys I need help, I need to compare the closing time of a position, with the current time, in the sense that: if the time of the position just closed in "history." it is different from the current tick time. place a new order i try this but it doesn't work

if (History.FindLast("Label_of_The_Bot").ClosingTime != Server.Time.Date)

{

execute order;

}


@twoheartzin1soul
Replies

PanagiotisCharalampous
25 May 2020, 08:38

Hi twoheartzin1soul,

It is not clear what the problem is but try using Server.Time instead.

Best Regards,

Panagiotis 

Join us on Telegram

 


@PanagiotisCharalampous

twoheartzin1soul
26 May 2020, 18:21

 

 


 

Thanks for the reply, the problem that 
History.FindLast (). Closingtime provides a given dd / mm / YYYY HH / Minutes 
Example:23/0/1999 12:30

instead Server.Time provides DD / MM / YYYY HH / MM / Seconds
example: 23/05/1999 12:30:15


 how could I make this comparison?

 

@twoheartzin1soul

PanagiotisCharalampous
27 May 2020, 08:33

Hi twoheartzin1soul,

I am not sure where you got there prints from but both types are DateTime types so comparison should not be a problem.

Best Regards,

Panagiotis 

Join us on Telegram


@PanagiotisCharalampous

twoheartzin1soul
28 May 2020, 04:07

ok ill try thanks a lot!!!


@twoheartzin1soul