translate mql in lua...?

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

translate mql in lua...?

Postby boursicoton » Thu Aug 19, 2010 4:37 pm

Code: Select all
#property indicator_chart_window
#property indicator_buffers 1
#property indicator_color1 White

double g_ibuf_76[];

int init() {
   IndicatorShortName("MoneyLine v1.2");
   SetIndexBuffer(0, g_ibuf_76);
   SetIndexLabel(0, "Yellow Bar v1.2");
   SetIndexDrawBegin(0, 1);
   SetIndexStyle(0, DRAW_LINE, STYLE_DOT, 1, White);
   return (0);
}

int deinit() {
   return (0);
}

int start() {
   int li_4 = IndicatorCounted();
   if (li_4 < 0) return (-1);
   if (li_4 > 0) li_4--;
   int li_0 = Bars - li_4;
   for (int li_8 = 0; li_8 < li_0; li_8++) g_ibuf_76[li_8] = iMA(NULL, 0, 89, 0, MODE_LWMA, PRICE_CLOSE, li_8);
   return (0);
}

similar to mme 40 ? i'm not sure....but interesting with next post...
boursicoton
FXCodeBase: Confirmed User
 
Posts: 78
Joined: Sat Feb 06, 2010 1:33 pm

Re: translate mql in lua...? brooky

Postby boursicoton » Thu Aug 19, 2010 4:38 pm

Code: Select all
#property indicator_separate_window
#property indicator_buffers 2
#property indicator_color1 C'47,47,47'
#property indicator_color2 DodgerBlue
#property indicator_width1 1
#property indicator_width2 2
#property indicator_level1 0
#property indicator_maximum 10
#property indicator_minimum -10

extern string Author_Site = "Forex-Indicators.weebly.com";
extern string Major_USD = "Usd as Major 3 Pairs";
extern string maj_pair1 = "USDCHF";
extern string maj_pair2 = "USDJPY";
extern string maj_pair3 = "USDCAD";
extern string Minor_USD = "Usd as Minor 4 Pairs";
extern string min_pair1 = "AUDUSD";
extern string min_pair2 = "EURUSD";
extern string min_pair3 = "GBPUSD";
extern string min_pair4 = "NZDUSD";
extern string Checking_MAs = "Fast v Slow Checks";
extern int slow_check_ma = 55;
extern int fast_check_ma = 34;
extern string Data_Smoothie = "Smoothing Line";
extern int sig_smooth = 15;
extern string Checking_TF = "Timeframe 0 is current";
extern int check_tf = 0;
//--string to call for iCustom--+
//double val=iCustom(NULL, 0, "Brooky_USD_Strength",".",".","USDCHF","USDJPY","USDCAD",".","AUDUSD","EURUSD","GBPUSD","NZDUSD",".",55,34,".",15,".",0,1,0);

