Tick data and GetIndexByExactTime

Created at 08 Jul 2015, 16:11
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!
AY

aysos75

Joined 28.09.2013

Tick data and GetIndexByExactTime
08 Jul 2015, 16:11




In this code when 
 marketSerieGlobal = MarketData.GetSeries(t1);

		public bool IsLongSignal(int index)
		{
			int globalIndex = marketSerieGlobal.OpenTime.GetIndexByExactTime(MarketSeries.OpenTime[index]);

			return isGlobalTrendRising(globalIndex) && isLocalTrendRising(index); 
		}

IsLongSignal(index) alway return -1 ?

How to solve this issue ? I want to know the index in a h1 timeframe from an index in a t1 timeframe (tick).

 


@aysos75
Replies

Spotware
08 Jul 2015, 16:44

Dear Trader,

We do not provide coding assistance services. We more than glad to assist you with specific questions about cAlgo.API. You also can contact one of our Partners or post a job in Development Jobs section for further coding assistance.

 


@Spotware

aysos75
08 Jul 2015, 22:14

the problem is that returns GetIndexByExactTime = =1 if it does not find an exact match ( at a second close ) . Just use GetIndexByTime that if it does not find an exact match returns the index of the previous candle

@aysos75