MQL4 ve MQL5 ile ilgili herhangi bir acemi sorusu, algoritmalar ve kodlar hakkında yardım ve tartışma - sayfa 1492

 
Alexey Viktorov :

Tarasik, aferin sana... Sıradanlık. İpuçlarından sonra çıkan koda bak... Buna "Bunu yapmamayı öğretiyorum" denir ve anlamayan suçludur.

peki, sonra kişiselleşir ve ne kadar kötü bir insan olduğunu tartışırız.

Alexey Viktorov :

Bu kadar açık yalan söylemek yakışıksız. Gönderinizi sildiniz ve cehaletinizi başka birine atıyorsunuz. Yalan.

peki yalancı kim
 
Taras Slobodyanik :

peki, sonra kişiselleşir ve ne kadar kötü bir insan olduğunu tartışırız.

peki yalancı kim

Bir önceki sayfadaki yazılarımda bunu okuyun.

 
Alexey Viktorov :

Evet, silmedim, bu mesajı hemen bulamadım

Ancak! Hala kim olduğunu söylemeyi reddediyorsun?

turp)

 
SanAlex :

en basit ve en kolay yol, Göstergeden Yatay veya Eğilim Çizgilerinin adlarını almaktır.

- grafikte, farenin sağ tuşuna tıklayın - ve NESNE LİSTESİ öğesini bulun ( kopyalayıp uzmana yapıştırın )

Yardım için teşekkürler! Ayrıca Uzman Danışmanınıza baktım ve kodu kullandım:

double price_line_up=ObjectGetDouble(0,"Üst",OBJPROP_PRICE);

double price_line_down=ObjectGetDouble(0,"Alt",OBJPROP_PRICE);

göstergeden hatların isimlerini girerek. Değerleri alıyorum, ancak henüz her şeyi kontrol etmedim. Sanırım işe yaramalı.

 

Merhaba. Arkadaşlar, yardımınıza ihtiyacım var.

Uyarılı stokastik bir gösterge var, hareketli ortalamaların kesiştiği yerde bir sinyal veriyor. Lütfen bana aşırı alım ve aşırı satım bölgesinin üstünde veya altında olduğunda hareketli ortalamaların kesişiminde nasıl sinyal vereceğini söyleyin.

zor değilse söyle

 #property indicator_separate_window
#property indicator_buffers 4
#property indicator_color1 LightSeaGreen
#property indicator_color2 Red
#property indicator_color3 Blue
#property indicator_color4 Red
#property indicator_level1 80
#property indicator_level2 20
#property indicator_maximum 100
#property indicator_minimum 0

//---- input parameters
/*************************************************************************
PERIOD_M1   1
PERIOD_M5   5
PERIOD_M15  15
PERIOD_M30  30 
PERIOD_H1   60
PERIOD_H4   240
PERIOD_D1   1440
PERIOD_W1   10080
PERIOD_MN1  43200
You must use the numeric value of the timeframe that you want to use
when you set the TimeFrame' value with the indicator inputs.
---------------------------------------
MODE_SMA    0 Simple moving average, 
MODE_EMA    1 Exponential moving average, 
MODE_SMMA   2 Smoothed moving average, 
MODE_LWMA   3 Linear weighted moving average. 
You must use the numeric value of the MA Method that you want to use
when you set the 'ma_method' value with the indicator inputs.

**************************************************************************/
extern int TimeFrame= 240 ;
extern int KPeriod= 5 ;
extern int DPeriod= 3 ;
extern int Slowing= 3 ;
extern int MAMethod= 0 ;
extern int PriceField= 0 ; // PriceField:  0=Hi/Low   1=Close/Close

extern string note_TimeFrames = "M1;5,15,30,60H1;240H4;1440D1;10080W1;43200MN" ;
extern string __MA_Method = "SMA0 EMA1 SMMA2 LWMA3" ;
extern string __PriceField = "0=Hi/Low   1=Close/Close" ;
//extern string __Price = "0O,1C 2H3L,4Md 5Tp 6WghC: Md(HL/2)4,Tp(HLC/3)5,Wgh(HLCC/4)6";


double ExtMapBuffer1[];
double ExtMapBuffer2[];
double ExtMapBuffer3[];
double ExtMapBuffer4[];

