코딩 도움말 - 페이지 775

 

이 문제를 도와주세요.

아래는 MA 교차 경고이지만 동일한 알림 1개당 너무 많은 메시지를 받았습니다.

2개의 연속 막대당 1개의 알림을 받고 싶습니다 . 다음 경고 전에 건너뛸 막대 수가 2개라는 의미입니다.

어떻게 하면 될까요, 친절하게 도와주세요. 정말 감사합니다



 //+------------------------------------------------------------------+

//|                MA Cross Arrows.mq4                               |

//|                Copyright © 2006  Scorpion@fxfisherman.com        |

//+------------------------------------------------------------------+

#property copyright "FxFisherman.com"

#property link        "http://www.fxfisherman.com"



#property indicator_chart_window

#property indicator_buffers 3

#property indicator_color1 Blue

#property indicator_color2 White

#property indicator_color3 Red



extern int Crossed_Pips = 0 ;

extern int MA_Period = 21 ;

extern int MA_Type = MODE_SMA ;

extern int Shift_Bars= 0 ;

extern int Bars_Count= 1000 ;

int state;

  

//---- buffers

double v1[];

double v2[];

double v3[];

  





int start()

 {

   double ma;

   int previous;

   int i;

   int shift;

   bool crossed_up, crossed_down;

   int totalBars = Bars - (MA_Period * 2 );

  

   if (Bars_Count > 0 && Bars_Count <= totalBars)

  {

    i = Bars_Count;

  } else if (totalBars <= 0 ) {

     return ( 0 );

  } else {

    i = totalBars;

  }

  

   while (i>= 0 )

   {

    shift = i + Shift_Bars;

    ma = iMA ( Symbol (), Period (), MA_Period, 0 , MA_Type, PRICE_CLOSE , shift);

    crossed_up = High [shift] >= (ma + (Crossed_Pips * Point ));

    crossed_down = Low [shift] <= (ma - (Crossed_Pips * Point ));



    v1[i] = NULL ;

    v2[i] = NULL ;    

    v3[i] = ma;

     if (crossed_up && previous != 1 ) {

      v1[i] = ma + (Crossed_Pips * Point );

      previous = 1 ;

    } else if (crossed_down && previous != 2 ){

      v2[i] = ma - (Crossed_Pips * Point );

      previous = 2 ;

    }

 

    i--;

   }

   

   ma = iMA ( Symbol (), Period (), MA_Period, 0 , MA_Type, PRICE_CLOSE , 0 );

   if ( Close [ 0 ] >= ma + (Crossed_Pips * Point ) && state != 1 ) { 

      state = 1 ;

       SendNotification ( Symbol () + "M" + _Period + " Price crossed UP EMA21." );

   } else if ( Close [ 0 ] <= ma - (Crossed_Pips * Point ) && state != - 1 ) {

      state = - 1 ;

       SendNotification ( Symbol () + "M" + _Period + " Price cross DOWN the EMA21." );

   }



   return ( 0 );

 }
 

extern 변수를 선언하면 "extern-unexpected token" 오류 메시지가 나타납니다.

도와주세요

파일:
error1.zip  116 kb
 
Ricardo Schuller :

extern 변수를 선언하면 "extern-unexpected token" 오류 메시지가 나타납니다.

도와주세요

메서드나 함수 내에서 extern을 사용할 수 없습니다.

 

오류를 수정하는 방법 ??

 
Mo3tasemovic :

오류를 수정하는 방법 ??

" GBPUSD "

 
Keith Watford :

" GBPUSD "

감사해요

 
pivboll :

지표를 수정하는 데 도움이 필요합니다.

Buff Dormeier 책 Investing with volume analysis에 설명된 대로 MACD 지표를 추세 추력 지표로 바꾸려고 합니다.

변수에 문제가 있고 적절한 결과를 얻을 수 없습니다. 작동하는 volWMA와 VW MACD를 첨부합니다.

다음은 설명입니다.

추세 추력 표시기

