[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 201

 

I changed the script code, but the result is unfortunately the same... I don't understand why????

I entered a candle in the alert - always shows 0

 
dmmikl86 >> :

I changed the script code, but the result is unfortunately the same... I don't understand why????

entered candle value in the alert - always shows 0

int start()
  {
   double sum = 0; // Переменная должна объявляться и иницилизироваться до цикла, а не в цикле
   for(int i=1; i<=500; i++) 
      {
      int candle= (High[ i]-Low[ i])*MathPow(10,Digits);
      sum= sum+ candle;
      }  
   double total_size= sum/500.0; // При делении любого числа на целое число, результат округляется до целого числа
   Alert(" средний размер свечи (High-Low) = ", total_size);
   return(0);
  }
 
tmp.0 >> :

why do you need to raise the candle to a power ?

 
Hi all. Can you tell me if MT4 has such a feature. I need to view the history of 5 min charts for different years. It's to look through it manually, not to run it by an Expert Advisor. The thing is that I've tried several terminals from different brokerage companies, the history of 5min is available only for the last couple of months, but look at the year 2005 for example already impossible. I have never tried to use this kind of service.
 
double total_size=sum/500.0; // При делении любого числа на целое число, результат округляется до целого числа
Not a fact :)
 
dmmikl86 >> :

help me out: why Alert=0 ???

here's the code for the script - it reads the average size of the candlestick


Great code, but why arrays high and low have double type and their difference is merged into integer variable? Don't be stupid with types, although I do it myself sometimes.

 
dmmikl86 >> :

why do you need to raise the candle to a power ?


Because the result of High-Low is shown not in pips but in price format (for example 0.0012 instead of 12). It is not a candle but number ten. We obtain 0.0012* (10 to the power of 4) = 0.0012*10000 = 12(pips)

 
E_mc2 >> :
>> Hi all. Can you please advise whether such a possibility exists in MT4. I need to view the history of 5 min charts for different years. I just want to check it manually, not run it by an Expert Advisor. The thing is that I've tried several terminals from different brokerage companies, the history of 5min is available only for the last couple of months but look for example the year 2005 is no longer possible. I have never tried to use this kind of service.

Service-Settings-Charts and set the maximum bars in the history (there is also the number of bars on the chart nearby, which is your case, but be aware that it will slow down tremendously), a few million is usually enough. Then Service-Archive quotes and download the necessary timeframes.

 
splxgf >> :

Don't be stupid with the types, although I am so stupid myself sometimes.

Sometimes rounded up :)


For example:


int start()
  {
   double sum = 0; // Переменная должна объявляться и иницилизироваться до цикла, а не в цикле
   for(int i=1; i<=500; i++) 
      {
      int candle= (High[ i]-Low[ i])*MathPow(10,Digits);
      sum= sum+ candle;
      }  
   int total_size= sum/500.0; // При делении любого числа на целое число, результат округляется до целого числа
   Alert(" средний размер свечи (High-Low) = ", total_size);
   return(0);
  }
 
E_mc2 >> :
>> Hi all. Can you tell me if MT4 has such a feature. I need to look through history of 5 min charts for different years. I need to look through it manually, not run it by an Expert Advisor. The thing is that I've tried several terminals from different brokerage companies, the history of 5min is available only for the last couple of months but look for example the year 2005 is no longer possible. I have tried several different terminals from different ones.

MENU mt4 SERVICE/COUNTRY ARCHIVE/Instrument-TF/PLOY

Reason: