Компиляция индикаторов и экспертов под новые билды MetaTrader 4

  • Автор темы Автор темы Veles-tm
  • Дата начала Дата начала

gince

Местный знаток

Вложения

Inquiring

Новичок форума
Уважаемые знатоки! Угадайте, что в черном ящике и покажите всем. Очень интересная штука.
 

Вложения

gince

Местный знаток
Уважаемые знатоки! Угадайте, что в черном ящике и покажите всем. Очень интересная штука.

PHP:
Expand Collapse Copy
for(int i=limit-1; i>=0; i--)    
     {           
           double MAUP1 = iMA(NULL,0,MAPeriod,-MoveShift,MODE_SMA,PRICE_HIGH,i); 
           double BB_UP = iBands(NULL,0,BPeriod,Std,0,PRICE_HIGH,MODE_UPPER,i);
           double MA_HIGH = iMA(NULL,0,4,0,MODE_LWMA,PRICE_HIGH,i);  
           
           double MADN1 = iMA(NULL,0,MAPeriod,-MoveShift,MODE_SMA,PRICE_LOW,i); 
           double BB_DN = iBands(NULL,0,BPeriod,Std,0,PRICE_LOW ,MODE_LOWER,i);
           double MA_LOW = iMA(NULL,0,4,0,MODE_LWMA,PRICE_LOW,i);  
           
       
          if (MAUP1>BB_UP) {ExtMapBuffer1[i]=MAUP1+Dist2*Point; BB_UP=EMPTY_VALUE ;}     
          else if (MAUP1<BB_UP) {ExtMapBuffer1[i]=BB_UP ; MAUP1=EMPTY_VALUE ;}
//--------------------------------------------------------------------             
           
                      
            
         if( MADN1 >0.0 ) 
         {
          if ( MADN1<BB_DN)  {ExtMapBuffer2[i]=MADN1-Dist2*Point; BB_DN=EMPTY_VALUE ;}                        
          else if (MADN1>BB_DN) { ExtMapBuffer2[i]=BB_DN ; MADN1=EMPTY_VALUE ; }
         }
       
         if (MADN1 ==0.0 ) { ExtMapBuffer2[i]=BB_DN; MADN1=EMPTY_VALUE ;} 
}
 

Inquiring

Новичок форума
PHP:
Expand Collapse Copy
for(int i=limit-1; i>=0; i--)    
     {           
           double MAUP1 = iMA(NULL,0,MAPeriod,-MoveShift,MODE_SMA,PRICE_HIGH,i); 
           double BB_UP = iBands(NULL,0,BPeriod,Std,0,PRICE_HIGH,MODE_UPPER,i);
           double MA_HIGH = iMA(NULL,0,4,0,MODE_LWMA,PRICE_HIGH,i);  
           
           double MADN1 = iMA(NULL,0,MAPeriod,-MoveShift,MODE_SMA,PRICE_LOW,i); 
           double BB_DN = iBands(NULL,0,BPeriod,Std,0,PRICE_LOW ,MODE_LOWER,i);
           double MA_LOW = iMA(NULL,0,4,0,MODE_LWMA,PRICE_LOW,i);  
           
       
          if (MAUP1>BB_UP) {ExtMapBuffer1[i]=MAUP1+Dist2*Point; BB_UP=EMPTY_VALUE ;}     
          else if (MAUP1<BB_UP) {ExtMapBuffer1[i]=BB_UP ; MAUP1=EMPTY_VALUE ;}
//--------------------------------------------------------------------             
           
                      
            
         if( MADN1 >0.0 ) 
         {
          if ( MADN1<BB_DN)  {ExtMapBuffer2[i]=MADN1-Dist2*Point; BB_DN=EMPTY_VALUE ;}                        
          else if (MADN1>BB_DN) { ExtMapBuffer2[i]=BB_DN ; MADN1=EMPTY_VALUE ; }
         }
       
         if (MADN1 ==0.0 ) { ExtMapBuffer2[i]=BB_DN; MADN1=EMPTY_VALUE ;} 
}



