iTime

Dec 12, 2012 at 7:48 PM

Can I use iTime method?

I did the following, bu didn't worked.

public static DateTime iTime(this MqlHandler handler, string symbol, TIME_FRAME timeframe, int shift)
        {
            string retrunValue = handler.CallMqlMethod("iTime", symbol, ((int)timeframe), shift);

            return Convertor.ToDateTime(retrunValue);
        }

 

Dec 12, 2012 at 8:23 PM

Nevermind, works now!!!

Dec 12, 2012 at 8:24 PM

More I work with it more I like it!!!

Greate job!!!

Dec 12, 2012 at 8:30 PM

Please make a habbit of sharing how you solved your issue, it may help other people out.

Dec 13, 2012 at 12:54 AM
Edited Dec 13, 2012 at 12:59 AM

Add to TechnicalIndicators.cs in API project following code:

public static DateTime iTime(this MqlHandler handler, string symbol, TIME_FRAME timeframe, int shift) 
{ 
  string retrunValue = handler.CallMqlMethod("iTime", symbol, ((int)timeframe), shift); 
  return Convertor.ToDateTime(retrunValue); 
}

Then edit file [Terminal path]\experts\include\System_NET_MQL.mqh by adding to System_NET_MQL_TechIndicators  following code:

string System_NET_MQL_TechIndicators(string message[])
{
	//Add this to use iTime
	if(message[1] == "iTime")
	return(
		TimeToStr(iTime(message[2], 
			StrToInteger(message[3]), 
			StrToInteger(message[4])), TIME_DATE) + " " + 
	    TimeToStr(iTime(message[2], 
			StrToInteger(message[3]), 
			StrToInteger(message[4])), TIME_SECONDS));

Open [Terminal path]\experts\Expert_NET.mq4 in MQL Editor and compile it.