볼륨 가중 이동 평균 수렴/다이버전스(VW-Macd) 지표의 향상된 버전인 추세 추력 지표(Tti)는 제 책 Investing With Volume Analysis에서 소개되었습니다. Tti는 거래량 가중 이동 평균에 대한 거래량의 영향을 과장하기 위해 고유한 방식으로 거래량 승수를 사용합니다. VW-Macd와 마찬가지로 Tti는 지수 이동 평균과 반대로 거래량 가중 이동 평균을 사용합니다. 거래량 가중 평균은 각 기간 동안 거래된 거래량에 비례하여 종가에 가중치를 주기 때문에 Tti는 거래량이 많을수록 가격 추세를 더 강조하고 거래량이 적은 기간에는 덜 강조합니다. Stocks & Commodities 2001년 2월호에서 거래량 가중 이동 평균(버프 평균 또는 Vwmas)이 응답성을 향상시키면서 단순 이동 평균의 신뢰성을 높이는 것을 보여주었습니다.

Macd 및 VW-Macd와 마찬가지로 Tti는 긴(느린) 평균에서 짧은(빠른) 평균을 빼서 스프레드를 계산합니다. 볼륨 승수와 결합된 이 스프레드는 버프 스프레드를 만듭니다.

계산은 다음과 같습니다

볼륨 승수 = 빠른 VolWMA / 느린 VolWMA

볼륨 승수는 두 번째 거듭제곱으로 가져온 다음 빠른 VolWMA를 곱하여 볼륨 향상 빠른 평균을 제공합니다.

볼륨 승수는 두 번째 거듭제곱으로 가져온 다음 SLOW VolWMA를 곱하여 볼륨 향상 느린 평균을 제공합니다.

TTi = 빠른 평균 향상 - 느린 평균 향상

도와주셔서 감사합니다

표시기 링크: https://www.sendspace.com/file/rfy2dv

안녕, 친구. TTI를 정리한 적이 있습니까? 여기에 공유하거나 PM을 통해 저를 보낼 수 있습니까? 감사해요

 
Hi
이 문제를 도와주세요.
kinjun sen(inichimoku)과의 가격 입찰 차이가 1분 시간에 3핍(30포인트)보다 클 때마다 푸시 알림을 보내는 EA가 필요합니다.
 

하이,


pls는 이 표시기에 대한 사운드 경고, 메시지 경고 및 모바일 알림 옵션을 추가합니다.

감사해요

파일:
 

안녕

"iCustom이 잘못된 값을 반환함"과 같은 주제를 찾았지만 이것은 약간 다릅니다.

동일한 유형의 막대(황소/곰 유형)의 크기를 순서대로 비교하는 지표를 만들려고 합니다.

비교의 최대값을 히스토그램으로 표시합니다.

이와 같이.

최대값

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

ArrayMaximum을 사용하면 결과가 더 빨라집니다. 하지만 내 code.example에 문제가 있습니다.

iCustom_diff

다음은 iCustom 값을 비교하고 잘못된 값을 반환하는 코드입니다.

 #property indicator_separate_window
#property indicator_buffers 4


#property indicator_color1 DeepSkyBlue
#property indicator_width1 10


#property indicator_color2 Red
#property indicator_width2 10



#property indicator_color3 DodgerBlue
#property indicator_width3 4


#property indicator_color4 Crimson
#property indicator_width4 4


#property indicator_level1 0
#property indicator_levelcolor White
#property indicator_levelstyle 0


string LF = "\n" ;   // use this in custom or utility blocks where you need line feeds
int ObjCount = 0 ;   // count of all objects created on the chart, allows creation of objects with unique names
int current = 0 ; // variable points to current bar


double Buffer1[];
double Buffer2[];

double Buffer3[];
double Buffer4[];


double bar_0;
double bar_1;
double bar_2;
double bar_3;
double bar_4;
double bar_5;
double bar_6;
double bar_7;
double bar_8;
double bar_9;
double bar_10;
double bar_11;


//+------------------------------------------------------------------+
int init()
{
     if ( false ) ObjectsDeleteAll ();       // clear the chart

     IndicatorDigits ( Digits - 5 );
     IndicatorBuffers ( 4 );
    
     SetIndexBuffer ( 0 , Buffer1);
     SetIndexStyle ( 0 , DRAW_HISTOGRAM , STYLE_SOLID );
    
     SetIndexBuffer ( 1 , Buffer2);
     SetIndexStyle ( 1 , DRAW_HISTOGRAM , STYLE_SOLID );
    
    
    
    
     SetIndexBuffer ( 2 , Buffer3);
     SetIndexStyle ( 2 , DRAW_HISTOGRAM , STYLE_SOLID );
    
     SetIndexBuffer ( 3 , Buffer4);
     SetIndexStyle ( 3 , DRAW_HISTOGRAM , STYLE_SOLID );
    
    
     return ( 0 );
}


