[WARNING CLOSED!] Any newbie question, so as not to clutter up the forum. Professionals, don't go by. Can't go anywhere without you. - page 500

 
Find the maximum and minimum of a given time Time1 to Time1+Time2 . Time1+Time2 is made to be able to skip to another day. I have written the code
extern int     Time1            = 0;      // Start box Time (broker time)
extern int     Time2            = 8;      // Start box plius Time2 hours  (broker time)
//+------------------------------------------------------------------+
//| expert start function                                            |
//+------------------------------------------------------------------+
int start()
  {
//----
   datetime StartBox,EndBox;
   int      StartBar,EndBar;  
   double   HighBox,LowBox;
   
   StartBox  = StrToTime(Year()+"."+Month()+"."+Day()+" "+Time1+":00"); //time(s)
   Print("    startBox        ",StartBox);
   EndBox    = StartBox+Time2*3600; //time(s)
   Print("    endBox          ",EndBox);
   StartBar  = iBarShift("GBPJPY",240,StartBox,true);
   Print("  startBar        ",StartBar);
   EndBar    = iBarShift("GBPJPY",240,EndBox,true);
   Print("   endBar        ",EndBar);
   HighBox   = High[iHighest("GBPJPY",240,MODE_HIGH,StartBar-EndBar,EndBar+1)];
   Print("HihghBox       ",HighBox);
   LowBox    = Low[iLowest("GBPJPY",240,MODE_LOW,StartBar-EndBar,EndBar+1)];
   Print("LowBox    ",LowBox);
   return(0);
  }
Log

2010.03.31 10:24:59 2010.03.29 16:43 b GBPJPY,H4: LowBox 137.655
2010.03.31 10:24:59 2010.03.29 16:43 b GBPJPY,H4: HihghBox 138.367
2010.03.31 10:24:59 2010.03.29 16:43 b GBPJPY,H4: endBar 2
2010.03.31 10:24:59 2010.03.29 16:43 b GBPJPY,H4: startBar 4

2010.03.31 10:24:59 2010 03.29 16:43 b GBPJPY,H4: endBox 1269849600
2010 03.31 10:24:59 2010 03.29 16:43 b GBPJPY,H4: startBox 1269820800

The log says it searched from bar 4 to 2. What does 16:43 mean. Is it the broker's time or do we need to correct it by GMT ? Why from fourth to second when I wanted from 0 o'clock to 8 o'clock .
Who can explain it to me, please. Maybe it is possible to write the code differently .
 
gince писал(а) >>
You need to find the maximum and minimum of the given time Time1 to Time1+Time2 . Time1+Time2 is made to be able to skip to another day. I have written the following code
Log

2010.03.31 10:24:59 2010.03.29 16:43b GBPJPY,H4: LowBox 137.655
2010.03.31 10:24:59 2010.03.29 16:43 b GBPJPY,H4: HihghBox 138.367
2010.03.31 10:24:59 2010.03.29 16:43 b GBPJPY,H4: endBar 2
2010.03.31 10:24:59 2010.03.29 16:43 b GBPJPY,H4: startBar 4

2010.03.31 10:24:59 2010.03.29 16:43 b GBPJPY,H4: endBox 1269849600
2010.03.31 10:24:59 2010.03.29 16:43 b GBPJPY,H4: startBox 1269820800

The log says that it searched from the fourth to the second bar. What is the time 16:43. Is it the broker's time or do I need to correct it by GMT ? Why from fourth to second when I wanted from 0 o'clock to 8 o'clock.
Who can explain it to me, please. Maybe it is possible to write the code differently .


16:43 - terminal time, time to start the script
The search should be done from the beginning of the day to 8 a.m., on H4 it is two bars
at 16:43 there are already four fully formed H4 bars and one bar forming (zero)

 
Good afternoon.
I would like to ask the community once again about the 226 build.
"Maybe someone has already asked, but I searched and couldn't find an answer to this question. Since Monday, when I turn on the terminal, I get an update to the new 226 build. I start booting and when i start installing it antivirus is swearing. What not doing all the same does not pass. Even if I download without antivirus, it then sneezes this update. How to cope with this nastoyka.
Antivirus is AVG. I got it right. If I don't have AVG, everything works. But when I connect my AVG, it says "Detected Win32/Themida virus. Detected on opening" And any further action leads only to deletion of the update."
 
gvi2504 писал(а) >>
Good afternoon.
Once again I would like to ask a question to the community regarding 226 build.
"Maybe someone has already asked, but I searched and couldn't find an answer to this question. Since Monday, when I turn on the terminal, I get an update to the new 226 build. I start booting and when i start installing it antivirus is swearing. What not doing all the same does not pass. Even if I download without antivirus, it then sneezes this update. How to cope with this nastoyka.
Antivirus is AVG. I got it right. If I don't have AVG, everything works. But when I connect my AVG, it says "Detected Win32/Themida virus. Detected on opening" And any further action leads only to deletion of the update."


