Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 6. - page 488

 

Can you tell me if I need any code in the Expert Advisor to run in the strategy tester in optimisation mode?

I'm trying to optimise my Expert Advisor, but I don't know what it is:


2014.02.18 21:54:30.386 Tester: cache file "C:\...\tester\caches\test.NZDUSD5.0" found and can be used for further optimization

2014.02.18 21:54:30.388 TestGenerator: actual tick file "C:\...\tester\history\NZDUSD5_0.fxt" found

We have history. NZDUSD5_0.fxt file weighs about 150 meters.

You can also see this in the tester's logs

2014.02.18 22:50:21.251 TestGenerator: unmatched data error (volume limit 305 at 2014.02.12 13:35 exceeded)

What's this about?


 

Help please!

Each of the variables can take a value from 1 to 5...Tell me how not to write 3125 options)))

   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:

Help please!

Each of the variables can take a value from 1 to 5...Tell me how not to write 3125 options)))

Draw 25 choices and then deal with who is greater.
 
tara:
Draw 25 options and then deal with who is bigger afterwards.

Thanks... that's what I'm doing now... I wanted to do it with arrays, but I don't have the traction...))
 
In the end there are 3125 options, not 25...but splitting it into 25 options is also a thing)))
 
Write your comments straight away, they will help afterwards.
 
Gone to a woman.
 

Please help with indicator with ".mqh" attachments.

Indicator buffers ExtBuffer1[], ExtBuffer2[] and Buffer_M[] have size 0. At the same time buffer ExtBuffer0[] works fine and its size is equal to Bars, as it should be. The most interesting thing is that it worked fine in the old version of MT4 before it was updated to the new one. One more thing. If I move all elements of an indicator to the same basic mq4 file, everything works fine again.

Question: Why do the array sizes for indicator buffers in attachments get reset to 0?

Here is the source code of the indicator.

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

//| 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:

Please help with indicator with ".mqh" attachments.

Indicator buffers ExtBuffer1[], ExtBuffer2[] and Buffer_M[] have size 0. At the same time buffer ExtBuffer0[] works fine and its size is equal to Bars, as it should be. The most interesting thing is that it worked fine in the old version of MT4 before it was updated to the new one. One more thing. If I move all elements of an indicator to the same basic mq4 file, everything works fine again.

Question: Why do the array sizes for indicator buffers in the attachments get reset to 0?

Here is the source code of the indicator.




Do you like to do things up your arse?
 
tara:
Gone to a woman.

:-) bravo!
Reason: