[ARCHIVE]Any rookie question, so as not to clutter up the forum. Professionals, don't pass it by. Can't go anywhere without you - 5. - page 281

 
solnce600:

QUESTION.WHY DOESN'T THE PROGRAM READ AN ARRAY INITIALISED IN ONE COLUMN.

double mass[8]={0.85374,
               0.85694,
               0.85974,
               0.86174,
               0.86474,
               0.86494,
               0.86504, 
               0.86524};
It reads everything. Remove semicolons in the array declaration, put commas. And it doesn't matter how many spaces or tabs there are in the array. Or maybe I've got you wrong.
 
gyfto:
Everything reads. Remove semicolons in the array declaration, put commas. And how many spaces or tabs there are doesn't matter. Or maybe I've got you wrong.

Thank you for your help. Why then are there semicolons in Kovalev's textbook?

//--------------------------------------------------------------------
// stringarray.mq4
// Предназначен для использования в качестве примера в учебнике MQL4.
//--------------------------------------------------------------------
extern double Level=1.3200;                     // Заданный уровень 
string Text[101];                               // Объявление массива
//--------------------------------------------------------------------
int init()                                      // Спец. ф-ия init()
  {                                             // Присвоение значений
   Text[1]="один ";            Text[15]="пятнадцать ";
   Text[2]="два ";             Text[16]="шестнадцать ";
   Text[3]="три ";             Text[17]="семнадцать ";
   Text[4]="четыре ";          Text[18]="восемнадцать ";
   Text[5]="пять ";            Text[19]="девятнадцать ";
   Text[6]="шесть ";           Text[20]="двадцать ";
   Text[7]="семь ";            Text[30]="тридцать ";
   Text[8]="восемь ";          Text[40]="сорок ";
   Text[9]="девять ";          Text[50]="пятьдесят ";
   Text[10]="десять ";         Text[60]="шестьдесят";
   Text[11]="одиннадцать ";    Text[70]="семьдесят ";
   Text[12]="двенадцать ";     Text[80]="восемьдесят ";
   Text[13]="тринадцать ";     Text[90]="девяносто";
   Text[14]="четырнадцать ";   Text[100]= "сто";
   // Вычисление значений
   for(int i=20; i<=90; i=i+10)                // Цикл по десяткам
     {
      for(int j=1; j<=9; j++)                  // Цикл по единицам
         Text[i+j]=Text[i] + Text[j];          // Вычисление значения   
     }
   return;                                     // Выход из init()
  }
//--------------------------------------------------------------------
int start()                                     // Спец. ф-ия start()
  {
   int Delta=NormalizeDouble((Bid-Level)/Point,0);// Превышение 
//--------------------------------------------------------------------
   if (Delta>=0)                                // Цена не выше уровня
     {
      Alert("Цена ниже уровня");                // Сообщение
      return;                                   // Выход из start()
     }
//--------------------------------------------------------------------
   if (Delta<100)                               // Цена более 100
     {
      Alert("Более ста пунктов");               // Сообщение
      return;                                   // Выход из start()
     }
//--------------------------------------------------------------------
   Alert("Плюс ",Text[Delta],"pt.");            // Вывод на экран
   return;                                      // Выход из start()
  }
 
Hello. Can you please tell me how to make a 10 second timeframe? WithPeriod Converter I have succeeded, only over a minute.
 
scar1k:
Hello. Can you please tell me how to make a 10 second timeframe? With Period Converter I got it done, only over a minute.

You have to form from ticks. Periodconverter does the minimum from minutes.


solnce600:

Thank you for your help. Why are semicolons in Kovalev's textbook then?


extern double Level=1.3200;                     // Заданный уровень 
string Text[101];                               // Объявление массива
//--------------------------------------------------------------------
int init()                                      // Спец. ф-ия init()
  {                                             // Присвоение значений
   Text[1]="один ";            Text[15]="пятнадцать ";
   Text[2]="два ";             Text[16]="шестнадцать ";
   Text[3]="три ";             Text[17]="семнадцать ";
    .....
Kovalev has it right. I highlighted in red what you don't have.
 
Yes but is there anything ready? And why can'tPeriod Converter be set to convert to less if you replace the * in its code with / it doesn't count, although what difference does it make to multiplying minutes or dividing.
 
solnce600:

Thank you for your help.Why then are there semicolons in Kovalev's textbook?

Initializing and filling an array is done in these ways:

   //---- 1-ый (сначала объявление, затем его заполнение)
   double mass[3];
   mass[0] = 1.8457;
   mass[1] = 1.8465;
   mass[2] = 1.8460;
   //---- 2-ой (заполнение при объявлении)
   double massiv2[] = {1.8457,1.8465,1.8460};

Choose the one that suits you.

 
scar1k:
Yes, but is there anything ready? And why can't Period Converter be set to convert to less if you replace the * in its code with / it doesn't count, although what difference does it make to multiplying minutes or dividing.

Well, if the kodobase doesn't have it, you have to write it yourself. It's not the first time I've encountered this. I myself am now asking the same question, I have no other way out. I'm trying to rewrite the tick collector I linked to above. Let's do it together, now.
 
solnce600:

Thank you for your help.Why then are there semicolons in Kovalev's textbook?



Because it's a textbook, the author makes you think! :)))
 

Guys, help me out.

I don't understand why the line

Print(" SL == ", NormalizeDouble(SL_Ord+DistModify*Point_Modif,5));

Result: 2013.04.12 17 13 Print_v4 EURUSD,M15: SL == 1.3068

gives out four decimal places?

I am aware ofDoubleToStr.


 
TarasBY:

Initialising and filling the array is done in these ways:

Choose the one that suits you.

Got it. Thank you very much.