표시기 내부 텍스트 - 페이지 2 12345 새 코멘트 antonio 2010.01.28 19:10 #11 Antt에게 감사하지만 내가 찾고 있던 것은 아닙니다. 이 예와 같이 텍스트를 삽입합니다. RSI +-value of CSR....이 가능합니까? Anton 2010.01.29 13:22 #12 supermagix : Antt에게 감사하지만 내가 찾고 있던 것은 아닙니다. 이 예와 같이 텍스트를 삽입합니다. RSI +-value of CSR....이 가능합니까? //+------------------------------------------------------------------+//| RSI.mq5 |//| Copyright 2009, MetaQuotes Software Corp. |//| http://www.mql5.com |//+------------------------------------------------------------------+#property copyright "Copyright 2009, MetaQuotes Software Corp."#property link "http://www.mql5.com"#property description "Relative Strength Index"//--- indicator settings#property indicator_separate_window#property indicator_minimum 0#property indicator_maximum 100#property indicator_level1 30#property indicator_level2 70#property indicator_buffers 3#property indicator_plots 1#property indicator_type1 DRAW_LINE#property indicator_color1 DodgerBlue//--- input parametersinput int InpPeriodRSI=14; // Period//--- indicator buffersdouble ExtRSIBuffer[];double ExtPosBuffer[];double ExtNegBuffer[];//--- global variableint ExtPeriodRSI;//---int window ;string objectName="RsiText"; //+------------------------------------------------------------------+//| Custom indicator initialization function |//+------------------------------------------------------------------+void OnInit() {//--- check for input if(InpPeriodRSI<1) { ExtPeriodRSI=12; Print("Incorrect value for input variable InpPeriodRSI =",InpPeriodRSI, "Indicator will use value =",ExtPeriodRSI,"for calculations."); } else ExtPeriodRSI=InpPeriodRSI;//--- indicator buffers mapping SetIndexBuffer(0,ExtRSIBuffer,INDICATOR_DATA); SetIndexBuffer(1,ExtPosBuffer,INDICATOR_CALCULATIONS); SetIndexBuffer(2,ExtNegBuffer,INDICATOR_CALCULATIONS);//--- set accuracy IndicatorSetInteger(INDICATOR_DIGITS,2);//--- sets first bar from what index will be drawn PlotIndexSetInteger(0,PLOT_DRAW_BEGIN,ExtPeriodRSI);//--- name for DataWindow and indicator subwindow label IndicatorSetString(INDICATOR_SHORTNAME,"RSI("+string(ExtPeriodRSI)+")");//--- get window number window=ChartWindowFind(); //--- initialization done }//+------------------------------------------------------------------+//| Relative Strength Index |//+------------------------------------------------------------------+int OnCalculate(const int rates_total, const int prev_calculated, const int begin, const double &price[]) { int i; double diff;//--- check for rates count if(rates_total<=ExtPeriodRSI) return(0);//--- preliminary calculations int pos=prev_calculated-1; if(pos<=ExtPeriodRSI) { //--- first RSIPeriod values of the indicator are not calculated ExtRSIBuffer[0]=0.0; ExtPosBuffer[0]=0.0; ExtNegBuffer[0]=0.0; double SumP=0.0; double SumN=0.0; for(i=1;i<=ExtPeriodRSI;i++) { ExtRSIBuffer[i]=0.0; ExtPosBuffer[i]=0.0; ExtNegBuffer[i]=0.0; diff=price[i]-price[i-1]; SumP+=(diff>0?diff:0); SumN+=(diff<0?-diff:0); } //--- calculate first visible value ExtPosBuffer[ExtPeriodRSI]=SumP/ExtPeriodRSI; ExtNegBuffer[ExtPeriodRSI]=SumN/ExtPeriodRSI; ExtRSIBuffer[ExtPeriodRSI]=100.0-(100.0/(1.0+ExtPosBuffer[ExtPeriodRSI]/ExtNegBuffer[ExtPeriodRSI])); //--- prepare the position value for main calculation pos=ExtPeriodRSI+1; }//--- the main loop of calculations for(i=pos;i<rates_total;i++) { diff=price[i]-price[i-1]; ExtPosBuffer[i]=(ExtPosBuffer[i-1]*(ExtPeriodRSI-1)+(diff>0.0?diff:0.0))/ExtPeriodRSI; ExtNegBuffer[i]=(ExtNegBuffer[i-1]*(ExtPeriodRSI-1)+(diff<0.0?-diff:0.0))/ExtPeriodRSI; ExtRSIBuffer[i]=100.0-100.0/(1+ExtPosBuffer[i]/ExtNegBuffer[i]); }//--- create object ObjectCreate(0,objectName,OBJ_TEXT,window,0,0); ObjectSetString(0,objectName,OBJPROP_TEXT,string(ExtRSIBuffer[rates_total-1])); ObjectSetInteger(0,objectName,OBJPROP_COLOR,Red); datetime tm[1]; CopyTime(_Symbol,_Period,0,1,tm); ObjectSetInteger(0,objectName,OBJPROP_TIME,tm[0]); ObjectSetDouble(0,objectName,OBJPROP_PRICE,ExtRSIBuffer[rates_total-1]); //--- OnCalculate done. Return new prev_calculated. return(rates_total); }//+------------------------------------------------------------------+ Text inside indicator MetaQuotes rsi.mq5 price bid/ask in an antonio 2010.01.29 16:02 #13 Antt는 완벽합니다. Now: 하위 창의 특정 지점에 있는 텍스트를 수정합니다. //+------------------------------------------------------------------+ //| RSI.mq5 | //| Copyright 2009, MetaQuotes Software Corp. | //| http://www.mql5.com | //+------------------------------------------------------------------+ #property copyright "Copyright 2009, MetaQuotes Software Corp." #property link "http://www.mql5.com" #property description "Relative Strength Index" //--- indicator settings #property indicator_separate_window #property indicator_minimum 0 #property indicator_maximum 100 #property indicator_level1 30 #property indicator_level2 70 #property indicator_buffers 3 #property indicator_plots 1 #property indicator_type1 DRAW_LINE #property indicator_color1 DodgerBlue //--- input parameters input int InpPeriodRSI= 14 ; // Period //--- indicator buffers double ExtRSIBuffer[]; double ExtPosBuffer[]; double ExtNegBuffer[]; //--- global variable int ExtPeriodRSI; //--- int window; string objectName= "RsiText" ; //+------------------------------------------------------------------+ //| Custom indicator initialization function | //+------------------------------------------------------------------+ void OnInit() { //--- check for input if (InpPeriodRSI< 1 ) { ExtPeriodRSI= 12 ; Print ( "Incorrect value for input variable InpPeriodRSI =" ,InpPeriodRSI, "Indicator will use value =" ,ExtPeriodRSI, "for calculations." ); } else ExtPeriodRSI=InpPeriodRSI; //--- indicator buffers mapping SetIndexBuffer ( 0 ,ExtRSIBuffer, INDICATOR_DATA ); SetIndexBuffer ( 1 ,ExtPosBuffer, INDICATOR_CALCULATIONS ); SetIndexBuffer ( 2 ,ExtNegBuffer, INDICATOR_CALCULATIONS ); //--- set accuracy IndicatorSetInteger ( INDICATOR_DIGITS , 2 ); //--- sets first bar from what index will be drawn PlotIndexSetInteger ( 0 , PLOT_DRAW_BEGIN ,ExtPeriodRSI); //--- name for DataWindow and indicator subwindow label IndicatorSetString ( INDICATOR_SHORTNAME , "RSI(" + string (ExtPeriodRSI)+ ")" ); //--- get window number window= ChartWindowFind (); //--- initialization done } //+------------------------------------------------------------------+ //| Relative Strength Index | //+------------------------------------------------------------------+ int OnCalculate( const int rates_total, const int prev_calculated, const int begin, const double &price[]) { int i; double diff; //--- check for rates count if (rates_total<=ExtPeriodRSI) return ( 0 ); //--- preliminary calculations int pos=prev_calculated- 1 ; if (pos<=ExtPeriodRSI) { //--- first RSIPeriod values of the indicator are not calculated ExtRSIBuffer[ 0 ]= 0.0 ; ExtPosBuffer[ 0 ]= 0.0 ; ExtNegBuffer[ 0 ]= 0.0 ; double SumP= 0.0 ; double SumN= 0.0 ; for (i= 1 ;i<=ExtPeriodRSI;i++) { ExtRSIBuffer[i]= 0.0 ; ExtPosBuffer[i]= 0.0 ; ExtNegBuffer[i]= 0.0 ; diff=price[i]-price[i- 1 ]; SumP+=(diff> 0 ?diff: 0 ); SumN+=(diff< 0 ?-diff: 0 ); } //--- calculate first visible value ExtPosBuffer[ExtPeriodRSI]=SumP/ExtPeriodRSI; ExtNegBuffer[ExtPeriodRSI]=SumN/ExtPeriodRSI; ExtRSIBuffer[ExtPeriodRSI]= 100.0 -( 100.0 /( 1.0 +ExtPosBuffer[ExtPeriodRSI]/ExtNegBuffer[ExtPeriodRSI])); //--- prepare the position value for main calculation pos=ExtPeriodRSI+ 1 ; } //--- the main loop of calculations for (i=pos;i<rates_total;i++) { diff=price[i]-price[i- 1 ]; ExtPosBuffer[i]=(ExtPosBuffer[i- 1 ]*(ExtPeriodRSI- 1 )+(diff> 0.0 ?diff: 0.0 ))/ExtPeriodRSI; ExtNegBuffer[i]=(ExtNegBuffer[i- 1 ]*(ExtPeriodRSI- 1 )+(diff< 0.0 ?-diff: 0.0 ))/ExtPeriodRSI; ExtRSIBuffer[i]= 100.0 - 100.0 /( 1 +ExtPosBuffer[i]/ExtNegBuffer[i]); } //--- create object ObjectCreate ( 0 ,objectName, OBJ_TEXT ,window, 0 , 0 ); ObjectSetString ( 0 ,objectName, OBJPROP_TEXT , string (ExtRSIBuffer[rates_total- 1 ])); ObjectSetInteger ( 0 ,objectName, OBJPROP_COLOR , Red ); ObjectSetString ( 0 ,objectName, OBJPROP_FONT , "Arial" ); ObjectSetInteger ( 0 ,objectName, OBJPROP_FONTSIZE , 20 ); ObjectSetInteger ( 0 ,objectName, OBJPROP_XDISTANCE , 100 ); ObjectSetInteger ( 0 ,objectName, OBJPROP_YDISTANCE , 100 ); datetime tm[ 1 ]; CopyTime ( _Symbol , _Period , 0 , 1 ,tm); ObjectSetInteger ( 0 ,objectName, OBJPROP_TIME ,tm[ 0 ]); ObjectSetDouble ( 0 ,objectName, OBJPROP_PRICE ,ExtRSIBuffer[rates_total- 1 ]); //--- OnCalculate done. Return new prev_calculated. return (rates_total); } //+------------------------------------------------------------------+ 추가했습니다: objprop_xdistance 하지만 function . 왜요 ? 다시 감사합니다 Anton 2010.01.29 18:13 #14 supermagix : Antt는 완벽합니다. Now: 하위 창의 특정 지점에 있는 텍스트를 수정합니다. 추가했습니다: objprop_xdistance 하지만 function . 왜요 ? 다시 감사합니다 ObjectCreate ( 0 ,objectName, OBJ_LABEL ,window, 0 , 0 ); antonio 2010.01.29 20:10 #15 antt : 와우........ 예쁘다 개미 내가 찾던건데.... 이제 가능하면 다시 도움을 요청합니다. 이 CCI를 구축했지만 CCI가 0선 위 또는 아래에 있을 때 히스토그램을 보고 색상을 변경할 수 없습니다. 왜요? 도와 줘서 고마워 //+------------------------------------------------------------------+ //| RSI.mq5 | //| Copyright 2009, MetaQuotes Software Corp. | //| http://www.mql5.com | //+------------------------------------------------------------------+ #property copyright "Copyright 2009, MetaQuotes Software Corp." #property link "http://www.mql5.com" #property description "Relative Strength Index" //--- indicator settings #property indicator_separate_window #property indicator_buffers 4 #property indicator_plots 3 //--- input parameters input int CCIPeriod= 14 ; // Period for calculating the CCI input int CCIPeriodTurbo= 6 ; // Period for calculating the TURBOCCI input ENUM_APPLIED_PRICE price1 = PRICE_CLOSE ; // Method of calculating //---- plot CCI_LINE #property indicator_label1 "CCI_LINE" #property indicator_type1 DRAW_LINE #property indicator_color1 Black #property indicator_style1 STYLE_SOLID #property indicator_width1 3 //---- plot CCI_TURBO_LINE #property indicator_label2 "CCI_TURBO_LINE" #property indicator_type2 DRAW_LINE #property indicator_color2 Navy #property indicator_style2 STYLE_SOLID #property indicator_width2 1 //---- plot CCI_HISTOGRAM #property indicator_label3 "CCI_HISTO" #property indicator_type3 DRAW_COLOR_HISTOGRAM #property indicator_color3 Red,Green #property indicator_style3 STYLE_SOLID #property indicator_width3 2 //----- level #property indicator_level1 - 100.0 #property indicator_level2 100.0 #property indicator_level3 - 200.0 #property indicator_level4 200.0 #property indicator_level5 - 50.0 #property indicator_level6 50.0 //--- indicator buffers double CCI_LINEBuffer[]; // CCI_LINE double CCI_TURBOBuffer[]; // CCI TURBO_LINE double HISTOGRAM[]; // HISTOGRAM int copied; //+------------------------------------------------------------------+ //| Custom indicator initialization function | //+------------------------------------------------------------------+ void OnInit() { //--- indicator buffers mapping SetIndexBuffer ( 0 ,CCI_LINEBuffer, INDICATOR_DATA ); //buffer LINE SetIndexBuffer ( 1 ,CCI_TURBOBuffer, INDICATOR_DATA ); //buffer Turbo SetIndexBuffer ( 2 ,HISTOGRAM, INDICATOR_COLOR_INDEX ); //buffer Histogram //name of separate window IndicatorSetString ( INDICATOR_SHORTNAME , "MYCCI" ); //--- } //+------------------------------------------------------------------+ //| Custom indicator iteration function | //+------------------------------------------------------------------+ int OnCalculate( const int rates_total, const int prev_calculated, const int begin, const double &price[] ) { //--- Create the indicator of CCI LINR int CCIhandle= iCCI ( NULL , 0 ,CCIPeriod,price1); copied= CopyBuffer (CCIhandle, 0 , 0 ,rates_total,CCI_LINEBuffer); //--- Create the indicator of CCI TURBO int CCI_TURBO_handle= iCCI ( NULL , 0 ,CCIPeriodTurbo,price1); copied= CopyBuffer (CCI_TURBO_handle, 0 , 0 ,rates_total,CCI_TURBOBuffer); int i ; for (i= 0 ;i>=rates_total;i++); if (CCI_LINEBuffer[i]< 0 ) { HISTOGRAM[i]= 0.0 ; //HISTOGRAM RED } if (CCI_LINEBuffer[i]> 0 ) { HISTOGRAM[i]= 1.0 ; //HISTOGRAM Green } //--- return value of prev_calculated for next call return (rates_total); } Rashid Umarov 2010.01.29 21:52 #16 supermagix : 와우........ 예쁘다 개미 내가 찾던건데.... 이제 가능하면 다시 도움을 요청합니다. 이 CCI를 구축했지만 CCI가 0선 위 또는 아래에 있을 때 히스토그램을 보고 색상을 변경할 수 없습니다. 왜요? 도와 줘서 고마워 이러한 지표를 작성하기 전에 MQL5를 조금 배워야 합니다. 너무 어색한 실수를 저질렀습니다. //+------------------------------------------------------------------+ //| RSIcolor.mq5 | //| Copyright 2009, MetaQuotes Software Corp. | //| http://www.mql5.com | //+------------------------------------------------------------------+ #property copyright "Copyright 2009, MetaQuotes Software Corp." #property link "http://www.mql5.com" #property description "Relative Strength Index" //--- indicator settings #property indicator_separate_window #property indicator_buffers 4 #property indicator_plots 3 //--- input parameters input int CCIPeriod= 14 ; // Period for calculating the CCI input int CCIPeriodTurbo= 6 ; // Period for calculating the TURBOCCI input ENUM_APPLIED_PRICE price1= PRICE_CLOSE ; // Method of calculating //---- plot CCI_LINE #property indicator_label1 "CCI_LINE" #property indicator_type1 DRAW_LINE #property indicator_color1 Black #property indicator_style1 STYLE_SOLID #property indicator_width1 3 //---- plot CCI_TURBO_LINE #property indicator_label2 "CCI_TURBO_LINE" #property indicator_type2 DRAW_LINE #property indicator_color2 Navy #property indicator_style2 STYLE_SOLID #property indicator_width2 1 //---- plot CCI_HISTOGRAM #property indicator_label3 "CCI_HISTO" #property indicator_type3 DRAW_COLOR_HISTOGRAM #property indicator_color3 Red,Green #property indicator_style3 STYLE_SOLID #property indicator_width3 2 //----- level #property indicator_level1 - 100.0 #property indicator_level2 100.0 #property indicator_level3 - 200.0 #property indicator_level4 200.0 #property indicator_level5 - 50.0 #property indicator_level6 50.0 //--- indicator buffers double CCI_LINEBuffer[]; // CCI_LINE double CCI_TURBOBuffer[]; // CCI TURBO_LINE double HISTOGRAM[]; // HISTOGRAM double HISTOGRAMColor[]; // HISTOGRAM int copied; //+------------------------------------------------------------------+ //| Custom indicator initialization function | //+------------------------------------------------------------------+ void OnInit() { //--- indicator buffers mapping SetIndexBuffer ( 0 ,CCI_LINEBuffer, INDICATOR_DATA ); //buffer LINE SetIndexBuffer ( 1 ,CCI_TURBOBuffer, INDICATOR_DATA ); //buffer Turbo SetIndexBuffer ( 2 ,HISTOGRAM, INDICATOR_DATA ); //buffer Histogram SetIndexBuffer ( 3 ,HISTOGRAMColor, INDICATOR_COLOR_INDEX ); //buffer Histogram //name of separate window IndicatorSetString ( INDICATOR_SHORTNAME , "MYCCI" ); //--- } //+------------------------------------------------------------------+ //| Custom indicator iteration function | //+------------------------------------------------------------------+ int OnCalculate( const int rates_total, const int prev_calculated, const int begin, const double &price[] ) { //--- Create the indicator of CCI LINR int CCIhandle= iCCI ( NULL , 0 ,CCIPeriod,price1); copied= CopyBuffer (CCIhandle, 0 , 0 ,rates_total,CCI_LINEBuffer); //--- Create the indicator of CCI TURBO int CCI_TURBO_handle= iCCI ( NULL , 0 ,CCIPeriodTurbo,price1); copied= CopyBuffer (CCI_TURBO_handle, 0 , 0 ,rates_total,CCI_TURBOBuffer); int i=prev_calculated; if (i>0) prev_calculated--; for (;i<rates_total;i++) { HISTOGRAM[i]=CCI_LINEBuffer[i]; if (CCI_LINEBuffer[i]< 0 ) { HISTOGRAMColor[i]= 0.0 ; //HISTOGRAM RED } if (CCI_LINEBuffer[i]> 0 ) { HISTOGRAMColor[i]= 1.0 ; //HISTOGRAM Green } } //--- return value of prev_calculated for next call return (rates_total); } //+------------------------------------------------------------------+ Wolfgang 2010.01.31 10:41 #17 라벨을 오른쪽 상단 모서리 에 어떻게 넣을 수 있습니까? Rashid Umarov 2010.01.31 12:24 #18 walb99 : 레이블을 오른쪽 상단 모서리에 어떻게 넣을 수 있습니까? 차트 코너 섹션에 대한 샘플 참조 Wolfgang 2010.01.31 15:23 #19 오른쪽 상단 모서리에 RSI 값을 표시하는 방식으로 RSI 샘플 표시기를 수정할 수 있습니까? 나는 이미 거의 모든 것을 시도했지만 나에게는 불가능했습니다. antonio 2010.02.01 07:41 #20 walb99 : 오른쪽 상단 모서리에 RSI 값을 표시하는 방식으로 RSI 샘플 표시기를 수정할 수 있습니까? 나는 이미 거의 모든 것을 시도했지만 나에게는 불가능했습니다. OBJPROP_XDISTANCE 및 OBJPROP_YDISTANCE 이동 하면 최적의 지점을 찾을 수 있습니다. ObjectCreate ( 0 , "Name" , OBJ_LABEL ,window, 0 , 0 ); ObjectSetString ( 0 , "Name" , OBJPROP_TEXT , string ...................); ObjectSetInteger ( 0 , "Name" , OBJPROP_COLOR , Green ); ObjectSetString ( 0 , "Name" , OBJPROP_FONT , "Arial" ); ObjectSetInteger ( 0 , "Name" , OBJPROP_FONTSIZE , 20 ); ObjectSetInteger ( 0 , "Name" , OBJPROP_XDISTANCE , 1480 ); ObjectSetInteger ( 0 , "Name" , OBJPROP_YDISTANCE , 450 ); 12345 새 코멘트 트레이딩 기회를 놓치고 있어요: 무료 트레이딩 앱 복사용 8,000 이상의 시그널 금융 시장 개척을 위한 경제 뉴스 등록 로그인 공백없는 라틴 문자 비밀번호가 이 이메일로 전송될 것입니다 오류 발생됨 Google으로 로그인 웹사이트 정책 및 이용약관에 동의합니다. 계정이 없으시면, 가입하십시오 MQL5.com 웹사이트에 로그인을 하기 위해 쿠키를 허용하십시오. 브라우저에서 필요한 설정을 활성화하시지 않으면, 로그인할 수 없습니다. 사용자명/비밀번호를 잊으셨습니까? Google으로 로그인
Antt에게 감사하지만 내가 찾고 있던 것은 아닙니다. 이 예와 같이 텍스트를 삽입합니다. RSI +-value of CSR....이 가능합니까?
Antt에게 감사하지만 내가 찾고 있던 것은 아닙니다. 이 예와 같이 텍스트를 삽입합니다. RSI +-value of CSR....이 가능합니까?
//| RSI.mq5 |
//| Copyright 2009, MetaQuotes Software Corp. |
//| http://www.mql5.com |
//+------------------------------------------------------------------+
#property copyright "Copyright 2009, MetaQuotes Software Corp."
#property link "http://www.mql5.com"
#property description "Relative Strength Index"
//--- indicator settings
#property indicator_separate_window
#property indicator_minimum 0
#property indicator_maximum 100
#property indicator_level1 30
#property indicator_level2 70
#property indicator_buffers 3
#property indicator_plots 1
#property indicator_type1 DRAW_LINE
#property indicator_color1 DodgerBlue
//--- input parameters
input int InpPeriodRSI=14; // Period
//--- indicator buffers
double ExtRSIBuffer[];
double ExtPosBuffer[];
double ExtNegBuffer[];
//--- global variable
int ExtPeriodRSI;
//---
int window ;
string objectName="RsiText";
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
void OnInit()
{
//--- check for input
if(InpPeriodRSI<1)
{
ExtPeriodRSI=12;
Print("Incorrect value for input variable InpPeriodRSI =",InpPeriodRSI,
"Indicator will use value =",ExtPeriodRSI,"for calculations.");
}
else ExtPeriodRSI=InpPeriodRSI;
//--- indicator buffers mapping
SetIndexBuffer(0,ExtRSIBuffer,INDICATOR_DATA);
SetIndexBuffer(1,ExtPosBuffer,INDICATOR_CALCULATIONS);
SetIndexBuffer(2,ExtNegBuffer,INDICATOR_CALCULATIONS);
//--- set accuracy
IndicatorSetInteger(INDICATOR_DIGITS,2);
//--- sets first bar from what index will be drawn
PlotIndexSetInteger(0,PLOT_DRAW_BEGIN,ExtPeriodRSI);
//--- name for DataWindow and indicator subwindow label
IndicatorSetString(INDICATOR_SHORTNAME,"RSI("+string(ExtPeriodRSI)+")");
//--- get window number
window=ChartWindowFind();
//--- initialization done
}
//+------------------------------------------------------------------+
//| Relative Strength Index |
//+------------------------------------------------------------------+
int OnCalculate(const int rates_total,
const int prev_calculated,
const int begin,
const double &price[])
{
int i;
double diff;
//--- check for rates count
if(rates_total<=ExtPeriodRSI)
return(0);
//--- preliminary calculations
int pos=prev_calculated-1;
if(pos<=ExtPeriodRSI)
{
//--- first RSIPeriod values of the indicator are not calculated
ExtRSIBuffer[0]=0.0;
ExtPosBuffer[0]=0.0;
ExtNegBuffer[0]=0.0;
double SumP=0.0;
double SumN=0.0;
for(i=1;i<=ExtPeriodRSI;i++)
{
ExtRSIBuffer[i]=0.0;
ExtPosBuffer[i]=0.0;
ExtNegBuffer[i]=0.0;
diff=price[i]-price[i-1];
SumP+=(diff>0?diff:0);
SumN+=(diff<0?-diff:0);
}
//--- calculate first visible value
ExtPosBuffer[ExtPeriodRSI]=SumP/ExtPeriodRSI;
ExtNegBuffer[ExtPeriodRSI]=SumN/ExtPeriodRSI;
ExtRSIBuffer[ExtPeriodRSI]=100.0-(100.0/(1.0+ExtPosBuffer[ExtPeriodRSI]/ExtNegBuffer[ExtPeriodRSI]));
//--- prepare the position value for main calculation
pos=ExtPeriodRSI+1;
}
//--- the main loop of calculations
for(i=pos;i<rates_total;i++)
{
diff=price[i]-price[i-1];
ExtPosBuffer[i]=(ExtPosBuffer[i-1]*(ExtPeriodRSI-1)+(diff>0.0?diff:0.0))/ExtPeriodRSI;
ExtNegBuffer[i]=(ExtNegBuffer[i-1]*(ExtPeriodRSI-1)+(diff<0.0?-diff:0.0))/ExtPeriodRSI;
ExtRSIBuffer[i]=100.0-100.0/(1+ExtPosBuffer[i]/ExtNegBuffer[i]);
}
//--- create object
ObjectCreate(0,objectName,OBJ_TEXT,window,0,0);
ObjectSetString(0,objectName,OBJPROP_TEXT,string(ExtRSIBuffer[rates_total-1]));
ObjectSetInteger(0,objectName,OBJPROP_COLOR,Red);
datetime tm[1];
CopyTime(_Symbol,_Period,0,1,tm);
ObjectSetInteger(0,objectName,OBJPROP_TIME,tm[0]);
ObjectSetDouble(0,objectName,OBJPROP_PRICE,ExtRSIBuffer[rates_total-1]);
//--- OnCalculate done. Return new prev_calculated.
return(rates_total);
}
//+------------------------------------------------------------------+
Antt는 완벽합니다.
Now: 하위 창의 특정 지점에 있는 텍스트를 수정합니다.
추가했습니다: objprop_xdistance 하지만 function . 왜요 ?
다시 감사합니다
Antt는 완벽합니다.
Now: 하위 창의 특정 지점에 있는 텍스트를 수정합니다.
추가했습니다: objprop_xdistance 하지만 function . 왜요 ?
다시 감사합니다
와우........ 예쁘다 개미 내가 찾던건데....
이제 가능하면 다시 도움을 요청합니다. 이 CCI를 구축했지만 CCI가 0선 위 또는 아래에 있을 때 히스토그램을 보고 색상을 변경할 수 없습니다. 왜요?
도와 줘서 고마워
와우........ 예쁘다 개미 내가 찾던건데....
이제 가능하면 다시 도움을 요청합니다. 이 CCI를 구축했지만 CCI가 0선 위 또는 아래에 있을 때 히스토그램을 보고 색상을 변경할 수 없습니다. 왜요?
도와 줘서 고마워
이러한 지표를 작성하기 전에 MQL5를 조금 배워야 합니다. 너무 어색한 실수를 저질렀습니다.
라벨을 오른쪽 상단 모서리 에 어떻게 넣을 수 있습니까?
레이블을 오른쪽 상단 모서리에 어떻게 넣을 수 있습니까?
오른쪽 상단 모서리에 RSI 값을 표시하는 방식으로 RSI 샘플 표시기를 수정할 수 있습니까?
나는 이미 거의 모든 것을 시도했지만 나에게는 불가능했습니다.
오른쪽 상단 모서리에 RSI 값을 표시하는 방식으로 RSI 샘플 표시기를 수정할 수 있습니까?
나는 이미 거의 모든 것을 시도했지만 나에게는 불가능했습니다.
OBJPROP_XDISTANCE 및 OBJPROP_YDISTANCE 이동 하면 최적의 지점을 찾을 수 있습니다.