Qualquer pergunta de novato, de modo a não desorganizar o fórum. Profissionais, não passem por aqui. Em nenhum lugar sem você - 6. - página 488

 
Há dois indicadores Ind_1 e Ind_GV. O indicador Ind_GV difere do Ind_1 por receber um dos valores de ajuste da variável global do terminal do cliente.
Quando as configurações Ind_1 e Ind_GV coincidem, Ind_GV tem um valor de resultado ligeiramente diferente de Ind_1.
Se eu fizer uma pausa no testador enquanto Ind_1 e Ind_GV são combinados e compilar Ind_GV, o valor resultante de ambos os indicadores corresponde completamente.
Quem sabe como isso pode ser explicado?
 

Você pode me dizer se preciso de algum código no Expert Advisor para executar no modo de otimização do testador de estratégia?

Estou tentando otimizar meu Expert Advisor, mas não sei o que é isso:


2014.02.18 21:54:30.386 Testador: arquivo cache "C:\....test.caches.NZDUSD5.0" encontrado e pode ser usado para maior otimização

2014.02.18 21:54:30.388 TestGenerator: arquivo de carrapato real "C:\....test testoster\NZDUSD5_0.fxt" encontrado

Nós temos história. O arquivo NZDUSD5_0.fxt pesa cerca de 150 metros.

Você também pode ver isso nos logs do testador

2014.02.18 22:50:21.251 TestGenerator: erro de dados incomparável (limite de volume 305 em 2014.02.12 13:35 excedido)

Do que se trata?


 

Ajude, por favor!

Cada uma das variáveis pode ter um valor de 1 a 5... Diga-me como não escrever 3125 opções))))

   if  (Kx==5&&     K>T &&     K>SA &&     K>SB &&     K>Bid &&
        Tx==4&&     T<K &&     T>SA &&     T>SB &&     T>Bid && 
        SAx==3&&    SA<K &&    SA<T &&     SA>SB &&    SA>Bid &&
        SBx==2&&    SB<K &&    SB<T &&     SB<SA &&    SB>Bid &&
        BID==1&&    Bid<K &&   Bid<T &&    Bid<SA &&   Bid<SB
       )
 
niktron:

Ajude, por favor!

Cada uma das variáveis pode ter um valor de 1 a 5... Diga-me como não escrever 3125 opções))))

Tirar 25 escolhas e depois lidar com quem é maior.
 
tara:
Desenhar 25 opções e, em seguida, lidar com quem é maior.

Obrigado... é isso que estou fazendo agora... Eu queria fazer com arrays, mas não tenho tração...)
 
No final há 3125 opções, não 25...mas dividi-la em 25 opções também é uma coisa))))
 
Escreva seus comentários imediatamente, eles ajudarão depois.
 
Foi para uma mulher.
 

Por favor, ajude com o indicador com anexos ".mqh".

Os buffers indicadores ExtBuffer1[], ExtBuffer2[] e Buffer_M[] têm tamanho 0. Ao mesmo tempo, o buffer ExtBuffer0[] funciona bem e seu tamanho é igual ao das Barras, como deveria ser. O mais interessante é que ele funcionava bem na versão antiga do MT4 antes de ser atualizado para a nova versão. Mais uma coisa. Se eu mover todos os elementos de um indicador para o mesmo arquivo mq4 básico, tudo funciona bem novamente.

Pergunta: Por que os tamanhos da matriz de amortecedores indicadores em anexos são zerados para 0?

Aqui está o código fonte do indicador.

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

//| AO_EMA_(with_includes).mq4 |

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

#include <AO_EMA_(with_includes)_GLOB.mqh>

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

int init()

{

#include <AO_EMA_(with_includes)_INIT.mqh>

return(0);

}

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

int start()

{

#include <AO_EMA_(with_includes)_START.mqh>

return(0);

}

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





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

//| AO_EMA_(with_includes)_GLOB.mq4 |

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

#property indicator_separate_window

#property indicator_buffers 4

#property indicator_color1 Black

#property indicator_color2 Green

#property indicator_color3 Red


//---- Input Data

extern int Slow = 100;

extern double Slow_Fast = 4.318;

extern int Average = 25; // Усреднение АО

extern bool Show_AO_G = true,

Show_AO_R = true;


//---- Глобальные переменные

int Fast;

bool Alert_done = false; // Флаг говорит о том, что Alert уже был раз сгенерирован.

//---- indicator buffers

double ExtBuffer0[];

double ExtBuffer1[];

double ExtBuffer2[];

//---- Буфера индикатора, для промежуточных расчетов

double Buffer_M[];

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

//| AO_EMA_(with_includes)_INIT.mq4 |

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

//---- Установка значение для переменной "Fast"