//---- buffers
double data_buffer[];
double sig_buffer[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
//---- indicators


   SetIndexBuffer(0,data_buffer);SetIndexStyle(0,DRAW_LINE);
   
   SetIndexStyle(1,DRAW_LINE);SetIndexBuffer(1,sig_buffer);
//---- name for DataWindow and indicator subwindow label
   IndicatorShortName("forex-indicators.weebly.com "
                       +"(USD Strength Effect)"
                        );   

//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function                       |
//+------------------------------------------------------------------+
int deinit()
  {
//----
   
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
  int start()
    {
     int limit;
     int counted_bars=IndicatorCounted();
  //---- check for possible errors
     if(counted_bars<0) return(-1);
  //---- the last counted bar will be recounted
     if(counted_bars>0) counted_bars--;
     limit=Bars-counted_bars;
  //---- main loop
     for(int i=0; i<limit; i++)
       {
      int c1=0,c2=0,c3=0,c4=0,c5=0,c6=0,c7=0;
      double multiplier = -1.4285714285714285714285714285714;
  //-- USD Majors --+         
      //--Pair 1--+
      if(iMA(maj_pair1,check_tf,fast_check_ma,0,MODE_LWMA,PRICE_CLOSE,i)
         >iMA(maj_pair1,check_tf,slow_check_ma,0,MODE_LWMA,PRICE_CLOSE,i)
         && iMA(maj_pair1,check_tf,fast_check_ma,0,MODE_LWMA,PRICE_CLOSE,i)
         >iMA(maj_pair1,check_tf,fast_check_ma,0,MODE_LWMA,PRICE_CLOSE,i+1))
           c1=1 ;
      if(iMA(maj_pair1,check_tf,fast_check_ma,0,MODE_LWMA,PRICE_CLOSE,i)
         >iMA(maj_pair1,check_tf,slow_check_ma,0,MODE_LWMA,PRICE_CLOSE,i)
         && iMA(maj_pair1,check_tf,fast_check_ma,0,MODE_LWMA,PRICE_CLOSE,i)
         <iMA(maj_pair1,check_tf,fast_check_ma,0,MODE_LWMA,PRICE_CLOSE,i+1))
           c1=0.5 ;           
           
      if(iMA(maj_pair1,check_tf,fast_check_ma,0,MODE_LWMA,PRICE_CLOSE,i)
         <iMA(maj_pair1,check_tf,slow_check_ma,0,MODE_LWMA,PRICE_CLOSE,i)
         && iMA(maj_pair1,check_tf,fast_check_ma,0,MODE_LWMA,PRICE_CLOSE,i)
         <iMA(maj_pair1,check_tf,fast_check_ma,0,MODE_LWMA,PRICE_CLOSE,i+1))
           c1=-1 ;

      if(iMA(maj_pair1,check_tf,fast_check_ma,0,MODE_LWMA,PRICE_CLOSE,i)
         <iMA(maj_pair1,check_tf,slow_check_ma,0,MODE_LWMA,PRICE_CLOSE,i)
         && iMA(maj_pair1,check_tf,fast_check_ma,0,MODE_LWMA,PRICE_CLOSE,i)
         >iMA(maj_pair1,check_tf,fast_check_ma,0,MODE_LWMA,PRICE_CLOSE,i+1))
           c1=-0.5 ;
                     
      if(iMA(maj_pair1,check_tf,fast_check_ma,0,MODE_LWMA,PRICE_CLOSE,i)
         ==iMA(maj_pair1,check_tf,slow_check_ma,0,MODE_LWMA,PRICE_CLOSE,i))
           c1=0 ;
           
      //--Pair 2--+
      if(iMA(maj_pair2,check_tf,fast_check_ma,0,MODE_LWMA,PRICE_CLOSE,i)
         >iMA(maj_pair2,check_tf,slow_check_ma,0,MODE_LWMA,PRICE_CLOSE,i)
         && iMA(maj_pair2,check_tf,fast_check_ma,0,MODE_LWMA,PRICE_CLOSE,i)
         >iMA(maj_pair2,check_tf,fast_check_ma,0,MODE_LWMA,PRICE_CLOSE,i+1))
           c2=1 ;
      if(iMA(maj_pair2,check_tf,fast_check_ma,0,MODE_LWMA,PRICE_CLOSE,i)
         >iMA(maj_pair2,check_tf,slow_check_ma,0,MODE_LWMA,PRICE_CLOSE,i)
         && iMA(maj_pair2,check_tf,fast_check_ma,0,MODE_LWMA,PRICE_CLOSE,i)
         <iMA(maj_pair2,check_tf,fast_check_ma,0,MODE_LWMA,PRICE_CLOSE,i+1))
           c2=0.5 ;           
           
      if(iMA(maj_pair2,check_tf,fast_check_ma,0,MODE_LWMA,PRICE_CLOSE,i)
         <iMA(maj_pair2,check_tf,slow_check_ma,0,MODE_LWMA,PRICE_CLOSE,i)
         && iMA(maj_pair2,check_tf,fast_check_ma,0,MODE_LWMA,PRICE_CLOSE,i)
         <iMA(maj_pair2,check_tf,fast_check_ma,0,MODE_LWMA,PRICE_CLOSE,i+1))
           c2=-1 ;
           
      if(iMA(maj_pair2,check_tf,fast_check_ma,0,MODE_LWMA,PRICE_CLOSE,i)
         <iMA(maj_pair2,check_tf,slow_check_ma,0,MODE_LWMA,PRICE_CLOSE,i)
         && iMA(maj_pair2,check_tf,fast_check_ma,0,MODE_LWMA,PRICE_CLOSE,i)
         >iMA(maj_pair2,check_tf,fast_check_ma,0,MODE_LWMA,PRICE_CLOSE,i+1))
           c2=-0.5 ;
           
                     
      if(iMA(maj_pair2,check_tf,fast_check_ma,0,MODE_LWMA,PRICE_CLOSE,i)
         ==iMA(maj_pair2,check_tf,slow_check_ma,0,MODE_LWMA,PRICE_CLOSE,i))
           c2=0 ;
               
      //--Pair 3--+
      if(iMA(maj_pair3,check_tf,fast_check_ma,0,MODE_LWMA,PRICE_CLOSE,i)
         >iMA(maj_pair3,check_tf,slow_check_ma,0,MODE_LWMA,PRICE_CLOSE,i)
         && iMA(maj_pair3,check_tf,fast_check_ma,0,MODE_LWMA,PRICE_CLOSE,i)
         >iMA(maj_pair3,check_tf,fast_check_ma,0,MODE_LWMA,PRICE_CLOSE,i+1))
           c3=1 ;
      if(iMA(maj_pair3,check_tf,fast_check_ma,0,MODE_LWMA,PRICE_CLOSE,i)
         >iMA(maj_pair3,check_tf,slow_check_ma,0,MODE_LWMA,PRICE_CLOSE,i)
         && iMA(maj_pair3,check_tf,fast_check_ma,0,MODE_LWMA,PRICE_CLOSE,i)
         <iMA(maj_pair3,check_tf,fast_check_ma,0,MODE_LWMA,PRICE_CLOSE,i+1))
           c3=0.5 ;
                     
      if(iMA(maj_pair3,check_tf,fast_check_ma,0,MODE_LWMA,PRICE_CLOSE,i)
         <iMA(maj_pair3,check_tf,slow_check_ma,0,MODE_LWMA,PRICE_CLOSE,i)
         && iMA(maj_pair3,check_tf,fast_check_ma,0,MODE_LWMA,PRICE_CLOSE,i)
         <iMA(maj_pair3,check_tf,fast_check_ma,0,MODE_LWMA,PRICE_CLOSE,i+1))
           c3=-1 ;
      if(iMA(maj_pair3,check_tf,fast_check_ma,0,MODE_LWMA,PRICE_CLOSE,i)
         <iMA(maj_pair3,check_tf,slow_check_ma,0,MODE_LWMA,PRICE_CLOSE,i)
         && iMA(maj_pair3,check_tf,fast_check_ma,0,MODE_LWMA,PRICE_CLOSE,i)
         >iMA(maj_pair3,check_tf,fast_check_ma,0,MODE_LWMA,PRICE_CLOSE,i+1))
           c3=-0.5 ;
                     
      if(iMA(maj_pair3,check_tf,fast_check_ma,0,MODE_LWMA,PRICE_CLOSE,i)
         ==iMA(maj_pair3,check_tf,slow_check_ma,0,MODE_LWMA,PRICE_CLOSE,i))
           c3=0 ;
           
 //-- USD Minors --+         
      //--Pair 4--+
      if(iMA(min_pair1,check_tf,fast_check_ma,0,MODE_LWMA,PRICE_CLOSE,i)
         >iMA(min_pair1,check_tf,slow_check_ma,0,MODE_LWMA,PRICE_CLOSE,i)
         && iMA(min_pair1,check_tf,fast_check_ma,0,MODE_LWMA,PRICE_CLOSE,i)
         >iMA(min_pair1,check_tf,fast_check_ma,0,MODE_LWMA,PRICE_CLOSE,i+1))
           c4=-1 ;
      if(iMA(min_pair1,check_tf,fast_check_ma,0,MODE_LWMA,PRICE_CLOSE,i)
         >iMA(min_pair1,check_tf,slow_check_ma,0,MODE_LWMA,PRICE_CLOSE,i)
         && iMA(min_pair1,check_tf,fast_check_ma,0,MODE_LWMA,PRICE_CLOSE,i)
         <iMA(min_pair1,check_tf,fast_check_ma,0,MODE_LWMA,PRICE_CLOSE,i+1))
           c4=-0.5 ;
                     
      if(iMA(min_pair1,check_tf,fast_check_ma,0,MODE_LWMA,PRICE_CLOSE,i)
         <iMA(min_pair1,check_tf,slow_check_ma,0,MODE_LWMA,PRICE_CLOSE,i)
         && iMA(min_pair1,check_tf,fast_check_ma,0,MODE_LWMA,PRICE_CLOSE,i)
         <iMA(min_pair1,check_tf,fast_check_ma,0,MODE_LWMA,PRICE_CLOSE,i+1))
           c4=1 ;
      if(iMA(min_pair1,check_tf,fast_check_ma,0,MODE_LWMA,PRICE_CLOSE,i)
         <iMA(min_pair1,check_tf,slow_check_ma,0,MODE_LWMA,PRICE_CLOSE,i)
         && iMA(min_pair1,check_tf,fast_check_ma,0,MODE_LWMA,PRICE_CLOSE,i)
         >iMA(min_pair1,check_tf,fast_check_ma,0,MODE_LWMA,PRICE_CLOSE,i+1))
           c4=0.5 ;
                     
      if(iMA(min_pair1,check_tf,fast_check_ma,0,MODE_LWMA,PRICE_CLOSE,i)
         ==iMA(min_pair1,check_tf,slow_check_ma,0,MODE_LWMA,PRICE_CLOSE,i))
           c4=0 ;
           
      //--Pair 5--+
      if(iMA(min_pair2,check_tf,fast_check_ma,0,MODE_LWMA,PRICE_CLOSE,i)
         >iMA(min_pair2,check_tf,slow_check_ma,0,MODE_LWMA,PRICE_CLOSE,i)
         && iMA(min_pair2,check_tf,fast_check_ma,0,MODE_LWMA,PRICE_CLOSE,i)
         >iMA(min_pair2,check_tf,fast_check_ma,0,MODE_LWMA,PRICE_CLOSE,i+1))
           c5=-1 ;
      if(iMA(min_pair2,check_tf,fast_check_ma,0,MODE_LWMA,PRICE_CLOSE,i)
         >iMA(min_pair2,check_tf,slow_check_ma,0,MODE_LWMA,PRICE_CLOSE,i)
         && iMA(min_pair2,check_tf,fast_check_ma,0,MODE_LWMA,PRICE_CLOSE,i)
         <iMA(min_pair2,check_tf,fast_check_ma,0,MODE_LWMA,PRICE_CLOSE,i+1))
           c5=-0.5 ;         
      if(iMA(min_pair2,check_tf,fast_check_ma,0,MODE_LWMA,PRICE_CLOSE,i)
         <iMA(min_pair2,check_tf,slow_check_ma,0,MODE_LWMA,PRICE_CLOSE,i)
         && iMA(min_pair2,check_tf,fast_check_ma,0,MODE_LWMA,PRICE_CLOSE,i)
         <iMA(min_pair2,check_tf,fast_check_ma,0,MODE_LWMA,PRICE_CLOSE,i+1))
           c5=1 ;
      if(iMA(min_pair2,check_tf,fast_check_ma,0,MODE_LWMA,PRICE_CLOSE,i)
         <iMA(min_pair2,check_tf,slow_check_ma,0,MODE_LWMA,PRICE_CLOSE,i)
         && iMA(min_pair2,check_tf,fast_check_ma,0,MODE_LWMA,PRICE_CLOSE,i)
         >iMA(min_pair2,check_tf,fast_check_ma,0,MODE_LWMA,PRICE_CLOSE,i+1))
           c5=0.5 ;           
      if(iMA(min_pair2,check_tf,fast_check_ma,0,MODE_LWMA,PRICE_CLOSE,i)
         ==iMA(min_pair2,check_tf,slow_check_ma,0,MODE_LWMA,PRICE_CLOSE,i))
           c5=0 ;   
           
      //--Pair 6--+
      if(iMA(min_pair3,check_tf,fast_check_ma,0,MODE_LWMA,PRICE_CLOSE,i)
         >iMA(min_pair3,check_tf,slow_check_ma,0,MODE_LWMA,PRICE_CLOSE,i)
         && iMA(min_pair3,check_tf,fast_check_ma,0,MODE_LWMA,PRICE_CLOSE,i)
         >iMA(min_pair3,check_tf,fast_check_ma,0,MODE_LWMA,PRICE_CLOSE,i+1))
           c6=-1 ;
      if(iMA(min_pair3,check_tf,fast_check_ma,0,MODE_LWMA,PRICE_CLOSE,i)
         >iMA(min_pair3,check_tf,slow_check_ma,0,MODE_LWMA,PRICE_CLOSE,i)
         && iMA(min_pair3,check_tf,fast_check_ma,0,MODE_LWMA,PRICE_CLOSE,i)
         <iMA(min_pair3,check_tf,fast_check_ma,0,MODE_LWMA,PRICE_CLOSE,i+1))
           c6=-0.5 ;           
      if(iMA(min_pair3,check_tf,fast_check_ma,0,MODE_LWMA,PRICE_CLOSE,i)
         <iMA(min_pair3,check_tf,slow_check_ma,0,MODE_LWMA,PRICE_CLOSE,i)
         && iMA(min_pair3,check_tf,fast_check_ma,0,MODE_LWMA,PRICE_CLOSE,i)
         <iMA(min_pair3,check_tf,fast_check_ma,0,MODE_LWMA,PRICE_CLOSE,i+1))
           c6=1 ;
      if(iMA(min_pair3,check_tf,fast_check_ma,0,MODE_LWMA,PRICE_CLOSE,i)
         <iMA(min_pair3,check_tf,slow_check_ma,0,MODE_LWMA,PRICE_CLOSE,i)
         && iMA(min_pair3,check_tf,fast_check_ma,0,MODE_LWMA,PRICE_CLOSE,i)
         >iMA(min_pair3,check_tf,fast_check_ma,0,MODE_LWMA,PRICE_CLOSE,i+1))
           c6=0.5 ;           
      if(iMA(min_pair3,check_tf,fast_check_ma,0,MODE_LWMA,PRICE_CLOSE,i)
         ==iMA(min_pair3,check_tf,slow_check_ma,0,MODE_LWMA,PRICE_CLOSE,i))
           c6=0 ; 
           
      //--Pair 7--+
      if(iMA(min_pair4,check_tf,fast_check_ma,0,MODE_LWMA,PRICE_CLOSE,i)
         >iMA(min_pair4,check_tf,slow_check_ma,0,MODE_LWMA,PRICE_CLOSE,i)
         && iMA(min_pair4,check_tf,fast_check_ma,0,MODE_LWMA,PRICE_CLOSE,i)
         >iMA(min_pair4,check_tf,fast_check_ma,0,MODE_LWMA,PRICE_CLOSE,i+1))
           c7=-1 ;
      if(iMA(min_pair4,check_tf,fast_check_ma,0,MODE_LWMA,PRICE_CLOSE,i)
         >iMA(min_pair4,check_tf,slow_check_ma,0,MODE_LWMA,PRICE_CLOSE,i)
         && iMA(min_pair4,check_tf,fast_check_ma,0,MODE_LWMA,PRICE_CLOSE,i)
         <iMA(min_pair4,check_tf,fast_check_ma,0,MODE_LWMA,PRICE_CLOSE,i+1))
           c7=-0.5 ;
      if(iMA(min_pair4,check_tf,fast_check_ma,0,MODE_LWMA,PRICE_CLOSE,i)
         <iMA(min_pair4,check_tf,slow_check_ma,0,MODE_LWMA,PRICE_CLOSE,i)
         && iMA(min_pair4,check_tf,fast_check_ma,0,MODE_LWMA,PRICE_CLOSE,i)
         <iMA(min_pair4,check_tf,fast_check_ma,0,MODE_LWMA,PRICE_CLOSE,i+1))
           c7=1 ;
      if(iMA(min_pair4,check_tf,fast_check_ma,0,MODE_LWMA,PRICE_CLOSE,i)
         <iMA(min_pair4,check_tf,slow_check_ma,0,MODE_LWMA,PRICE_CLOSE,i)
         && iMA(min_pair4,check_tf,fast_check_ma,0,MODE_LWMA,PRICE_CLOSE,i)
         >iMA(min_pair4,check_tf,fast_check_ma,0,MODE_LWMA,PRICE_CLOSE,i+1))
           c7=0.5 ;
      if(iMA(min_pair4,check_tf,fast_check_ma,0,MODE_LWMA,PRICE_CLOSE,i)
         ==iMA(min_pair4,check_tf,slow_check_ma,0,MODE_LWMA,PRICE_CLOSE,i))
           c7=0 ;   
       
      data_buffer[i]=(c1+c2+c3+c4+c5+c6+c7)*multiplier;
     
             
       }
            for(i=0; i<limit; i++)
       {
      sig_buffer[i]=iMAOnArray(data_buffer,0,sig_smooth,0,MODE_LWMA,i);
       Comment("Level (",sig_buffer[i]);
       }
  //---- done
     return(0);
    }
//+------------------------------------------------------------------+
boursicoton
FXCodeBase: Confirmed User
 
Posts: 78
Joined: Sat Feb 06, 2010 1:33 pm

Re: translate mql in lua...?

Postby Apprentice » Fri Aug 20, 2010 2:38 am

Added to development cue.
User avatar
Apprentice
FXCodeBase: Confirmed User
 
Posts: 18487
Joined: Thu Dec 31, 2009 11:59 am
Location: Zagreb, Croatia

Re: translate mql in lua...?

Postby Alexander.Gettinger » Thu Aug 26, 2010 1:58 am

First indicator is a linear weighted moving average with period 89 for close prices.
Alexander.Gettinger
FXCodeBase: Confirmed User
 
Posts: 3113
Joined: Wed Mar 31, 2010 9:40 pm
Location: Russia, Omsk

Re: translate mql in lua...?

Postby boursicoton » Thu Aug 26, 2010 3:54 pm

thanks alexander, i see that this indicator move with moving average..after some test of parametre...i stop my test...non coresponding exactly !

linear weighted. 89.. thnaks !
boursicoton
FXCodeBase: Confirmed User
 
Posts: 78
Joined: Sat Feb 06, 2010 1:33 pm

translate mql in lua...2ND TRUTH STOCHASTIC

Postby piptopia » Fri Aug 27, 2010 1:15 pm

#property indicator_separate_window
#property indicator_buffers 2
#property indicator_color1 White
#property indicator_color2 Red
#property indicator_level1 0
//---- input parameters
extern int Period_Q=2;
extern int Period_R=8;
extern int Period_S=5;
extern int Signal=5;
//---- buffers
double SMI_Buffer[];
double Signal_Buffer[];
double SM_Buffer[];
double EMA_SM[];
double EMA2_SM[];
double EMA_HQ[];
double EMA2_HQ[];
double HQ_Buffer[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
//---- indicators
IndicatorBuffers(8);
SetIndexStyle(0,DRAW_LINE);
SetIndexBuffer(0,SMI_Buffer);
SetIndexStyle(1,DRAW_LINE);
SetIndexBuffer(1,Signal_Buffer);
SetIndexLabel(0,"SMI");
SetIndexLabel(1,"SMI Signal");
SetIndexBuffer(2,SM_Buffer);
SetIndexBuffer(3,EMA_SM);
SetIndexBuffer(4,EMA2_SM);
SetIndexBuffer(5,EMA_HQ);
SetIndexBuffer(6,EMA2_HQ);
SetIndexBuffer(7,HQ_Buffer);

IndicatorShortName("SMI("+Period_Q+","+Period_R+","+Period_S+","+Signal+")");
//----
return(0);
}
//+------------------------------------------------------------------+
//| Custor indicator deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{

return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator iteration function |
//+------------------------------------------------------------------+
int start()
{
int counted_bars=IndicatorCounted();
int limit;
int i;
// double Median_Q[];
if(counted_bars<0) return(-1);
if(counted_bars>0) counted_bars--;
limit=Bars-Period_Q-counted_bars;
if(counted_bars>0) counted_bars--;

for (i=limit;i>=0;i--)
{
HQ_Buffer[i]=High[Highest(NULL,0,MODE_HIGH,Period_Q,i)]-Low[Lowest(NULL,0,MODE_LOW,Period_Q,i)];
SM_Buffer[i]=Close[i]-(High[Highest(NULL,0,MODE_HIGH,Period_Q,i)]+Low[Lowest(NULL,0,MODE_LOW,Period_Q,i)])/2;//Median_Q[i];
}

for (i=limit-Period_R;i>=0;i--)
{
EMA_SM[i]=iMAOnArray(SM_Buffer,0,Period_R,0,MODE_EMA,i);
EMA_HQ[i]=iMAOnArray(HQ_Buffer,0,Period_R,0,MODE_EMA,i);
}
for (i=limit-Period_R-Period_S;i>=0;i--)
{
EMA2_SM[i]=iMAOnArray(EMA_SM,0,Period_S,0,MODE_EMA,i);
EMA2_HQ[i]=iMAOnArray(EMA_HQ,0,Period_S,0,MODE_EMA,i);
}
for (i=limit-Period_R-Period_S-Signal;i>=0;i--)
{
SMI_Buffer[i]=100*EMA2_SM[i]/0.5/EMA2_HQ[i];
}
for (i=limit-Period_R-Period_S;i>=0;i--)
{
Signal_Buffer[i]=iMAOnArray(SMI_Buffer,0,Signal,0,MODE_EMA,i);
}

//----
return(0);
}
//+------------------------------------------------------------------+
piptopia
 
Posts: 2
Joined: Fri Aug 27, 2010 1:02 pm

Re: translate mql in lua...?

Postby Alexander.Gettinger » Sun Sep 05, 2010 10:55 pm

SMI indicator you may find here: viewtopic.php?f=17&t=2071
Alexander.Gettinger
FXCodeBase: Confirmed User
 
Posts: 3113
Joined: Wed Mar 31, 2010 9:40 pm
Location: Russia, Omsk

Re: translate mql in lua...?

Postby Alexander.Gettinger » Wed Sep 08, 2010 9:40 pm

USD Strength Effect indicator you may find here: viewtopic.php?f=17&t=2099
Alexander.Gettinger
FXCodeBase: Confirmed User
 
Posts: 3113
Joined: Wed Mar 31, 2010 9:40 pm
Location: Russia, Omsk


Return to Indicator and Signal Requests

Who is online

Users browsing this forum: No registered users and 5 guests