[ARQUIVO!] Qualquer pergunta de novato, para não desorganizar o fórum. Profissionais, não passem por aqui. Em nenhum lugar sem você - 4. - página 238

 
Roman.:

O que o impede de mudar MODE_ASK aqui para 1.1111 para uma ordem de compra, digamos? A função está pronta - edite-a.


Obrigado!
 
deyron:

Acima de um posto abaixo do corrigido. Nada ali (vazio) critério para passar um MA por outro e vice-versa.

O próprio fato de que se um buffer - sem perguntas, mas o mesmo através do 2º, 3º ou 4º, não é transmitido, ou melhor, não funciona.



Se houver um buffer no indicador, você deve fazer isso de acordo
 
costy_:
os indicadores não funcionam com um deslize, de modo a não interromper o fluxo comercial!

É isso mesmo, o indicador só funciona com o escorregador e o "contador vazio", ele não desenha nada sem eles!!!!! É incrível, incrível, incompreensível, no final não é normal, mas eu tive que escrever o código!
//+------------------------------------------------------------------+
//|                                                   Синяячерта.mq4 |
//|                        Copyright 2012, MetaQuotes Software Corp. |
//|                                        http://www.metaquotes.net |
//+------------------------------------------------------------------+
#property copyright "Copyright 2012, MetaQuotes Software Corp."
#property link      "http://www.metaquotes.net"

#property indicator_chart_window
#property indicator_buffers 3
#property indicator_color1 Green
#property indicator_color2 Red
#property indicator_color3 DarkBlue