Благодарствую. На 30-минутках показывает очень неплохие результаты с дополнительными фильтрами.
 

Вложения

  • mabands.gif
    mabands.gif
    41 КБ · Просмотры: 224

Inquiring

Новичок форума
PHP:
Expand Collapse Copy
for(int i=limit-1; i>=0; i--)    
     {           
           double MAUP1 = iMA(NULL,0,MAPeriod,-MoveShift,MODE_SMA,PRICE_HIGH,i); 
           double BB_UP = iBands(NULL,0,BPeriod,Std,0,PRICE_HIGH,MODE_UPPER,i);
           double MA_HIGH = iMA(NULL,0,4,0,MODE_LWMA,PRICE_HIGH,i);  
           
           double MADN1 = iMA(NULL,0,MAPeriod,-MoveShift,MODE_SMA,PRICE_LOW,i); 
           double BB_DN = iBands(NULL,0,BPeriod,Std,0,PRICE_LOW ,MODE_LOWER,i);
           double MA_LOW = iMA(NULL,0,4,0,MODE_LWMA,PRICE_LOW,i);  
           
       
          if (MAUP1>BB_UP) {ExtMapBuffer1[i]=MAUP1+Dist2*Point; BB_UP=EMPTY_VALUE ;}     
          else if (MAUP1<BB_UP) {ExtMapBuffer1[i]=BB_UP ; MAUP1=EMPTY_VALUE ;}
//--------------------------------------------------------------------             
           
                      
            
         if( MADN1 >0.0 ) 
         {
          if ( MADN1<BB_DN)  {ExtMapBuffer2[i]=MADN1-Dist2*Point; BB_DN=EMPTY_VALUE ;}                        
          else if (MADN1>BB_DN) { ExtMapBuffer2[i]=BB_DN ; MADN1=EMPTY_VALUE ; }
         }
       
         if (MADN1 ==0.0 ) { ExtMapBuffer2[i]=BB_DN; MADN1=EMPTY_VALUE ;} 
}

Ознакомьте со всем списком, пожалуйста, а то картинка без стрелочек какая-то неполная.
 

Вложения

  • mabands1.gif
    mabands1.gif
    60,5 КБ · Просмотры: 124

gince

Местный знаток
так мы их профильтруем. может, дадите тему для работы?
ловите
//+------------------------------------------------------------------+
//| MA_BBands.mq4 |
//| Copyright 2005-2014, MetaQuotes Software Corp. |
//| http://www.mql4.com |
//| E-MAIL:[email protected] |
//+------------------------------------------------------------------+
#property copyright "2005-2014, MetaQuotes Software Corp."
#property link "http://www.mql4.com"

#property indicator_chart_window
#property indicator_buffers 5
#property indicator_color1 White
#property indicator_color2 White
#property indicator_color3 Blue
#property indicator_color4 Red
#property indicator_color5 Yellow

#property indicator_width1 2
#property indicator_width2 2
#property indicator_width3 1
#property indicator_width4 1
#property indicator_width5 1


extern int MoveShift = 12;
extern int MAPeriod = 9 ;
extern int OsMA = 3 ;
extern int Dist2 = 20 ;
//-------------------------

extern double Std = 0.4 ; //0.5
extern int BPeriod = 20 ;


//-------------------------

double ExtMapBuffer1[];
double ExtMapBuffer2[];
double ExtMapBuffer3[];
double ExtMapBuffer4[];
double ExtMapBuffer5[];
//-------------------

