A trouble with GetIndexByExactTime

Created at 16 May 2020, 17:34
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!
LO

lordyy

Joined 24.03.2015

A trouble with GetIndexByExactTime
16 May 2020, 17:34


I want to get the index of the Position.Entrytime. 
But zhe value is -1. is there a way to do it?.I'm in a little bit of trouble with this.
Thanks a lot.

 

 

int rel = MarketData.GetBars(TimeFrame.Minute5).OpenTimes.GetIndexByExactTime(position.EntryTime);


cTrader Automate
@lordyy
Replies

PanagiotisCharalampous
18 May 2020, 09:12

Hi lordyy,

Did you try GetIndexByTime()?

Best Regards,

Panagiotis 

Join us on Telegram

 

 


@PanagiotisCharalampous

lordyy
18 May 2020, 11:16

RE:

PanagiotisCharalampous said:

Hi lordyy,

Did you try GetIndexByTime()?

Best Regards,

Panagiotis 

Join us on Telegram

 

 

Hi  PanagiotisCharalampous

GetIndexByTime()  is right.  I used the wrong function.  What does GetIndexByExactTime do.  thanks a lot 


@lordyy