Alım-satım robotlarını ücretsiz olarak nasıl indirebileceğinizi izleyin
Bizi Twitter üzerinde bulun!
Fan sayfamıza katılın
Komut dosyasını ilginç mi buldunuz?
Öyleyse bir link gönderin -
başkalarının da faydalanmasını sağlayın
Komut dosyasını beğendiniz mi? MetaTrader 5 terminalinde deneyin
Görüntülemeler:
40
Derecelendirme:
(33)
Yayınlandı:
2025.05.21 11:38
MQL5 Freelance Bu koda dayalı bir robota veya göstergeye mi ihtiyacınız var? Freelance üzerinden sipariş edin Freelance'e git

Gösterge, CLOSE'a göre% artış veya düşüşü hesaplar, OOP kullanılarak yazılır ve herhangi bir Uzman Danışmana veya başka bir göstergeye kolayca entegre edilebilir.

  • Gösterge, bir önceki günün CLOSE'una göre değişim yüzdesi olan CH%'yi hesaplar.
  • Grafik üzerinde nesneler oluşturur. Gösterge OOP tarzında yazılmıştır.
  • Herhangi bir EA veya başka bir göstergeye entegre etmek çok kolaydır, sınıfı tanımlamak ve çağrısını yapmak yeterlidir.

Başka bir gösterge veya EA'ya gömülü kodun boyutunu tahmin edebilirsiniz.

Bu 2 satırdır

CChmcYZ chmc;

chmc.RCHsay("EURUSD",TimeCurrent()-86400*5,TimeCurrent(),5,16); // CH% gününü hesaplayın

OOP geniş olanaklar sunar, gerekli sınıfları yazarsınız, daha sonra ...


//+------------------------------------------------------------------+
//|yuraz_mcch.mq5 |
//| Telif Hakkı 2009, MetaQuotes Software Corp. | |
//|http://www.mql5.com |
//+------------------------------------------------------------------+
#property copyright "2009, MetaQuotes Software Corp."
#property link      "http://www.mql5.com"
#property version   "1.00"
#property indicator_chart_window


//////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// sınıf hesaplaması CH% 
//
struct SymbolStruct
  {
   bool              work;
   string            sSymbol;
   int               y;
   int               x;
   double            CH;
  };
//+------------------------------------------------------------------+
//||
//+------------------------------------------------------------------+
class CChmcYZ
  {
public:
   SymbolStruct      sSymb;
   color             lColorSym;
   color             lColorChPlus;
   color             lColorChMinus;
   color             lColorCH;
   
   int               indicatorWindow; // ana pencerede çalışın
   void CChmcYZ()    { 
   indicatorWindow=0;
   lColorSym=DarkBlue; // DarkTurquoise
   lColorCH=DarkGreen; // Beyaz; 
   lColorChPlus  = Green; // LimeGreen;
   lColorChMinus = FireBrick ; // Kırmızı;
    } // kurucu
   void              RCH(string sSym,datetime db,datetime de);   // Eşleme olmadan sadece bir çiftin tam hesaplanması
   void              RCHsay(string sSym,datetime db,datetime de,int X,int Y); // Bir çiftin hesaplamasını tamamlayın ve görüntüleyin
private:
   color lColor;
   double            dClose[7000];                    // maksimum fiyatları kopyalamak için dizi
  };
//+------------------------------------------------------------------+
//||
//+------------------------------------------------------------------+
void CChmcYZ::RCH(string sSymbol,datetime DATEBEG,datetime DATEEND)
  {
   sSymb.CH = 0;
   int CountBar;
   DATEBEG = StringToTime( TimeToString(DATEBEG,TIME_DATE));
   DATEEND = StringToTime( TimeToString(DATEEND,TIME_DATE));
   CountBar= CopyClose(sSymbol,PERIOD_D1,DATEEND,2,dClose);
   if(CountBar>=0)
     {
      if(NormalizeDouble(dClose[1],5)!=0.0 && NormalizeDouble(dClose[0],5)!=0.0)
        {
         sSymb.CH=(dClose[1]*100)/dClose[0]-100;
        }
     }
  }