double ВерхняячертаBuffer1[];
double НижняячертаBuffer2[];
double СинняячертаBuffer3[];
 double вершина; 
 double основание_первого_снижения;
 double начало;
 double вершина_волны_3;
 
 int timeframe, start ;
 int бар_вершина ;
 int бар_основание_первого_снижения;
 int бар_начало;
 
 double Pustostsetscyk;
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
//---- indicators
SetIndexStyle(0,DRAW_SECTION,STYLE_SOLID,2,CLR_NONE);//Alert ("SetIndexStyle ",GetLastError( ) );
  SetIndexBuffer(0,ВерхняячертаBuffer1);//Alert ("SetIndexBuffer ",GetLastError( ) );
   SetIndexEmptyValue(0,0.0);
   
   SetIndexStyle(1,DRAW_SECTION,STYLE_SOLID,2,CLR_NONE);//Alert ("SetIndexStyle ",GetLastError( ) );
  SetIndexBuffer(1,НижняячертаBuffer2);//Alert ("SetIndexBuffer ",GetLastError( ) ); 
   SetIndexEmptyValue(1,0.0);
   
   SetIndexStyle(2,DRAW_SECTION,STYLE_SOLID,2,CLR_NONE);//Alert ("SetIndexStyle ",GetLastError( ) );
  SetIndexBuffer(2,СинняячертаBuffer3);//Alert ("SetIndexBuffer ",GetLastError( ) ); 
   SetIndexEmptyValue(2,0.0);
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function                       |
//+------------------------------------------------------------------+
int deinit()
  {
//----
   
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int start()
  {
   int    counted_bars=IndicatorCounted();
//----
   for (int i=0;i<100;i++){  СинняячертаBuffer3[i]= Open[i];}
          for (i=330;i<500;i++){  СинняячертаBuffer3[i]= Open[i];}
         for (i=0;i<500;i++){ Pustostsetscyk++;} Pustostsetscyk=0;
         Sleep(4000);
     i=Bars;
       бар_вершина=iHighest( NULL,  timeframe, MODE_HIGH, i, start ) ;
       вершина =High[ бар_вершина ];
       бар_основание_первого_снижения=iLowest( NULL,  timeframe, MODE_LOW, бар_вершина, start ) ;
       основание_первого_снижения=Low[ бар_основание_первого_снижения ];
       бар_начало=iLowest( NULL,  timeframe, MODE_LOW, бар_вершина*2, бар_вершина ) ;
       начало=Low[ бар_начало ];
       Sleep(4000);
      //   Alert ( " бар_вершина   ",бар_вершина  , " вершина  " , вершина ,
      //    " бар_основание_первого_снижения  " ,бар_основание_первого_снижения  , " основание_первого_снижения  " , основание_первого_снижения , 
      //    " бар_начало  " , бар_начало   , " начало  " , начало    );
  
    НижняячертаBuffer2[бар_начало]=начало;
    НижняячертаBuffer2[бар_основание_первого_снижения]=основание_первого_снижения;
    for ( i=0;i<10;i++){  НижняячертаBuffer2[i]= Open[i];}
     Sleep(4000);     
    for (i=0;i<500;i++){ Pustostsetscyk++;}   Pustostsetscyk=0;   
//----
   return(0);
  }
//+------------------------------------------------------------------+
 

E o cronograma não pode ser alterado, tudo desaparece para sempre.

Tive que adicionar uma linha para (i=0;i<300;i++){Alerta ( Bottom lineBuffer2[i]); }, ele não desenha sem ele!

E realmente atrai de vez em quando! Então eu defini a espessura da linha para 4, compilei-a, e não!!!

Acabei de colocar o indicador no gráfico, ele não está lá. Eu espero dois minutos, já se foi. Sem removê-lo do gráfico, compenso novamente o mesmo código no editor Metatrader.

 
Dimka-novitsek:

É isso mesmo, o indicador só funciona com slip e "contador vazio", ele não desenha nada sem eles!!!!! É incrível, incrível, incompreensível, no final não é normal, mas eu tive que escrever o código!


Comece por este.

//+------------------------------------------------------------------+
//|                                                   Синяячерта.mq4 |
//|                        Copyright 2012, MetaQuotes Software Corp. |
//|                                        http://www.metaquotes.net |
//+------------------------------------------------------------------+
#property copyright "Copyright 2012, MetaQuotes Software Corp."
#property link      "http://www.metaquotes.net"

#property indicator_chart_window
#property indicator_buffers 3
#property indicator_color1 Green
#property indicator_color2 Red
#property indicator_color3 DarkBlue

double BufferUP[];
double BufferDN[];
double BufferBlue[];

 
 double Pustostsetscyk;
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
//---- indicators
SetIndexStyle(0,DRAW_LINE);//Alert ("SetIndexStyle ",GetLastError( ) );
  SetIndexBuffer(0,BufferUP);//Alert ("SetIndexBuffer ",GetLastError( ) );
   SetIndexEmptyValue(0,0.0);
   
   SetIndexStyle(1,DRAW_LINE);//Alert ("SetIndexStyle ",GetLastError( ) );
  SetIndexBuffer(1,BufferDN);//Alert ("SetIndexBuffer ",GetLastError( ) ); 
   SetIndexEmptyValue(1,0.0);
   
   SetIndexStyle(2,DRAW_LINE);//Alert ("SetIndexStyle ",GetLastError( ) );
  SetIndexBuffer(2,BufferBlue);//Alert ("SetIndexBuffer ",GetLastError( ) ); 
   SetIndexEmptyValue(2,0.0);
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function                       |
//+------------------------------------------------------------------+
int deinit()
  {
//----
   
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int start()
  {
   int    counted_bars=IndicatorCounted();
//----
   int limit=Bars-counted_bars-1;

   for (int i=limit;i>=0;i--) {
      BufferBlue[i]  = Open[i];
      BufferUP[i]    = High[i];
      BufferDN[i]    = Low[i];
   }
//----
   return(0);
  }
//+------------------------------------------------------------------+
 

Obrigado!!!!!!

Ótimo!!!

 
Dimka-novitsek:
Obrigado!!!!!!

Ligeiramente corrigido o post anterior
 
Quando se muda o cronograma, ele também desaparece e, permanentemente, não aparece mais em qualquer cronograma. Bem, vou tentar fazer algo útil para começar. Acho que meu computador está se apagando ou algo assim.
 
Dimka-novitsek:
Quando se muda o cronograma, ele também desaparece e, permanentemente, não aparece mais em qualquer cronograma. Bem, vou tentar fazer algo útil para começar. Acho que meu computador está se apagando ou algo assim.

Eu corrigi um pouco o código, eu já escrevi
 
Agora. Oh, uau! Sim! ótimo!