//+------------------------------------------------------------------+
int deinit()
{
if ( false ) ObjectsDeleteAll ();

return ( 0 );
}


//+------------------------------------------------------------------+
int start()
{
OnEveryTick1();

return ( 0 );
}
//+------------------------------------------------------------------+
void OnEveryTick1()
{
    
     int i;
     int counted_bars = IndicatorCounted ();
     if (counted_bars < 0 ) return (- 1 );
     if (counted_bars > 0 ) counted_bars--;
    i = Bars - counted_bars - 1 ;
     // main calculation loop
     while (i >= 0 )
    
{
current = i;
        
//current  >0
//current+1=0
TechnicalAnalysis00();

//current  >0
//current+1>0
//current+2=0
TechnicalAnalysis01();

//current  >0
//current+1>0
//current+2>0
//current+3=0
TechnicalAnalysis02();


i--;
}
}

//-----------------------------------------------------
//---------bar_0-------------------------------
//-----------------------------------------------------
void TechnicalAnalysis00()
{

bar_0 = iCustom ( NULL , NULL , "candles_from_chart-celi_masivi" , 0 ,current);
bar_1 = iCustom ( NULL , NULL , "candles_from_chart-celi_masivi" , 0 ,current+ 1 );

if
(
bar_0 > 0
&&
bar_1 == 0
)

{
Histogram00();
}

}

void Histogram00()
{
Buffer1[current]= bar_0;
}
//-----------------------------------------------------
//---------bar_1-------------------------------
//-----------------------------------------------------
void TechnicalAnalysis01()
{

bar_0 = iCustom ( NULL , NULL , "candles_from_chart-celi_masivi" , 0 ,current);
bar_1 = iCustom ( NULL , NULL , "candles_from_chart-celi_masivi" , 0 ,current+ 1 );
bar_2 = iCustom ( NULL , NULL , "candles_from_chart-celi_masivi" , 0 ,current+ 2 );

if
(
bar_0 > 0
&&
bar_1 > 0
&&
bar_2 == 0
)

{
Histogram01();
}

}

void Histogram01()
{
int x_up_01[] = { 0 , 0 };

x_up_01[ 0 ] = bar_0;
x_up_01[ 1 ] = bar_1;

int maxValue_01 = ArrayMaximum (x_up_01);

Buffer1[current]= x_up_01[maxValue_01];
}
//-----------------------------------------------------
//---------bar_2-------------------------------
//-----------------------------------------------------
void TechnicalAnalysis02()
{

bar_0 = iCustom ( NULL , NULL , "candles_from_chart-celi_masivi" , 0 ,current);
bar_1 = iCustom ( NULL , NULL , "candles_from_chart-celi_masivi" , 0 ,current+ 1 );
bar_2 = iCustom ( NULL , NULL , "candles_from_chart-celi_masivi" , 0 ,current+ 2 );
bar_3 = iCustom ( NULL , NULL , "candles_from_chart-celi_masivi" , 0 ,current+ 3 );

if
(
bar_0 > 0
&&
bar_1 > 0
&&
bar_2 > 0
&&
bar_3 == 0
)

{
Histogram02();
}

}

void Histogram02()
{
int x_up_02[] = { 0 , 0 , 0 };

x_up_02[ 0 ] = bar_0;
x_up_02[ 1 ] = bar_1;
x_up_02[ 2 ] = bar_2;

int maxValue_02 = ArrayMaximum (x_up_02);

Buffer1[current]= x_up_02[maxValue_02];
}
//-----------------------------------------------------
//---------bar_3--------and so on-----------------------
//-----------------------------------------------------

내 실수는 어디에 있습니까? 어떻게 고칠 수 있습니까?
모든 extern 매개변수로 iCustom을 호출하려고 했습니다. - 같은 잘못된 결과. 나는 외부 매개 변수없이 시도했습니다. iCustom - 동일한 잘못된 결과입니다.

도움에 감사드립니다

이를 기반으로 하는 메인 코드(첫 번째 히스토그램) 및 두 번째 코드(두 번째 히스토그램):