//+------------------------------------------------------------------+
//|| Çıktı ile hesaplama
//+------------------------------------------------------------------+
void CChmcYZ::RCHsay(string sSym,datetime db,datetime de,int XD,int YD) // Sadece bir çift için tam hesaplama
  {
   RCH(sSym,db,de);
   if(ObjectFind(indicatorWindow,"oYZ"+sSym)==-1)
     {
      ObjectCreate(indicatorWindow,"oYZ"+sSym,OBJ_LABEL,indicatorWindow,0,0);
      ObjectSetInteger(indicatorWindow,"oYZ"+sSym,OBJPROP_XDISTANCE,XD);
      ObjectSetInteger(indicatorWindow,"oYZ"+sSym,OBJPROP_YDISTANCE,YD);
      ObjectSetInteger(indicatorWindow,"oYZ"+sSym,OBJPROP_CORNER,CORNER_LEFT_UPPER);
      ObjectSetString(indicatorWindow,"oYZ"+sSym,OBJPROP_TEXT,sSym);
      ObjectSetString(indicatorWindow,"oYZ"+sSym,OBJPROP_FONT,"Arial");
      ObjectSetInteger(indicatorWindow,"oYZ"+sSym,OBJPROP_FONTSIZE,7);
      ObjectSetInteger(indicatorWindow,"oYZ"+sSym,OBJPROP_COLOR,lColorSym);
      ObjectSetInteger(indicatorWindow,"oYZ"+sSym,OBJPROP_SELECTABLE,true);
     }
   if(ObjectFind(indicatorWindow,"oYZ_"+sSym)==-1)
     {
      ObjectCreate(indicatorWindow,"oYZ_"+sSym,OBJ_LABEL,indicatorWindow,0,0);
      ObjectSetInteger(indicatorWindow,"oYZ_"+sSym,OBJPROP_XDISTANCE,XD+45);
      ObjectSetInteger(indicatorWindow,"oYZ_"+sSym,OBJPROP_YDISTANCE,YD);
      ObjectSetInteger(indicatorWindow,"oYZ_"+sSym,OBJPROP_CORNER,CORNER_LEFT_UPPER);
      ObjectSetString(indicatorWindow,"oYZ_"+sSym,OBJPROP_TEXT,sSym);
      ObjectSetString(indicatorWindow,"oYZ_"+sSym,OBJPROP_FONT,"Arial");
      ObjectSetInteger(indicatorWindow,"oYZ_"+sSym,OBJPROP_FONTSIZE,7);
      ObjectSetInteger(indicatorWindow,"oYZ_"+sSym,OBJPROP_COLOR,lColorCH);
      ObjectSetInteger(indicatorWindow,"oYZ_"+sSym,OBJPROP_SELECTABLE,true);
     }
   YD=YD+11;

   lColor=lColorCH;
   if(sSymb.CH>0)
     {
      lColor=lColorChPlus;
      ObjectSetString(indicatorWindow,"oYZ_"+sSym,OBJPROP_TEXT," "+DoubleToString(sSymb.CH,5));
      ObjectSetInteger(indicatorWindow,"oYZ_"+sSym,OBJPROP_XDISTANCE,XD+45);
     }
   if(sSymb.CH<0)
     {
      lColor=lColorChMinus;
      ObjectSetString(indicatorWindow,"oYZ_"+sSym,OBJPROP_TEXT,DoubleToString(sSymb.CH,5));
      ObjectSetInteger(indicatorWindow,"oYZ_"+sSym,OBJPROP_XDISTANCE,XD+46);
     }
   ObjectSetInteger(indicatorWindow,"oYZ_"+sSym,OBJPROP_COLOR,lColor);
  }
//
// sınıf sonu
//
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////





//////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//
// Sınıfın kullanıldığı kod
// 

CChmcYZ chmc;
//+------------------------------------------------------------------+
//||
//+------------------------------------------------------------------+
int OnInit()
  {
//--- gösterge tamponları eşleme
   chmc.RCHsay("EURUSD",TimeCurrent()-86400*5,TimeCurrent(),5,16); // CH% gününü hesaplayın
   chmc.RCHsay("AUDUSD",TimeCurrent()-86400*5,TimeCurrent(),5,16+12   );
   chmc.RCHsay("GBPUSD",TimeCurrent()-86400*5,TimeCurrent(),5,16+12*2 );
   chmc.RCHsay("USDCHF",TimeCurrent()-86400*5,TimeCurrent(),5,16+12*3 );
   chmc.RCHsay("USDCAD",TimeCurrent()-86400*5,TimeCurrent(),5,16+12*4 );
   return(0);
  }
//+------------------------------------------------------------------+
//||
//+------------------------------------------------------------------+
int OnCalculate(const int rates_total,
                const int prev_calculated,
                const datetime &time[],
                const double &open[],
                const double &high[],
                const double &low[],
                const double &close[],
                const long &tick_volume[],
                const long &volume[],
                const int &spread[])
  {
   chmc.RCHsay("EURUSD",TimeCurrent()-86400*5,TimeCurrent(),5,16); // CH% gününü hesaplayın
   chmc.RCHsay("AUDUSD",TimeCurrent()-86400*5,TimeCurrent(),5,16+12   );
   chmc.RCHsay("GBPUSD",TimeCurrent()-86400*5,TimeCurrent(),5,16+12*2 );
   chmc.RCHsay("USDCHF",TimeCurrent()-86400*5,TimeCurrent(),5,16+12*3 );
   chmc.RCHsay("USDCAD",TimeCurrent()-86400*5,TimeCurrent(),5,16+12*4 );
   return(rates_total);
  }

 void OnDeinit()
  {
   int i=ObjectsTotal(0); // nesnelerimizi sil
   while( i > 0  )
     {
      if(StringSubstr(ObjectName(0,i ),0,3)=="oYZ")
        {
         ObjectDelete(0,ObjectName(0,i ));
        }
        i--;
      }
  }

MetaQuotes Ltd tarafından Rusçadan çevrilmiştir.
Orijinal kod: https://www.mql5.com/ru/code/11347

MACD Signals MACD Signals

Yeni platform için gösterge sürümü.

CTsLogger basit ve esnek bir kayıt sistemidir CTsLogger basit ve esnek bir kayıt sistemidir

Tek tek modülleri veya kod bölümlerini günlüğe kaydetme özelliğine sahip kaydedici

YURAZ_RSAXEL Senaryo Rudolf Axel seviyelerini çizer YURAZ_RSAXEL Senaryo Rudolf Axel seviyelerini çizer

Senaryo Rudolph Axel seviyelerini çiziyor

RSI Sapması RSI Sapması

Bu gösterge RSI sapmalarını alır ve EA'ları otomatikleştirmek için bunları tamponlara yerleştirir