[ARCHIVE] 포럼을 어지럽히 지 않도록 초보자 질문. 프로, 놓치지 마세요. 너 없이는 아무데도 - 3. - 페이지 295

 

표준 stockcast, 올바르게 작동하지 않는 경고를 추가했습니다 . 오류가 어디에 있는지 알 수 없습니다....

감사해요

 //+------------------------------------------------------------------+
//|                                                   Stochastic.mq4 |
//|                      Copyright © 2004, MetaQuotes Software Corp. |
//+------------------------------------------------------------------+

#property indicator_separate_window
#property indicator_buffers 2
#property indicator_color1 Green
#property indicator_color2 Red
#property  indicator_width1 1
#property  indicator_width2 1
#property indicator_level1 20
#property indicator_level2 50
#property indicator_level3 80
#property indicator_levelcolor DimGray
//---- input parameters
//+------------------------------------------------------------------+
extern bool Alerts  = true;
//+------------------------------------------------------------------+
extern int AlertBar = 1 ; 
//+------------------------------------------------------------------+
extern int KPeriod  = 5 ;
//+------------------------------------------------------------------+
extern int DPeriod  = 2 ;
//+------------------------------------------------------------------+
extern int Slowing  = 3 ;
//+------------------------------------------------------------------+
extern int MAMethod = 3 ; // 0=SMA,1=EMA,2=SSMA,3=LWMA
//+------------------------------------------------------------------+
//-------------------------------------------------------------------+
//-----
datetime LastAlertTime = - 333 ;
//---- Buffers
double MainBuffer[];
double SignalBuffer[];
double HighesBuffer[];
double LowesBuffer[];
//----
int     MAMode;
string strMAType;
//----
int draw_begin1= 0 ;
int draw_begin2= 0 ;
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
{
   string short_name;
//---- 2 additional buffers are used for counting.
   IndicatorBuffers ( 4 );
//---- indicator lines
   SetIndexStyle ( 0 , DRAW_LINE , STYLE_SOLID , 1 );
   SetIndexBuffer ( 0 ,MainBuffer);
   SetIndexStyle ( 1 , DRAW_LINE , STYLE_SOLID , 1 );
   SetIndexBuffer ( 1 ,SignalBuffer);
//----
   SetIndexBuffer ( 2 ,HighesBuffer);
   SetIndexBuffer ( 3 ,LowesBuffer);
//----
   switch (MAMethod)
  {
     case 1 :  strMAType= "EMA" ;  MAMode= MODE_EMA ;   break ;
     case 2 :  strMAType= "SMMA" ; MAMode= MODE_SMMA ; break ;
     case 3 :  strMAType= "LWMA" ; MAMode= MODE_LWMA ; break ;
     default : strMAType= "SMA" ;  MAMode= MODE_SMA ;   break ;
  }
//---- name for DataWindow and indicator subwindow label
  short_name= "Stochastic (" +KPeriod+ "," +DPeriod+ "," +Slowing+ "," +strMAType+ ")" ;
   IndicatorShortName (short_name);
   SetIndexLabel ( 0 ,short_name);
   SetIndexLabel ( 1 , "Signal" );
//----
  draw_begin1=KPeriod+Slowing;
  draw_begin2=draw_begin1+DPeriod;
   SetIndexDrawBegin ( 0 ,draw_begin1);
   SetIndexDrawBegin ( 1 ,draw_begin2);
//----
   return ( 0 );
}
//+------------------------------------------------------------------+
//| Stochastic oscillator                                            |
//+------------------------------------------------------------------+
int start()
{
   int i,k;
   int counted_bars= IndicatorCounted ();
   double price;
//----
   if ( Bars <=draw_begin2) return ( 0 );
//---- initial zero
   if (counted_bars< 1 )
  {
     for (i= 1 ;i<=draw_begin1;i++) MainBuffer[ Bars -i]= 0 ;
     for (i= 1 ;i<=draw_begin2;i++) SignalBuffer[ Bars -i]= 0 ;
  }
//---- minimums counting
  i= Bars -KPeriod;
   if (counted_bars>KPeriod) i= Bars -counted_bars- 1 ;
   while (i>= 0 )
  {
     double min= 1000000 ;
    k=i+KPeriod- 1 ;
     while (k>=i)
    {
      price=Low[k];
       if (min>price) min=price;
      k--;
    }
    LowesBuffer[i]=min;
    i--;
  }
//---- maximums counting
  i= Bars -KPeriod;
   if (counted_bars>KPeriod) i= Bars -counted_bars- 1 ;
   while (i>= 0 )
  {
     double max=- 1000000 ;
    k=i+KPeriod- 1 ;
     while (k>=i)
    {
      price=High[k];
       if (max<price) max=price;
      k--;
    }
    HighesBuffer[i]=max;
    i--;
  }
//---- %K line
  i= Bars -draw_begin1;
   if (counted_bars>draw_begin1) i= Bars -counted_bars- 1 ;
   while (i>= 0 )
  {
     double sumlow= 0.0 ;
     double sumhigh= 0.0 ;
     for (k=(i+Slowing- 1 );k>=i;k--)
    {
      sumlow+=Close[k]-LowesBuffer[k];
      sumhigh+=HighesBuffer[k]-LowesBuffer[k];
    }
     if (sumhigh== 0.0 ) MainBuffer[i]= 100.0 ;
     else MainBuffer[i]=sumlow/sumhigh* 100 ;
    i--;
  }
//---- last counted bar will be recounted
   if (counted_bars> 0 ) counted_bars--;
   int limit= Bars -counted_bars;
//---- signal line is simple movimg average
   for (i= 0 ; i<limit; i++)
  SignalBuffer[i]= iMAOnArray (MainBuffer, Bars ,DPeriod, 0 ,MAMethod,i);
//+------------------------------------------------------------------+ 
   if (Alerts)
  {
     if (AlertBar >= 0 && Time[ 0 ] > LastAlertTime)
    {
       if (MainBuffer[i+AlertBar] > SignalBuffer[i+AlertBar] && MainBuffer[i+AlertBar+ 1 ] <= SignalBuffer[i+AlertBar+ 1 ])
      {
         Alert ( "Stochastic BULL! " , Symbol (), " TF: " , Period ());
      }
       if (MainBuffer[i+AlertBar] < SignalBuffer[i+AlertBar] && MainBuffer[i+AlertBar+ 1 ] >= SignalBuffer[i+AlertBar+ 1 ])
      { 
         Alert ( "Stochastic BEAR! " , Symbol (), " TF: " , Period ());
      }
    }
    LastAlertTime = Time[ 0 ];
  }
//----
   return ( 0 );
}
//+------------------------------------------------------------------+
 

