포럼을 어지럽히 지 않도록 모든 초보자 질문. 프로, 놓치지 마세요. 너 없이는 아무데도 - 6. - 페이지 644

 
tara :
아니요.

"10"이라고 대답하는 것이 더 유용할 것입니다! 하지만 만약에!
 
Got :

어디가 잘못되었는지 설명하고 "시장 조사"에서 도구를 찾을 수 없습니다.

i> = 0 조건에 "="를 넣으십시오.

 for ( int i= SymbolsTotal ( true )- 1 ; i> = 0 ; i--){
 
borilunad :

하단의 그래프, 속성을 클릭하고 왼쪽 상단의 그래프를 선택 취소하십시오! 그리고 일반적으로 더 많이 사용하면 편리합니다!

고맙습니다! 그것은 효과가 있었다.
 

디버거가 작동하지 않습니다. 문제가 무엇입니까?

Metatrader 빌드 646, 빌드 편집기 934. 가장 간단한 지표는 다음과 같습니다.


EURUSD , M 1 차트에서 실행하면 다음과 같습니다.

하나

저것들. 모든 것이 원래대로입니다.

이제 Alert 전에 중단점을 만들고 디버거를 시작합니다.

USDCHF , H 1 차트가 나타납니다. 어디에서 왔습니까? EURUSD , M 1만 개설되었습니다.

나는 그것을 실행하고 이것이 내가 보는 것입니다 :

저것들. 표시기는 이 USDCHF , H 1에서 데이터를 가져옵니다. 여기서 문제가 무엇입니까?

두 번째 질문입니다. 작성된 스크립트는 Editor에 의해 Scripts 폴더에 배치되지 않습니다. 디렉토리에 있지만 MQL 4 폴더에는 컴파일된 파일이 있습니다. 소스를 수동으로 Scripts 폴더로 드래그한 다음 컴파일해야 하며, 그러면 스크립트가 네비게이터에 나타납니다. 표시기가 있으면 그러한 불운이 없으며 즉시 폴더에 떨어집니다. 내가 뭔가를 잘못하고 있는 걸까, 아니면 편집자가 실수를 하고 있는 걸까?

세 번째 질문입니다. 포럼의 누군가가 5월에 650에 대해 이야기했지만 여전히 646 빌드가 있습니다. 그 이후로 정말 업데이트가 없었나요, 아니면 또 뭔가 문제가 있는 건가요?

나에게 대답하는 사람에게 행운이 있기를.

 
행운을 빌어 주셔서 감사합니다! 그러나 나는 세 번째 질문에만 대답합니다! 또한 서버가 최신 빌드로 업데이트할 때까지 646번째 빌드가 있습니다. 이것은 휴식 후 전원을 켤 때 발생합니다. 나는 이것을 세션이 시작하기 전에 일주일에 한 번 한다. 당신에게도 행운을 빕니다!
 

지표 값을 다시 계산할 때 이전 신호에 반응하지 않고 경고를 표시하고 새 신호에만 메일을 보내도록 지표에 SendMail 및 Alert를 추가하는 방법은 무엇입니까?

다음과 같은 경우:

 //+------------------------------------------------------------------+
//|                                                       simple.mq4 |
//|                                                         evillive |
//|                                                                  |
//+------------------------------------------------------------------+
#property copyright "evillive"
#property link       ""
#property version   "1.00"
#property strict
#property indicator_chart_window
#property indicator_buffers 2
#property indicator_color1 Magenta
#property indicator_color2 Aqua

//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
double Up[];
double Down[];
extern int period = 2 ;
extern int method = 1 ;
extern int price = 0 ;
extern int shift = 4 ;
extern string _alerts_= "alerts section" ;
input bool alert= false ; //show alert
input bool mail= false ; //send mail
input bool not= false ; //send push notification
//////////////////

       string dir= "" ;
       datetime tim= 0 ;

int OnInit ()
  {

   SetIndexStyle( 0 , DRAW_ARROW , EMPTY, 3 );
   SetIndexArrow( 0 , 176 );
   SetIndexBuffer ( 0 , Up);
   SetIndexStyle( 1 , DRAW_ARROW , EMPTY, 3 );
   SetIndexArrow( 1 , 176 );
   SetIndexBuffer ( 1 , Down);
   SetIndexLabel( 0 , "BUY!" );
   SetIndexLabel( 1 , "SELL!" );

   return (INIT_SUCCEEDED);
  }

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[])
  {
//---
   int i,limit;
   double ma0,ma1,atr;
//---
       if (rates_total<=(period+shift))
       return ( 0 );
//--- counting from 0 to rates_total
//--- initial zero
   if (prev_calculated< 1 )
     {
       for (i= 0 ; i<=rates_total-(period+shift); i++)
        {
         Up[i]= 0.0 ;
         Down[i]= 0.0 ;
        }
     }
//--- starting calculation
   if (prev_calculated> 0 )
      limit=rates_total-prev_calculated; //period+shift;
   else
      limit=rates_total-(period+shift);

   for (i = 1 ; i < limit; i++)
  {
      ma0 = iMA ( NULL , 0 ,period, 0 ,method,price,i);
      ma1 = iMA ( NULL , 0 ,period, 0 ,method,price,i+shift);
      atr = iATR ( NULL , 0 ,period,i);
       if (ma0>ma1 && Close[i]<Close[i+shift] && Close[i]>Close[i+period+shift])
        {
            Up[i] = (Close[i]+Open[i])/ 2 ;
            dir= "up" ;
            tim=Time[i];
            alerts(dir,tim);
        }
       if (ma0<ma1 && Close[i]>Close[i+shift] && Close[i]<Close[i+period+shift])
        {   
            Down[i] = (Close[i]+Open[i])/ 2 ;
            dir= "down" ;
            tim=Time[i];
            alerts(dir,tim);
        }
  }
   return (rates_total);
  }