Fast = NormalizeDouble(Slow / Slow_Fast, 0);


//---- indicator buffers mapping

SetIndexBuffer(0, ExtBuffer0);

SetIndexBuffer(1, ExtBuffer1);

SetIndexBuffer(2, ExtBuffer2);

SetIndexBuffer(3, Buffer_M);


//---- drawing settings

SetIndexStyle(0, DRAW_NONE); // Линия не рисуется

SetIndexStyle(1, DRAW_HISTOGRAM); // Гистограмма

SetIndexStyle(2, DRAW_HISTOGRAM); // Гистограмма

SetIndexStyle(3, DRAW_NONE); // Линия не рисуется

//---- drawing begin settings

SetIndexDrawBegin(0, Fast); // Индикатор начинает рисоваться с этого бара, от начала графика слева.

SetIndexDrawBegin(1, Fast);

SetIndexDrawBegin(2, Slow);

SetIndexDrawBegin(3, Slow);


IndicatorDigits(Digits+1);

//---- name for DataWindow and indicator subwindow label

IndicatorShortName("AO_EMA ("+Fast+"-"+Slow+")");

SetIndexLabel(1,"Green");

SetIndexLabel(2,"Red");

//---- Обнуляем буфер индикатора

SetIndexEmptyValue(0, 0.0); SetIndexEmptyValue(1, 0.0);

SetIndexEmptyValue(2, 0.0); SetIndexEmptyValue(3, 0.0);

//---- initialization done

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

//| AO_EMA_(with_includes)_START.mq4 |

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

int limit, pos;

int counted_bars=IndicatorCounted();

double prev,current, pr;

bool up;


//---- Последний посчитанный бар будет пересчитан

if(counted_bars>0) counted_bars--;

limit=Bars-counted_bars;

Print("counted_bars=",counted_bars," Bars=",Bars," limit=",limit);

Print("0=",ArraySize(ExtBuffer0)," 1=",ArraySize(ExtBuffer1)," 2=",ArraySize(ExtBuffer2)," M=",ArraySize(Buffer_M));


//---- Расчет MACD для Гистограммы "= EMA(fast) - EMA(slow)"

if(Show_AO_G == true || Show_AO_R == true)

{ for(int i=0; i<limit; i++)

Buffer_M[i]=iMA(NULL,0,Fast,0,MODE_EMA,PRICE_MEDIAN,i)-iMA(NULL,0,Slow,0,MODE_EMA,PRICE_MEDIAN,i);


//---- Усредняем MACD по "Average".Это и будет рисоваться на графике..

//---- ... можно заменить на " EMA(Fast)".

pr=2.0/(Average+1);

pos=Bars-2;

if(counted_bars>2) pos=Bars-counted_bars-1;

//---- Основной расчет

while(pos>=0)

{ if(pos==Bars-2) ExtBuffer0[pos+1]=Buffer_M[pos+1];

ExtBuffer0[pos]=Buffer_M[pos]*pr+ExtBuffer0[pos+1]*(1-pr);

pos--; }

//---- Расперделение данных между 2-я буферами, для разделения по цветам

for(i=limit-1; i>=0; i--)

{ // При перерасчете самого левого бара, порядковый номер в массиве [i+1] выходит за пределы размера массива, поэтому расчет первого цикла прорускаем.

if(i == Bars-1) continue;

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

current = ExtBuffer0[i];

prev = ExtBuffer0[i+1];

if(current == prev) continue;

else

{ if(current>prev) up=true;

if(current<prev) up=false;

if(!up)

{ ExtBuffer2[i]=current;

ExtBuffer1[i]=0.0; }

else

{ ExtBuffer1[i]=current;

ExtBuffer2[i]=0.0; }

}}}

//--- Устанавливаем видимость индикаторов

if(Show_AO_G == false) SetIndexStyle(1, DRAW_NONE);

if(Show_AO_R == false) SetIndexStyle(2, DRAW_NONE);

 
NEP:

Por favor, ajude com o indicador com anexos ".mqh".

Os buffers indicadores ExtBuffer1[], ExtBuffer2[] e Buffer_M[] têm tamanho 0. Ao mesmo tempo, o buffer ExtBuffer0[] funciona bem e seu tamanho é igual ao das Barras, como deveria ser. O mais interessante é que ele funcionava bem na versão antiga do MT4 antes de ser atualizado para a nova versão. Mais uma coisa. Se eu mover todos os elementos de um indicador para o mesmo arquivo mq4 básico, tudo funciona bem novamente.

Pergunta: Por que os tamanhos da matriz de amortecedores indicadores em anexos são zerados para 0?

Aqui está o código fonte do indicador.




Você gosta de fazer as coisas no seu traseiro?
Razão: