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

 
Сергей:

that's how I wrote it... I don't understand why jpy pairs are showing incorrectly... try to attach to any pair without jpy in the terminal and then to a pair with jpy, the results are different...

I found it - the pairs with jpy have a different Point value. I took MarketInfo("SYMBOL",MODE_POINT)). changed the font, its size and colour. Fixed one more error


Files:
 
STARIJ:
Found what's wrong - pairs with jpy the Point value is different. I took MarketInfo("SYMBOL",MODE_POINT)). changed the font, its size and colour. Fixed one more error



I'd like to add timing, because it's not always the case that a tick comes on all the charts at the same time and when you change bars you get the wrong data...

I just have about the same system and in real life I've seen discrepancies in the results.

I solved it this way -

    BarShift_AUDUSD = iBarShift("AUDUSD",0,Time[1],true); if(BarShift_AUDUSD <= 0) return;
    BarShift_NZDUSD = iBarShift("NZDUSD",0,Time[1],true); if(BarShift_NZDUSD <= 0) return;
    BarShift_USDCAD = iBarShift("USDCAD",0,Time[1],true); if(BarShift_USDCAD <= 0) return;
    BarShift_USDJPY = iBarShift("USDJPY",0,Time[1],true); if(BarShift_USDJPY <= 0) return;

    vol = iMA("AUDUSD",0,13,0,MODE_SMA,PRICE_CLOSE,BarShift_AUDUSD);
    vo2 = iMA("NZDUSD",0,13,0,MODE_SMA,PRICE_CLOSE,BarShift_NZDUSD);
    vo3 = iMA("USDCAD",0,13,0,MODE_SMA,PRICE_CLOSE,BarShift_USDCAD);
    vo4 = iMA("USDJPY",0,13,0,MODE_SMA,PRICE_CLOSE,BarShift_USDJPY);

it syncs all the readings of the other charts on the open chart - that is, until a new bar starts on all charts...

 
elmucon:
You should add timing, because it's not always the case that a tick comes on all the charts at the same time and when you change bars you'll get the wrong data...
I just have about the same system and in real life I've seen discrepancies in the results.
I solved it this way -
It synchronizes all the readings of other charts on the open chart - that is, until a new bar starts on all charts...

Look carefully at the posted code. In general, the goal was just to eliminate errors, to help Sergei to achieve a big profit

 


Can you tell me why the iCustom indicator value is always 0. Even on the tops. This is if you get the values in the indicator. Then as in the EA without any problems. The second buffer in the indicator without problems.


//--------------------------------------------------------------------
#property indicator_separate_window    // Индик. рисуется в основном окне
#property indicator_buffers 2       // Количество буферов
#property  indicator_color1 Blue     // Цвет первой линии
#property  indicator_color2 Red      // Цвет второй линии
double zz; 
double Buf_0[],Buf_1[];             // Объявление массивов (под буферы индикатора)
//--------------------------------------------------------------------
int init()                          // Специальная функция init()
  {
   SetIndexBuffer(0,Buf_0);         // Назначение массива буферу
   SetIndexStyle (0,DRAW_LINE,STYLE_SOLID,2);// Стиль линии
   SetIndexBuffer(1,Buf_1);         // Назначение массива буферу
   SetIndexStyle (1,DRAW_LINE,STYLE_DOT,1);// Стиль линии
   return;                          // Выход из спец. ф-ии init()
  }
//--------------------------------------------------------------------
int start()                         // Специальная функция start()
  {
  
   int i,                           // Индекс бара
       Counted_bars;                // Количество просчитанных баров 
//--------------------------------------------------------------------
   Counted_bars=IndicatorCounted(); // Количество просчитанных баров 
   i=Bars-Counted_bars-1;           // Индекс первого непосчитанного
   while(i>=0)                      // Цикл по непосчитанным барам
     {
      zz=iCustom(NULL,0,"Zig_Zag",15,5,5,0,i);
      Buf_0[i]= zz;                 // Значение 0 буфера на i-ом баре
      Buf_1[i]=Low[i];              // Значение 1 буфера на i-ом баре
      i--;                          // Расчёт индекса следующего бара
     }
//--------------------------------------------------------------------
   return;                          // Выход из спец. ф-ии start()
  }
//--------------------------------------------------------------------
 
Александр:

Please tell me why iCustom indicator value is always equal to 0. Even on the tops. It is if I receive values in the indicator. Then there is no problem with it in the Expert Advisor. The second buffer in the indicator without problems.

See if the attached script can help you. The ZigZag is zero everywhere except at the vertices. iCustom - function for calculating the custom indicator

Files:
 
STARIJ:

See if the attached script can help you. The ZigZag is zero everywhere except at the vertices. iCustom - function for calculation of custom indicator

I specifically said: - "Even on vertices". I.e. iCustom should show values on tops. It does exactly that in the Expert Advisor. But it does not do it in an indicator. Why?

 
Александр:

I specifically said: - "Even on the tops". I.e. iCustom should show values on tops. That is what it does in the Expert Advisor. But it does not do it in the indicator. Why?

Look at the attached script - maybe you will find an answer to your question. In general, with the help of scripts you can check, find out, clarify ...
 
STARIJ:
Look at the script posted here - maybe you will find the answer to your question. In general, you can use the scripts to check, find out, clarify ...
OK
 
Александр OK

learning scripts, writing scripts is a good way to learn a language and look for mistakes

 
LRA:

learning scripts, writing scripts is a good way to learn a language and look for mistakes

Well, that's up to a fan. For me, there is no better teacher than documentation.

I used to try to read VB books. Disgusting stuff, I'll tell you. What kind of learning is it if it says "Do with us, do as we do... But don't do better than us."??