Port MT4 indicator

If you need an Indicator or Signal developed or translated from other language, please post all Indicator development REQUESTS to this section here.

Moderator: admin

Port MT4 indicator

Postby mmajidi » Sat Apr 03, 2010 1:05 pm

DEAR SIR ;
can you convert mq4 file to lua file?
if yes please convert following code to a LUA code .
thank you
Code: Select all
++++++++++++++++++++++++++++++++++++

#property copyright " "
#property link      " "

#property indicator_chart_window

string t0="23:29",t00="00:10",t1="03:29",t11="04:10",t2="07:29",t22="08:10";
string t3="11:29",t33="12:10",t4="15:29",t44="16:10",t5="19:29",t55="20:10";
extern int period=30;
string OutStr;
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
//---- indicators
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function                       |
//+------------------------------------------------------------------+
int deinit()
  {
//----
   Comment("");
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int start()
  {
//----
     string aaa;
aaa=TimeToStr(TimeCurrent(),TIME_MINUTES );
if ((aaa>="00:00"&&aaa<t00)||(aaa>t0&&aaa<="23:59")||(aaa>t1&&aaa<t11)||(aaa>t2&&aaa<t22)||(aaa>t3&&aaa<t33)||(aaa>t4&&aaa<t44)||(aaa>t5&&aaa<t55))
OutStr="\n\nTime = "+aaa+" ÊÇíã ããäæÚå ";
else
OutStr="\n\nTime = "+aaa+"   ÊÇíã ßÇÑí ÊÑíÏ ÂÒÇÏ";
//----
OutStr=OutStr+"\n-----------------------------------------";
   int i;
   double m,n;
   double  sum=0;

//----
for(i=1;i<=period;i++){
m+=High[i];
n+=Low[i];
}
sum=m-n;
 double   telorance=sum/period;
//----
   double ttoday=High[0]-Low[0];
if(ttoday>telorance)
OutStr=OutStr+"\nToday Telorance Is High = "+DoubleToStr(ttoday/Point,2)+"\nTelorance Is = "+DoubleToStr(telorance/Point,2);
else
OutStr=OutStr+"\nToday Telorance Is Low = "+DoubleToStr(ttoday/Point,2)+"\nTelorance Is = "+DoubleToStr(telorance/Point,2);


OutStr=OutStr+"\n-----------------------------------------";

   double i1;
   int m1,s1,k1;
   m1=Time[0]+Period()*60-CurTime();
   i1=m1/60.0;
   s1=m1%60;
   m1=(m1-m1%60)/60;
   OutStr=OutStr+"\n" +m1 + " minutes " + s1 + " seconds left to bar end";

Comment(OutStr);

   return(0);
  }
//+------------------------------------------------------------------+

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
mmajidi
 
Posts: 1
Joined: Sat Apr 03, 2010 12:58 pm

Re: Port MT4 indicator

Postby Nikolay.Gekht » Mon Apr 05, 2010 2:10 pm

moderation: The request is moved to an appropriate topic.

Could you please provide a bit more information about the indicator. At least a link to this indicator in the Internet.
Nikolay.Gekht
FXCodeBase: Site Admin
 
Posts: 1235
Joined: Wed Dec 16, 2009 6:39 pm
Location: Cary, NC


Return to Indicator and Signal Requests

Who is online

Users browsing this forum: Majestic-12 [Bot] and 32 guests