거래 로봇을 무료로 다운로드 하는 법을 시청해보세요
당사를 Facebook에서 찾아주십시오!
당사 팬 페이지에 가입하십시오
스크립트가 흥미로우신가요?
그렇다면 링크 to it -
하셔서 다른 이들이 평가할 수 있도록 해보세요
스크립트가 마음에 드시나요? MetaTrader 5 터미널에서 시도해보십시오
지표

YURAZ_MCCH - MetaTrader 5용 지표

Yuriy Zaytsev
Yuriy Zaytsev
  • Свободный художник 에  Сам на себя
  • 러시아
  • 24051
5 (20)
My EA took 6th place among the world's best EA developer in the world in 2007
https://championship.mql5.com/2011/ru/users/index
| Korean English Русский 中文 Español Deutsch 日本語 Português Français Italiano Türkçe
조회수:
252
평가:
(33)
게시됨:
업데이트됨:
MQL5 프리랜스 이 코드를 기반으로 한 로봇이나 지표가 필요하신가요? 프리랜스로 주문하세요 프리랜스로 이동

이 지표는 종가(CLOSE)를 기준으로 상승 또는 하락률을 계산하며, 객체 지향 프로그래밍(OOP)을 적용하여 작성되었으므로 어떤 Expert Advisor나 다른 지표에도 쉽게 통합할 수 있습니다.

  • 이 지표는 CH%를 계산하며, 이는 전일 종가 대비 변동률을 나타냅니다.
  • 차트에 객체를 생성합니다. 이 지표는 객체 지향 프로그래밍(OOP) 방식으로 작성되었습니다.
  • 어떤 Expert Advisor나 다른 지표에도 매우 쉽게 통합할 수 있으며, 클래스를 정의하고 호출 방식을 설정하기만 하면 됩니다.

다른 지표나 자동 거래 시스템에 내장될 때 필요한 코드의 양을 가늠해 보실 수 있습니다.

단 2줄입니다.

CChmcYZ chmc;

chmc.RCHsay("EURUSD",TimeCurrent()-86400*5,TimeCurrent(),5,16); // 오늘의 CH%를 계산해 봅시다

객체 지향 프로그래밍(OOP)은 폭넓은 가능성을 제공하며, 필요한 클래스를 작성한 후 이를 기반으로 구성을 진행합니다...


//+------------------------------------------------------------------+
//|                                                   yuraz_mcch.mq5 |
//|                        Copyright 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


//////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// 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; // 메인 창에서 작업 중
   void CChmcYZ()    { 
   indicatorWindow=0;
   lColorSym=DarkBlue; //  DarkTurquoise
   lColorCH=DarkGreen; // White; 
   lColorChPlus  = Green; // LimeGreen;
   lColorChMinus = FireBrick ; // Red;
    } // 생성자
   void              RCH(string sSym,datetime db,datetime de);   // 한 쌍에 대한 전체 계산만 수행하고 결과는 표시하지 않음
   void              RCHsay(string sSym,datetime db,datetime de,int X,int Y); // 한 쌍에 대한 전체 계산 및 그 결과 표시
private:
   color lColor;
   double            dClose[7000];                    // 최고 가격을 복사하기 위한 배열
  };
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
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;
        }
     }
  }
//+------------------------------------------------------------------+
//| 계산 및 출력
//+------------------------------------------------------------------+
void CChmcYZ::RCHsay(string sSym,datetime db,datetime de,int XD,int YD) // 한 쌍에 대한 전체 계산
  {
   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);
  }
//
// 클래스 끝
//
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////





//////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//
// 해당 클래스가 사용된 코드
// 

CChmcYZ chmc;
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
int OnInit()
  {
//--- 인디케이터 버퍼 매핑
   chmc.RCHsay("EURUSD",TimeCurrent()-86400*5,TimeCurrent(),5,16); // 오늘의 CH%를 계산해 봅시다
   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%를 계산해 봅시다
   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); // 우리 객체들을 삭제합니다
   while( i > 0  )
     {
      if(StringSubstr(ObjectName(0,i ),0,3)=="oYZ")
        {
         ObjectDelete(0,ObjectName(0,i ));
        }
        i--;
      }
  }

MetaQuotes Ltd에서 러시아어로 번역함.
원본 코드: https://www.mql5.com/ru/code/11347

MACD Signals MACD Signals

새로운 플랫폼용 지표 버전.

간단하고 유연한 로깅 시스템인 CTsLogger 간단하고 유연한 로깅 시스템인 CTsLogger

개별 모듈 또는 코드 섹션을 로깅하는 기능이 있는 로거

YURAZ_RSAXEL 스크립트는 루돌프 악셀의 레벨을 표시합니다 YURAZ_RSAXEL 스크립트는 루돌프 악셀의 레벨을 표시합니다

이 스크립트는 루돌프 악셀의 레벨을 그립니다

RSI 다이버전스 RSI 다이버전스

이 지표는 RSI 다이버전스를 가져와 버퍼에 플롯하여 EA를 자동화합니다.