https://www.mql5.com/ru/forum/120616/page2#209538
but I searched and couldn't find an answer to this question.
https://www.mql5.com/ru/search
 

Thank you, of course, but what to do. There's just talk everywhere and no concrete suggestions. Can the automatic update be turned off in the terminal? On startup it comes up with an offer to update. If this build doesn't pass the antivirus, then let them not come automatically.

 
gvi2504 писал(а) >>

Thank you, of course, but what to do. There's just talk everywhere and no concrete suggestions. Can the automatic update be turned off in the terminal? On startup it comes up with an offer to update. If this build doesn't pass the antivirus, then let them not come automatically.

I don't know anything about your AVG, but here is the "search result" for "avg+Themida"
https://www.mql5.com/go?link=https://support.avg.com/answers

"Please add these files to AVG Resident Shield exceptions (not PUP) -> open AVG -> menu Tools -> Advanced Settings -> Resident Shield -> file/folder exceptions"
 

There is one misunderstanding. Help me understand, please. ))

int start(){
   double MasOrd[2][3];
   double po = MarketInfo(Symbol(), MODE_POINT );
   int di = MarketInfo(Symbol(), MODE_DIGITS);
   int Level = 2; 
   int o = 1;
   if(OrderSelect(0,SELECT_BY_POS)==true){
      MasOrd[o][1] = NormalizeDouble(OrderOpenPrice(), di);//0.34610000 
      MasOrd[o][2] = NormalizeDouble(OrderStopLoss() , di);//0.34630000
   }
   if(MasOrd[o][2] - MasOrd[o][1] == Level*po) Alert(MasOrd[o][2] - MasOrd[o][1]);
   return(0);
}
While conditions in the last if() are fully satisfied (0.34630000 - 0.34610000 == 2*0.00010000) Alert() does not print. Why does it happen this way? If I normalize the difference using the NormalizeDouble(MasOrd[o][2]-MasOrd[o][1]) function, everything is ok. I normalized MasOrd[o][2] and MasOrd[o][1] separately - should their difference be normal too?
 
gvi2504 >>:

...Везде одни разговоры, а конкретных предложений нет. Скажите, а можно ли в терминале отключить автоматическое обновление? При запуске приходит предложение для обновления. Если этот билд не проходит по антивирусу, то пусть и не приходят автоматически.

Rename the LiveUpdate.exe file in the terminal folder, for example, to LiveUpdate.$$$. The auto-update will lose the executable file and stop bothering you. Once the problem has been resolved, you can rename the file back and restore the update.

 
It's probably not an uncommon question, but I haven't come across a coherent answer yet. Please help me out.
There is an Expert Advisor that simultaneously works with several pairs - is there an opportunity to test it on the history?
(It is synchronous running on the history of a given set of pairs that is important).
 
Hello.
Please help me to find out what is wrong here. Why is there zero in the second buffer first and then the calculated values?
//+------------------------------------------------------------------+
//|                                                          123.mq4 |
//|                      Copyright © 2009, MetaQuotes Software Corp. |
//|                                        http://www.metaquotes.net |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2009, MetaQuotes Software Corp."
#property link      "http://www.metaquotes.net"

#property indicator_separate_window
#property indicator_buffers 2
#property indicator_color1 LightSeaGreen
#property indicator_color2 Red

extern int cciPeriod = 14;
extern int cciPrice  = 5;
extern int maPeriod  = 14;

double Buf_0[],Buf_1[];
//+------------------------------------------------------------------+ 
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
//---- indicators
SetIndexBuffer(0,Buf_0);
SetIndexBuffer(1,Buf_1);
SetIndexStyle (0,DRAW_LINE,STYLE_SOLID,1);
SetIndexStyle (1,DRAW_LINE,STYLE_SOLID,1);
SetIndexLabel (0,"Buffer CCI");
SetIndexLabel (1,"Buffer Average CCI");
IndicatorShortName("CCI & MA("+cciPeriod+","+cciPrice+","+maPeriod+") ");
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function                       |
//+------------------------------------------------------------------+
int deinit()
  {
//----

//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int start()
  {
//----
   int i,z,Counted_bars;
   double sum;
   Counted_bars=IndicatorCounted();
   i=Bars-Counted_bars-1;
   while(i>=0)
   {
      while(z<maPeriod){
         sum+=iCCI(Symbol(),0,cciPeriod,cciPrice,i+z);
         z++;}
      Buf_0[i]=iCCI(Symbol(),0,cciPeriod,cciPrice,i);
      Buf_1[i]=sum/maPeriod;
      i--;
   }
//----
   return(0);
  }
//+------------------------------------------------------------------+