int init()
{

IndicatorBuffers(5);

SetIndexStyle(0,DRAW_LINE);
SetIndexBuffer(0,ExtMapBuffer1);

SetIndexStyle(1,DRAW_LINE);
SetIndexBuffer(1,ExtMapBuffer2);

SetIndexStyle(2,DRAW_ARROW);
SetIndexArrow(2,233);
SetIndexBuffer(2,ExtMapBuffer3);
SetIndexEmptyValue(2,0.0);

SetIndexStyle(3,DRAW_ARROW);
SetIndexArrow(3,234);
SetIndexBuffer(3,ExtMapBuffer4);
SetIndexEmptyValue(3,0.0);

SetIndexStyle(4,DRAW_LINE);
SetIndexBuffer(4,ExtMapBuffer5);


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

int deinit()
{return(0);}
//----------------------------------------
int start()
{
Comment( " MA_BBands_USDJPY_M5" );
int counted_bars=IndicatorCounted();
if(counted_bars<0) return(-1);
if(counted_bars>0) counted_bars--;
int limit=Bars-counted_bars;
double OsMA_Now, OsMA_Pre;

for(int i=limit-1; i>=0; i--)
{
double MAUP1 = iMA(NULL,0,MAPeriod,-MoveShift,MODE_SMA,PRICE_HIGH,i);
double BB_UP = iBands(NULL,0,BPeriod,Std,0,PRICE_HIGH,MODE_UPPER,i);
double MA_HIGH = iMA(NULL,0,4,0,MODE_LWMA,PRICE_HIGH,i);

double MADN1 = iMA(NULL,0,MAPeriod,-MoveShift,MODE_SMA,PRICE_LOW,i);
double BB_DN = iBands(NULL,0,BPeriod,Std,0,PRICE_LOW ,MODE_LOWER,i);
double MA_LOW = iMA(NULL,0,4,0,MODE_LWMA,PRICE_LOW,i);


if (MAUP1>BB_UP) {ExtMapBuffer1=MAUP1+Dist2*Point; BB_UP=EMPTY_VALUE ;}
else if (MAUP1<BB_UP) {ExtMapBuffer1=BB_UP ; MAUP1=EMPTY_VALUE ;}
//--------------------------------------------------------------------



if( MADN1 >0.0 )
{
if ( MADN1<BB_DN) {ExtMapBuffer2=MADN1-Dist2*Point; BB_DN=EMPTY_VALUE ;}
else if (MADN1>BB_DN) { ExtMapBuffer2=BB_DN ; MADN1=EMPTY_VALUE ; }
}

if (MADN1 ==0.0 ) { ExtMapBuffer2=BB_DN; MADN1=EMPTY_VALUE ;}
//------------------------------------------------------------
OsMA_Now = iOsMA(NULL,0,5,9,OsMA,PRICE_CLOSE,i) ;
OsMA_Pre = iOsMA(NULL,0,5,9,OsMA,PRICE_CLOSE,i+1) ;

//-------------------
if((OsMA_Now>0 && OsMA_Pre<0)&&(MA_LOW < ExtMapBuffer2) && (Low < ExtMapBuffer2) )
{
ExtMapBuffer3[i+1] = Low-30*Point;
}

if((OsMA_Now<0 && OsMA_Pre>0) && (MA_HIGH > ExtMapBuffer1) && (High > ExtMapBuffer1) )
{
ExtMapBuffer4[i+1] = High+30*Point;
}


ExtMapBuffer5 = (ExtMapBuffer1 +ExtMapBuffer2)/2.0 ;

}

return(0);
RefreshRates();

}
//--------------------------------

 

Inquiring

Новичок форума
ловите
//+------------------------------------------------------------------+
//| MA_BBands.mq4 |
//| Copyright 2005-2014, MetaQuotes Software Corp. |
//| http://www.mql4.com |
//| E-MAIL:[email protected] |
//+------------------------------------------------------------------+
#property copyright "2005-2014, MetaQuotes Software Corp."
#property link "http://www.mql4.com"

#property indicator_chart_window
#property indicator_buffers 5
#property indicator_color1 White
#property indicator_color2 White
#property indicator_color3 Blue
#property indicator_color4 Red
#property indicator_color5 Yellow

#property indicator_width1 2
#property indicator_width2 2
#property indicator_width3 1
#property indicator_width4 1
#property indicator_width5 1


extern int MoveShift = 12;
extern int MAPeriod = 9 ;
extern int OsMA = 3 ;
extern int Dist2 = 20 ;
//-------------------------

extern double Std = 0.4 ; //0.5
extern int BPeriod = 20 ;


//-------------------------

double ExtMapBuffer1[];
double ExtMapBuffer2[];
double ExtMapBuffer3[];
double ExtMapBuffer4[];
double ExtMapBuffer5[];
//-------------------

int init()
{

IndicatorBuffers(5);

SetIndexStyle(0,DRAW_LINE);
SetIndexBuffer(0,ExtMapBuffer1);

SetIndexStyle(1,DRAW_LINE);
SetIndexBuffer(1,ExtMapBuffer2);

SetIndexStyle(2,DRAW_ARROW);
SetIndexArrow(2,233);
SetIndexBuffer(2,ExtMapBuffer3);
SetIndexEmptyValue(2,0.0);

SetIndexStyle(3,DRAW_ARROW);
SetIndexArrow(3,234);
SetIndexBuffer(3,ExtMapBuffer4);
SetIndexEmptyValue(3,0.0);

SetIndexStyle(4,DRAW_LINE);
SetIndexBuffer(4,ExtMapBuffer5);


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

int deinit()
{return(0);}
//----------------------------------------
int start()
{
Comment( " MA_BBands_USDJPY_M5" );
int counted_bars=IndicatorCounted();
if(counted_bars<0) return(-1);
if(counted_bars>0) counted_bars--;
int limit=Bars-counted_bars;
double OsMA_Now, OsMA_Pre;

for(int i=limit-1; i>=0; i--)
{
double MAUP1 = iMA(NULL,0,MAPeriod,-MoveShift,MODE_SMA,PRICE_HIGH,i);
double BB_UP = iBands(NULL,0,BPeriod,Std,0,PRICE_HIGH,MODE_UPPER,i);
double MA_HIGH = iMA(NULL,0,4,0,MODE_LWMA,PRICE_HIGH,i);

double MADN1 = iMA(NULL,0,MAPeriod,-MoveShift,MODE_SMA,PRICE_LOW,i);
double BB_DN = iBands(NULL,0,BPeriod,Std,0,PRICE_LOW ,MODE_LOWER,i);
double MA_LOW = iMA(NULL,0,4,0,MODE_LWMA,PRICE_LOW,i);


if (MAUP1>BB_UP) {ExtMapBuffer1=MAUP1+Dist2*Point; BB_UP=EMPTY_VALUE ;}
else if (MAUP1<BB_UP) {ExtMapBuffer1=BB_UP ; MAUP1=EMPTY_VALUE ;}
//--------------------------------------------------------------------



if( MADN1 >0.0 )
{
if ( MADN1<BB_DN) {ExtMapBuffer2=MADN1-Dist2*Point; BB_DN=EMPTY_VALUE ;}
else if (MADN1>BB_DN) { ExtMapBuffer2=BB_DN ; MADN1=EMPTY_VALUE ; }
}

if (MADN1 ==0.0 ) { ExtMapBuffer2=BB_DN; MADN1=EMPTY_VALUE ;}
//------------------------------------------------------------
OsMA_Now = iOsMA(NULL,0,5,9,OsMA,PRICE_CLOSE,i) ;
OsMA_Pre = iOsMA(NULL,0,5,9,OsMA,PRICE_CLOSE,i+1) ;

//-------------------
if((OsMA_Now>0 && OsMA_Pre<0)&&(MA_LOW < ExtMapBuffer2) && (Low < ExtMapBuffer2) )
{
ExtMapBuffer3[i+1] = Low-30*Point;
}

if((OsMA_Now<0 && OsMA_Pre>0) && (MA_HIGH > ExtMapBuffer1) && (High > ExtMapBuffer1) )
{
ExtMapBuffer4[i+1] = High+30*Point;
}


ExtMapBuffer5 = (ExtMapBuffer1 +ExtMapBuffer2)/2.0 ;

}

return(0);
RefreshRates();

}
//--------------------------------



спасибо. пример фильтра
 

Вложения

  • volum.mq4
    volum.mq4
    4,4 КБ · Просмотры: 108
  • mabands c volum.gif
    mabands c volum.gif
    29,4 КБ · Просмотры: 257

Who has viewed this thread (Total: 2) Посмотреть

Верх