datetime last_t= 0 ;
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
//---- indicator line
   SetIndexBuffer ( 0 ,ExtMapBuffer1);
   SetIndexStyle( 0 , DRAW_LINE );
   SetIndexBuffer ( 1 ,ExtMapBuffer2);
   SetIndexStyle( 1 , DRAW_LINE , STYLE_DOT );
   SetIndexLabel( 0 ,   "MTF_Stochastic(" +KPeriod+ "," +DPeriod+ "," +Slowing+ ")TF" +TimeFrame+ "" );
   SetIndexLabel( 1 , "MTF_Stochastic(" +KPeriod+ "," +DPeriod+ "," +Slowing+ ")TF" +TimeFrame+ "" );
   SetIndexBuffer ( 2 ,ExtMapBuffer3);
   SetIndexStyle( 2 , DRAW_ARROW );
   SetIndexArrow( 2 , 233 );
   SetIndexBuffer ( 3 ,ExtMapBuffer4);
   SetIndexStyle( 3 , DRAW_ARROW );
   SetIndexArrow( 3 , 234 );

//---- name for DataWindow and indicator subwindow label   
   switch (TimeFrame)
   {
       case 1 : string TimeFrameStr= "Period_M1" ; break ;
       case 5 : TimeFrameStr= "Period_M5" ; break ;
       case 15 : TimeFrameStr= "Period_M15" ; break ;
       case 30 : TimeFrameStr= "Period_M30" ; break ;
       case 60 : TimeFrameStr= "Period_H1" ; break ;
       case 240 : TimeFrameStr= "Period_H4" ; break ;
       case 1440 : TimeFrameStr= "Period_D1" ; break ;
       case 10080 : TimeFrameStr= "Period_W1" ; break ;
       case 43200 : TimeFrameStr= "Period_MN1" ; break ;
       default : TimeFrameStr= "Current Timeframe" ;
   } 
   IndicatorShortName( "MTF_Stochastic(" +KPeriod+ "," +DPeriod+ "," +Slowing+ ") " +TimeFrameStr);  
   start();
   return ( 0 );
  }
//----
   
 
//+------------------------------------------------------------------+
//| MTF Stochastic                                                   |
//+------------------------------------------------------------------+
 int deinit()
  {
   for ( int i= Bars ;i>= 0 ;i--){
       ObjectDelete ( "st" + Symbol ()+ Period ()+DoubleToStr(KPeriod+DPeriod+Slowing, 0 )+DoubleToStr(i, 0 ));
   }
   return ( 0 );
  }