멀티 MA를 하고 싶어요. 저것들. 2개의 MA는 차트에서 볼 수 있어야 합니다. 하나는 현재 상품이고 다른 하나는 두 번째 상품입니다.

문제는 그것들을 서로 연결하는 것입니다. 왜냐하면 각 상품에는 고유한 변동성과 포인트의 다중성이 있습니다. 현명한 생각이 떠오르지 않습니다.... 도와주세요! :)

 
Cmu4 :

멀티 MA를 하고 싶어요. 저것들. 2개의 MA는 차트에서 볼 수 있어야 합니다. 하나는 현재 상품이고 다른 하나는 두 번째 상품입니다.

문제는 그것들을 서로 연결하는 것입니다. 왜냐하면 각 상품에는 고유한 변동성과 포인트의 다중성이 있습니다. 현명한 생각이 떠오르지 않습니다.... 도와주세요! :)

하위 창으로 문제를 일으키지 않기를 바랍니다.

작업에 따라 다르며 두 차트에서 모두 기간이 긴 MA를 사용하여 기본으로 고려할 수 있습니다.

예를 들어 작업 MA 기간은 12입니다. 기본 기호의 경우 그대로 그립니다.

다른 사람들의 경우 MA 12와 60의 차이를 찾았습니다. 이 차이에 계수를 곱하면 기본 기호의 MA 60이 추가됩니다.

 
artmedia70 :

해명해보는건 어떨까요? 열린(시장에서) 또는 이미 닫힌 첫 번째 항목을 선택하십시오. 그리고 3년 전에 첫 번째 자리가 열렸다면? 그녀가 선택 되어야 할까요 ?

일반적으로 이것이 전부인 이유는 무엇입니까?

open 에서 첫 번째 것을 선택하십시오.

이 모든 것은 열린 위치 중 첫 번째 열린 위치와 마지막 열린 위치 사이의 거리를 포인트 단위로 확인하는 데 필요합니다.

 
forexnew :
IsConnected 함수를 사용해 보았습니다( ) - 아무 소용이 없습니다. 누가 현명한 조언을 해줄까요?

IsTradeAllowed()가 반환하는 다른 것을 볼 수 있습니까?

도와주세요. 마지막 지점에서 N개의 막대 앞에 연결된 두 지점을 기반으로 추세선을 만들려고 합니다. 저것들. 들어오는 - 첫 번째 및 두 번째 지점의 시간 가격, N은 앞 의 막대 수로 표시됩니다(빔 플래그 = false). 두 번째 점이 현재 막대 0에서 막대 1에 있다고 가정하고 앞으로 10개의 막대를 그려야 하는 경우 미래에서 막대의 시간과 가격을 어떻게 계산합니까?

 

도와주세요, 제발.

High[3] 시간을 얻는 방법?

 
alex11230 :

도와주세요, 제발.

High[3] 시간을 얻는 방법?


시간[3]
 
Roll :

노력하다:
감사해요 :)
 

사진 찍는 방법:

/

문자열로?

예를 들어:

문자열 경로=터미널경로()+"/logs/"+tekTime+".log";

오류가 발생하고 슬래시 "/"를 제거하면

문자열 경로=터미널경로()+"로그"+tekTime+".log";

- 오류가 없습니다.