//+------------------------------------------------------------------+
//+------------------------------------------------------------------+
void alerts( string d, datetime t)
{
if (!IsTesting() && ( TimeLocal ()-t)> 60 )
{
if (alert== true ) Alert ( "New " ,d, " arrow" );
if (mail== true ) SendMail ( "New signal" , StringConcatenate ( "A new " ,d, "signal detected by indicator" ));
if (not== true ) SendNotification( StringConcatenate ( "A new " ,d, "signal detected by indicator" ));
}
return ;
}

그런 다음 표시기에 영향을 미치면(차트에 설치, 설정, TF 변경, 제자리에서 점프 또는 날카로운 소리) 경고를 다시 표시 하고 차트 시작 부분 에서 모든 화살표에 메일로 보내려고 합니다. 현재로.

추가 질문 - 로그의 메일은 " 메일: '테스트 메시지'가 전송되었습니다 "로 표시되지만 편지함에는 단 한 글자도 떨어지지 않았습니다(((

 
evillive :

지표 값을 다시 계산할 때 이전 신호에 반응하지 않고 경고를 표시하고 새 신호에만 메일을 보내도록 지표에 SendMail 및 Alert를 추가하는 방법은 무엇입니까?

다음과 같은 경우:

그런 다음 표시기에 영향을 미치면(차트에 설치, 설정, TF 변경, 제자리에서 점프 또는 날카로운 소리) 경고를 다시 표시하고 차트 시작 부분에서 모든 화살표에 메일로 보내려고 합니다. 현재로.

추가 질문 - 로그의 메일은 " 메일: '테스트 메시지'가 전송되었습니다 "로 표시되지만 편지함에는 단 한 글자도 떨어지지 않았습니다(((


나는 그렇게 할 것이다

 //+------------------------------------------------------------------+
//|                                                       simple.mq4 |
//|                                                         evillive |
//|                                                                  |
//+------------------------------------------------------------------+
#property copyright "evillive"
#property link       ""
#property version   "1.00"
#property strict
#property indicator_chart_window
#property indicator_buffers 2
#property indicator_color1 Magenta
#property indicator_color2 Aqua

//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
double Up[];
double Down[];
extern int period = 2 ;
extern int method = 1 ;
extern int price = 0 ;
extern int shift = 4 ;
extern string _alerts_= "alerts section" ;
input bool alert= false ; //show alert
input bool mail= false ; //send mail
input bool not= false ; //send push notification
                     //////////////////

char dir= 0 ;
datetime tim= 0 ;
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
int OnInit ()
  {

   SetIndexStyle( 0 , DRAW_ARROW ,EMPTY, 3 );
   SetIndexArrow( 0 , 176 );
   SetIndexBuffer ( 0 ,Up);
   SetIndexStyle( 1 , DRAW_ARROW ,EMPTY, 3 );
   SetIndexArrow( 1 , 176 );
   SetIndexBuffer ( 1 ,Down);
   SetIndexLabel( 0 , "BUY!" );
   SetIndexLabel( 1 , "SELL!" );

   return (INIT_SUCCEEDED);
  }
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
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[])
  {
//---
   int i,limit;
   double ma0,ma1,atr;
//---
   if (rates_total<=(period+shift))
       return ( 0 );
//--- counting from 0 to rates_total
//--- initial zero
   if (prev_calculated< 1 )
     {
       for (i= 0 ; i<=rates_total-(period+shift); i++)
        {
         Up[i]= 0.0 ;
         Down[i]= 0.0 ;
        }
     }
//--- starting calculation
   if (prev_calculated> 0 )
      limit=rates_total-prev_calculated- 1 ; //period+shift;
   else
      limit=rates_total-(period+shift)- 1 ;

   for (i=limit; i>= 0 ; i--)
     {
      ma0 = iMA ( NULL , 0 ,period, 0 ,method,price,i);
      ma1 = iMA ( NULL , 0 ,period, 0 ,method,price,i+shift);
      atr = iATR ( NULL , 0 ,period,i);
       if (ma0>ma1 && Close[i]<Close[i+shift] && Close[i]>Close[i+period+shift])
        {
         Up[i]=(Close[i]+Open[i])/ 2 ;
        }
       if (ma0<ma1 && Close[i]>Close[i+shift] && Close[i]<Close[i+period+shift])
        {
         Down[i]=(Close[i]+Open[i])/ 2 ;
        }
     }
       if (ma0>ma1 && Close[ 0 ]<Close[shift] && Close[ 0 ]>Close[period+shift])
        {
         if (dir!= 1 ) {
            dir= 1 ;
            alerts( "UP" ,Time[ 0 ]);
         }
        }
       if (ma0<ma1 && Close[i]>Close[i+shift] && Close[i]<Close[i+period+shift])
        {
         if (dir!=- 1 ){
            dir=- 1 ;
            alerts( "DOWN" ,Time[ 0 ]);
         }
        }

   

   return (rates_total);
  }
//+------------------------------------------------------------------+
//+------------------------------------------------------------------+
void alerts( string d, datetime t)
  {
   if (!IsTesting() && ( TimeLocal ()-t)> 60 )
     {
       if (alert== true ) Alert ( "New " ,d, " arrow" );
       if (mail== true ) SendMail ( "New signal" , StringConcatenate ( "A new " ,d, "signal detected by indicator" ));
       if (not== true ) SendNotification( StringConcatenate ( "A new " ,d, "signal detected by indicator" ));
     }
   return ;
  }
//+------------------------------------------------------------------+
 
Vinin :


나는 그렇게 할 것이다

추가된 행 은 루프 외부에 있어야 합니까, 아니면 오타입니까?
모든 것이 있어야 하는 대로 이해합니다.
 

안녕하세요, 위치 평균화를 위한 템플릿이 있는 사람이 있습니까?

즉, 주문이 열렸고 수익성이 없다면 같은 방향으로 두 번째 주문을 열 때 우리는 이러한 주문 사이에 중간에 스톱을 두는 식으로 3 주문, 4 주문 ...?

 
Top2n :

안녕하세요, 위치 평균화를 위한 템플릿이 있는 사람이 있습니까?

즉, 주문이 열렸고 수익성이 없다면 같은 방향으로 두 번째 주문을 열 때 우리는 이러한 주문 사이에 중간에 스톱을 두는 식으로 3 주문, 4 주문 ...?


모든 시가 를 취하고 산술 평균을 계산하십시오.