bool up_a= false ;
bool dn_a= false ;
int start()
  {
   datetime TimeArray[];
   ArrayResize (TimeArray, Bars );
   int     i,limit,y= 0 ,counted_bars=IndicatorCounted();
    
// Plot defined timeframe on to current timeframe   
   ArrayCopySeries(TimeArray,MODE_TIME, Symbol (),TimeFrame); 
   
 //  limit=Bars-counted_bars+TimeFrame/Period(); //igorad
limit= Bars - 1 ;
limit= MathMax (limit,TimeFrame/ Period ());
//limit=MathMin(limit,BarsToCount);
   for (i= 0 ,y= 0 ;i<limit;i++)
   {
   if (Time[i]<TimeArray[y]) y++; 
   
 /***********************************************************   
   Add your main indicator loop below.  You can reference an existing
      indicator with its iName  or iCustom.
   Rule 1:  Add extern inputs above for all neccesary values   
   Rule 2:  Use 'TimeFrame' for the indicator timeframe
   Rule 3:  Use 'y' for the indicator's shift value
 **********************************************************/   
   ExtMapBuffer3[i]= EMPTY_VALUE ;  
   ExtMapBuffer4[i]= EMPTY_VALUE ;
   ExtMapBuffer1[i]= EMPTY_VALUE ;  
   ExtMapBuffer2[i]= EMPTY_VALUE ;

   ExtMapBuffer1[i]= iStochastic ( NULL ,TimeFrame,KPeriod,DPeriod,Slowing,MAMethod,PriceField, 0 ,y);
   ExtMapBuffer2[i]= iStochastic ( NULL ,TimeFrame,KPeriod,DPeriod,Slowing,MAMethod,PriceField, 1 ,y);
   ObjectDelete ( "st" + Symbol ()+ Period ()+DoubleToStr(KPeriod+DPeriod+Slowing, 0 )+DoubleToStr(i, 0 ));   

   if ( NormalizeDouble (ExtMapBuffer1[i], Digits )> NormalizeDouble (ExtMapBuffer2[i], Digits ) && NormalizeDouble (ExtMapBuffer1[i+ 1 ], Digits )<= NormalizeDouble (ExtMapBuffer2[i+ 1 ], Digits )  && NormalizeDouble (ExtMapBuffer1[i+ 1 ], Digits )!= NormalizeDouble (ExtMapBuffer1[i], Digits ) ){
      ExtMapBuffer3[i]=ExtMapBuffer1[i];
       ObjectDelete ( "st" + Symbol ()+ Period ()+DoubleToStr(KPeriod+DPeriod+Slowing, 0 )+DoubleToStr(i, 0 ));
       ObjectCreate ( "st" + Symbol ()+ Period ()+DoubleToStr(KPeriod+DPeriod+Slowing, 0 )+DoubleToStr(i, 0 ), 22 , 0 ,Time[i],Low[i]- 5 * Point );
      ObjectSet( "st" + Symbol ()+ Period ()+DoubleToStr(KPeriod+DPeriod+Slowing, 0 )+DoubleToStr(i, 0 ), 6 ,Blue);
      ObjectSet( "st" + Symbol ()+ Period ()+DoubleToStr(KPeriod+DPeriod+Slowing, 0 )+DoubleToStr(i, 0 ), 14 , 233 );      
   }
   if ( NormalizeDouble (ExtMapBuffer1[i], Digits )< NormalizeDouble (ExtMapBuffer2[i], Digits ) && NormalizeDouble (ExtMapBuffer1[i+ 1 ], Digits )>= NormalizeDouble (ExtMapBuffer2[i+ 1 ], Digits )  && NormalizeDouble (ExtMapBuffer1[i+ 1 ], Digits )!= NormalizeDouble (ExtMapBuffer1[i], Digits )){
      ExtMapBuffer4[i]=ExtMapBuffer1[i];
       ObjectDelete ( "st" + Symbol ()+ Period ()+DoubleToStr(KPeriod+DPeriod+Slowing, 0 )+DoubleToStr(i, 0 ));
       ObjectCreate ( "st" + Symbol ()+ Period ()+DoubleToStr(KPeriod+DPeriod+Slowing, 0 )+DoubleToStr(i, 0 ), 22 , 0 ,Time[i],High[i]+ 5 * Point );
      ObjectSet( "st" + Symbol ()+ Period ()+DoubleToStr(KPeriod+DPeriod+Slowing, 0 )+DoubleToStr(i, 0 ), 6 ,Red);
      ObjectSet( "st" + Symbol ()+ Period ()+DoubleToStr(KPeriod+DPeriod+Slowing, 0 )+DoubleToStr(i, 0 ), 14 , 234 );      
   }
   }  
     
//
   //----  Refresh buffers ++++++++++++++ 
   if (TimeFrame < Period ()) TimeFrame = Period ();
   if (TimeFrame> Period ()) {
     int PerINT=TimeFrame/ Period ()+ 1 ;
     datetime TimeArr[]; ArrayResize (TimeArr,PerINT);
     ArrayCopySeries(TimeArr,MODE_TIME, Symbol (), Period ()); 
     for (i= 0 ;i<PerINT+ 1 ;i++) { if (TimeArr[i]>=TimeArray[ 0 ]) {
 /********************************************************     
    Refresh buffers:         buffer[i] = buffer[0];
 ************************************************************/   

   ExtMapBuffer1[i]=ExtMapBuffer1[ 0 ];
   ExtMapBuffer2[i]=ExtMapBuffer2[ 0 ];

   } } }
//+++++++++++++++++++++++++++++++++++++++++++++++++++++   Raff 

   if (ExtMapBuffer3[ 0 ]!= EMPTY_VALUE && !up_a){
      up_a= true ;
      dn_a= false ;    
       Alert ( "MTF Stochastic Long cross Signal on " + Symbol ());
   }
   if (ExtMapBuffer4[ 0 ]!= EMPTY_VALUE && !dn_a){
      dn_a= true ;
      up_a= false ;    
       Alert ( "MTF Stochastic Short cross Signal on " + Symbol ());
   }

   return ( 0 );
  }
 
jarikn :

Merhaba. Arkadaşlar, yardımınıza ihtiyacım var.

Uyarılı stokastik bir gösterge var, hareketli ortalamaların kesiştiği yerde bir sinyal veriyor. Lütfen bana aşırı alım ve aşırı satım bölgesinin üstünde veya altında olduğunda hareketli ortalamaların kesişiminde nasıl sinyal vereceğini söyleyin.

zor değilse söyle

***

