Proszę o wskazanie błędu w kodzie

O jezykach programowania w platformach i nie tylko.
farnick
Bywalec
Bywalec
Posty: 18
Rejestracja: 02 lis 2011, 09:51

Nieprzeczytany post autor: farnick »

Dzięki jeszcze raz

dodałem nowy bufor i hula :))

Kod: Zaznacz cały

#property indicator_separate_window
#property indicator_buffers 2
#property indicator_color1 DodgerBlue
#property indicator_color2 OrangeRed

//--- input parameters


double SYGPopSw;
double SYG;
double SYGPopSwA[];
double SYGA[];


//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
 string short_name;
//---- indicator line
   SetIndexStyle(0,DRAW_LINE);
   SetIndexStyle(1,DRAW_LINE);
   
   
   SetIndexBuffer(0,SYGA);
   SetIndexBuffer(1,SYGPopSwA);
  
   
   
//---- name for DataWindow and indicator subwindow label
   short_name="Proby";
   IndicatorShortName(short_name);
   SetIndexLabel(0,short_name);
//----
   SetIndexDrawBegin(0,300);
  
   
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function                       |
//+------------------------------------------------------------------+
int deinit()
  {
//----
   
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int start()
  {
  int i, counted_bars=IndicatorCounted();
  
  if(Bars<=300) return(0);
  
   i=Bars-300-1;
   if(counted_bars>=300) i=Bars-counted_bars-1;
      while(i>=0)
      {
       
     if (iMA(NULL,0,100,8,MODE_EMA,PRICE_CLOSE,i)>iMA(NULL,0,200,8,MODE_EMA,PRICE_CLOSE,i)) 
        {
          SYGA[i]=1;
         }
          else if (iMA(NULL,0,100,8,MODE_EMA,PRICE_CLOSE,i)<iMA(NULL,0,800,8,MODE_EMA,PRICE_CLOSE,i)) 
           {
            SYGA[i]=-1;
            }
            else
               {
               SYGA[i]=SYGA[i+1];
               }
     
     
      SYGPopSwA[i]= SYGA[i+1] ;
           
      i--;
      }
      
 
   
   return(0);
   }
//+------------------------------------------------------------------+      
      

MkubuxK
Pasjonat
Pasjonat
Posty: 1051
Rejestracja: 20 maja 2009, 18:27

Nieprzeczytany post autor: MkubuxK »

Pamiętaj że jak nie chcesz by bufor coś rysował a chcesz tylko go mieć do obliczeń użyj:

Kod: Zaznacz cały

 SetIndexStyle(numerBufora,DRAW_NONE); 
fx-forum

ODPOWIEDZ