Rica ederim   kodu yapıştır   düzelt: bir gönderiyi düzenlerken düğmeye basın   kod ve kodunuzu açılır pencereye yapıştırın.
MQL5.community - Памятка пользователя
MQL5.community - Памятка пользователя
  • www.mql5.com
Вы недавно зарегистрировались и у вас возникли вопросы: Как вставить картинку в сообщение на форуме, как красиво оформить исходный код MQL5, где находятся ваши Личные сообщения? В этой статье мы подготовили для вас несколько практических советов, которые помогут быстрее освоиться на сайте MQL5.community и позволят в полной мере воспользоваться доступными функциональными возможностями.
 
  • //| mymacd v2 12/11/05
    /////////////////////////////////////////////////////////////////////////////////////////////
    #property link "jpygbp@yahoo.com"
    #property indicator_buffers 5
    #property indicator_separate_window
    #property indicator_color1 HotPink     //macd
    #property indicator_color2 Lime     //signal
    #property indicator_color3 Gray   //histogram
    #property indicator_color4 Blue   //macd[1]
    #property indicator_color5 Black     //zero line
    //---- buffers
    double Buffer1[]; //macd
    double Buffer2[]; //signal
    double Buffer3[]; //histogram
    double Buffer4[]; //macd[1]
    double Buffer5[]; //zero line
    //
    extern int FastEMA = 9 ;
    extern int SlowEMA = 64 ;
    extern int SignalSMA = 112 ;
    //extern bool plotMACD = true;
    //extern bool plotSignalLine = true;
    //extern bool plotHistogram = true;
    //extern bool plotMACDOneBarAgo = true;
    //extern bool plotZeroLine = true;
    extern bool plotArrows = false ;
    extern double HistThreshold = 0 ;
    //
    ///////////////////////////////////////////////////////////////////////////////////////////////
    
    int limit = 0 ;
    int fontsize= 10 ;
    int i = 0 ;
    bool InLTrade = false ;
    bool InSTrade = false ;
    /////////////////////////////////////////////////////////////////////////////////////////////
    int init()
    {
       ObjectsDeleteAll ();
       //---- indicators
       SetIndexStyle( 0 , DRAW_LINE , STYLE_SOLID , 2 ); //macd
       SetIndexStyle( 1 , DRAW_LINE , STYLE_SOLID , 2 ); //signal
       SetIndexStyle( 2 , DRAW_HISTOGRAM , STYLE_SOLID , 2 ); //hist
       SetIndexStyle( 3 , DRAW_LINE , STYLE_SOLID , 2 ); //macd[1]
       SetIndexStyle( 4 , DRAW_LINE , STYLE_SOLID , 1 ); //zero
       //
       SetIndexBuffer ( 0 ,Buffer1);
       SetIndexBuffer ( 1 ,Buffer2);
       SetIndexBuffer ( 2 ,Buffer3); 
       SetIndexBuffer ( 3 ,Buffer4); 
       SetIndexBuffer ( 4 ,Buffer5); 
       //
       SetIndexDrawBegin( 1 ,SignalSMA);
       //
       IndicatorDigits(MarketInfo( Symbol (),MODE_DIGITS)+ 1 );
       //
       IndicatorShortName( "MACD(" +FastEMA+ "," +SlowEMA+ "," +SignalSMA+ ")" );
       //
       SetIndexLabel( 0 , "MACD" );
       SetIndexLabel( 1 , "Signal" );
       SetIndexLabel( 2 , "Histogram" );
       SetIndexLabel( 3 , "MACD[1]" );
       SetIndexLabel( 4 , "Zero" );
       //
       return ( 0 );
    }
    /////////////////////////////////////////////////////////////////////////////////////////////
    string NewArrow( datetime T1, double P1, color collor) 
    {
       string N= StringConcatenate ( "A" ,collor, "-" ,TimeToStr(T1));
       int AC=SYMBOL_STOPSIGN;
       if (collor==Blue)
          AC=SYMBOL_ARROWUP;
       if (collor==Red) 
          AC=SYMBOL_ARROWDOWN;
       //
       ObjectCreate (N, OBJ_ARROW , 0 , T1, P1);
       ObjectSet(N, OBJPROP_ARROWCODE , AC);
       ObjectSet(N, OBJPROP_COLOR , collor);
       ObjectSet(N, OBJPROP_WIDTH , 1 );
       ObjectsRedraw();
       return (N);
    }
    /////////////////////////////////////////////////////////////////////////////////////////////
    int deinit()
    {
       ObjectsRedraw();
       return ( 0 );
    }
    /////////////////////////////////////////////////////////////////////////////////////////////
    int start()
    {
       int counted_bars=IndicatorCounted();
       if (counted_bars< 0 ) return (- 1 ); //---- check for possible errors
       if (counted_bars> 0 ) counted_bars--; //---- last counted bar will be recounted
       limit= Bars -counted_bars;
       //
       for (i= 0 ; i<limit; i++) //---- macd counted in the 1-st buffer histogram
          Buffer1[i]= iMA ( NULL , 0 ,FastEMA, 0 , MODE_EMA , PRICE_CLOSE ,i)- iMA ( NULL , 0 ,SlowEMA, 0 , MODE_EMA , PRICE_CLOSE ,i);
       //
       for (i= 0 ; i<limit; i++) //---- signal line counted in the 2-nd buffer line
          Buffer2[i]=iMAOnArray(Buffer1, Bars ,SignalSMA, 0 , MODE_SMA ,i);
       //
       for (i= 0 ; i<limit; i++) //---- histogram is the difference between macd and signal line
       {
          Buffer3[i]=Buffer1[i]-Buffer2[i];
          Buffer5[i]= 0 ;
       }
       //
       for (i= 1 ; i<limit; i++) //---- macd[1]
          Buffer4[i]= iMA ( NULL , 0 ,FastEMA, 0 , MODE_EMA , PRICE_CLOSE ,i- 1 )- iMA ( NULL , 0 ,SlowEMA, 0 , MODE_EMA , PRICE_CLOSE ,i- 1 );
       //
       if (plotArrows)
       {
           ObjectsDeleteAll ();
          InLTrade = false ;
          InSTrade = false ;
           for ( int i= Bars ;i>= 0 ;i--)
          {
             if ((Buffer3[i- 1 ]  > 0 ) && (Buffer3[i] < 0 ) && Buffer3[i- 1 ] > HistThreshold) //Long Begin
             {
               string upArrow1=NewArrow(Time[i- 1 ], High[i- 1 ]+ 0.0005 , Blue);
                InLTrade = true ; 
             }
             if ((Buffer3[i- 1 ]  < 0 ) && (Buffer3[i] > 0 ) && Buffer3[i- 1 ] < -HistThreshold) //Short Begin
             {
                 string dnArrow1=NewArrow(Time[i- 1 ], Low[i- 1 ]- 0.0003 , Red);
                InSTrade = true ; 
                InLTrade = false ;  
             }
             if ((InSTrade  == true ) && (Buffer3[i- 1 ] > Buffer3[i])) //Short End
             {
                 string upArrow2=NewArrow(Time[i- 1 ], Low[i- 1 ]- 0.0003 , Aqua);
                InSTrade = false ; 
             }
             if ((InLTrade == true ) && (Buffer3[i- 1 ] < Buffer3[i])) //Long End
             {
                 string dnArrow2=NewArrow(Time[i- 1 ], High[i- 1 ]+ 0.0005 , Aqua);
                InLTrade = false ;   
             }
          }
       }
       //
       //
       return ( 0 );
    }
    /////////////////////////////////////////////////////////////////////////////////////////////

    Yardıma ihtiyacım var, -Macd göstergesi var ama grafiğe eklendiğinde ve zaman dilimlerini değiştirirken tüm seviyeler ve grafik nesneler kayboluyor, bunu nasıl düzeltebilirim.
Dosyalar:
-Macd.ex4  6 kb
-Macd.mq4  5 kb
 
Lütfen bana gösterge parametrelerini iCustom'da nasıl listeleyeceğimi söyleyin.
Dosyalar:
q7iqav.PNG  47 kb
 
lütfen bana mql5 hakkında bilgi verin, örneğin 12 saatlik mum gibi ortalama boyut istatistiklerini toplamak istiyorum, örneğin bugün cuma ve hesaplamalar için perşembe, çarşamba, salı ve pazartesi verilerini almak istiyorum.
TimeToString ve ardından SplitString ve AP'yi dönüştürmek için zaman alıyorum, bir gün veya daha önce aynı zaman mumuna başvurmanın daha hızlı ve daha az hantal bir yolu var mı? Tabii ki, mevcut TF'nin günlük mum sayısını bir adımla koşabilirsiniz, ancak korkarım ki tırnaklarda bir yerde delikler varsa, o zaman bir kayma olacaktır.