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

 
AlexeyVik:
Now they'll start explaining to you that the angle depends on the scaling of the graph and it can't be done...
But if you take not the angle, but only the tangent of the angle, you can do it.

I wonder if it is possible to find out what it is and how it should be determined. I know that in geometry at school they taught the tangents and the catangents, but alas I don't remember) I asked Fresh on the forum, but I have not received a definite answer.
 

If Yandex is banned, you can use Google.

In short, the tangent of an angle in a right-angle triangle is the ratio of the opposing leg to the adjoining leg.

Translating this to the situation in the MT diagram, we get - the opposing leg will be equal to the points (in pct.) and the adjoining one in bars (also in pct.).

Example:

EURUSD opening 6.03 1.3732 opening 7:03 1.3860 total 128 pips. At M1 1440 bars tan = 128/1440=0.08889

This equation is basically used in the ObjectGetValueByShift() function

 
Is it possible to use a third-party server? I just have this one connected http://buy.fineproxy.org/
 
Please explain how to fit data from a table (*.csv) into a three-dimensional static array.
The first column of the table contains the index for the first dimension of the array,
The second column contains the index for the second dimension of the array,
The third and further columns contain the values themselves for the third dimension of the array.
void AAA()
   {
    int       Handle;                                          // Файловый описатель
    string    File_Name = "AAA.csv";                           // Имя открываемого файла

    string    str_1 = "";                                      //  1 Номер индекса по первому измерению
    string    str_2 = "";                                      //  2 Номер индекса по второму измерению
    string    str_3 = "";                                      //  3 Значение
    string    str_4 = "";                                      //  4 Значение
    string    str_5 = "";                                      //  5 Значение

    Handle=FileOpen(File_Name, FILE_READ, ";");                // Открытие файла
    
    while(FileIsEnding(Handle)==false)                         // До тех пор, пока файловый...
        {                                                      // ...указатель не в конце файла
         // Чтение данных из строки до файлового разделителя
         str_1 = FileReadString(Handle);                       //  1 Номер индекса по первому измерению
         str_2 = FileReadString(Handle);                       //  2 Номер индекса по второму измерению
         str_3 = FileReadString(Handle);                       //  3 Значение
         str_4 = FileReadString(Handle);                       //  4 Значение
         str_5 = FileReadString(Handle);                       //  5 Значение
         
         if(FileIsEnding(Handle)==true)                        // Файловый указатель в конце файла
              break;                                           // Выход из цикла чтения

         ????????????????????????????????????????????????????
        }
    FileClose(Handle);                                         // Закрываем файл
    return;                                                    // Выход из функции
   }
 
Leo59:
Please explain how to put data from a table (*.csv) into a three-dimensional static array.
The first column of the table has an index on the first dimension of the array,
The second column is the index for the second dimension of the array,
In the third and further columns - the values themselves according to the third dimension of the array.



If for analysis in Excel itself, the summary table.

Or show some of the data, it looks like we'll have to have auxiliary string arrays that will match the index-value.

 
splxgf:


.... it looks like we'll have to have auxiliary string arrays that will match the index-value.

void AAA()
   {
    int       Handle;                                          // Файловый описатель
    string    File_Name = "AAA.csv";                           // Имя открываемого файла

    string    str_1 = "";                                      //  1 Номер индекса по первому измерению
    string    str_2 = "";                                      //  2 Номер индекса по второму измерению
    string    str_3 = "";                                      //  3 Значение
    string    str_4 = "";                                      //  4 Значение
    string    str_5 = "";                                      //  5 Значение

    Handle=FileOpen(File_Name, FILE_READ, ";");                // Открытие файла
    
    while(FileIsEnding(Handle)==false)                         // До тех пор, пока файловый...
        {                                                      // ...указатель не в конце файла
         // Чтение данных из строки до файлового разделителя
         str_1 = FileReadString(Handle);                       //  1 Номер индекса по первому измерению
         str_2 = FileReadString(Handle);                       //  2 Номер индекса по второму измерению
         str_3 = FileReadString(Handle);                       //  3 Значение
         str_4 = FileReadString(Handle);                       //  4 Значение
         str_5 = FileReadString(Handle);                       //  5 Значение
         
         if(FileIsEnding(Handle)==true)                        // Файловый указатель в конце файла
              break;                                           // Выход из цикла чтения

// Завели строковый массив

         // Преобразование типов данных и запись в масссив
         ArrayResize(Mas1, SizeMas1+1);                        // Увеличили размер массива Mas1

         Mas1[SizeMas1][0] = StrToInteger(str_1);              //  0 Номер индекса по первому измерению
         Mas1[SizeMas1][1] = StrToInteger(str_2);              //  1 Номер индекса по второму измерению
         Mas1[SizeMas1][2] = StrToDouble(str_3);               //  2 Значение
         Mas1[SizeMas1][3] = StrToDouble(str_4);               //  3 Значение
         Mas1[SizeMas1][4] = StrToDouble(str_5);               //  4 Значение
         SizeMas1++;                                           // Новый размер массива Mas1

// Что дальше  ????????????????????????????????????????????????????

        }
    FileClose(Handle);                                         // Закрываем файл
    return;                                                    // Выход из функции
   }
 

How to delete all objects like OBJ_ARROW_RIGHT_PRICE?

Command ObjectsDeleteAll(OBJ_ARROW_RIGHT_PRICE) does not delete ! even after changing timeframe (to redraw the entire chart forcefully)

I wrote a simple script, in the comments it writes on the screen:

Alert("obj_arrow_right_price=",OBJ_ARROW_RIGHT_PRICE) ; // =36

ObjectCreate("MyArrow",OBJ_ARROW_RIGHT_PRICE,0,Time[1],Open[1]) ; // created OBJ_ARROW_RIGHT_PRICE

Alert("objectTipe=", ObjectType("MyArrow"), "ARROW CODE=",ObjectGet("MyArrow",OBJPROP_ARROWCODE) ) ; // nightmare "objecType=" =22, didn't understand why not 36 as in the first line ?

ResetLastError() ;

Alert("script delete arrow right price=",ObjectsDeleteAll(OBJ_ARROW_RIGHT_PRICE)," lastError=",GetLastError() ) ; // deleted objects =0, error code =0

I continue the experiment by writing: ObjectsDeleteAll(22) ; // deleted objects =0 again

 
VoDyaMon:

How to delete all objects such as OBJ_ARROW_RIGHT_PRICE ?


Read the help once again:

ObjectsDeleteAll

Deletes all objects of a specified type and in a specified subwindow.

int  ObjectsDeleteAll(
   int   window=EMPTY,      // индекс окна
   int   type=EMPTY         // тип объекта для удаления
   );

If the objects are in the main chart subwindow:

ObjectsDeleteAll(0,OBJ_ARROW_RIGHT_PRICE);
 
isn-88:


Read the help again:

ObjectsDeleteAll

Deletes all objects of the specified type and in the specified subwindow of the chart.

If objects are in the main graph subwindow:

Just don't suggest silly options. This command will remove all objects from the graph altogether.
 
Leo59:
Please explain how to unpack data from table (*.csv) into three-dimensional static array.
The first column of the table contains the index for the first dimension of the array,
The second column contains the index for the second dimension of the array,
The third and further columns contain the values themselves for the third dimension of the array.

Forget what you wrote next. Declare an array of appropriate type at global variable level arr[][][3] and define the second dimension by yourself.

void AAA()
   {
    int       Handle;                                          // Файловый описатель
    string    File_Name = "AAA.csv";                           // Имя открываемого файла

    string    str_1 = "";                                      //  1 Номер индекса по первому измерению
    string    str_2 = "";                                      //  2 Номер индекса по второму измерению
    string    str_3 = "";                                      //  3 Значение
    string    str_4 = "";                                      //  4 Значение
    string    str_5 = "";                                      //  5 Значение

    Handle=FileOpen(File_Name, FILE_READ, ";");                // Открытие файла
    
    while(FileIsEnding(Handle)==false)                         // До тех пор, пока файловый...
        {                                                      // ...указатель не в конце файла
         // Чтение данных из строки до файлового разделителя
         str_1 = FileReadString(Handle);                       //  1 Номер индекса по первому измерению
         str_2 = FileReadString(Handle);                       //  2 Номер индекса по второму измерению
         str_3 = FileReadString(Handle);                       //  3 Значение
         str_4 = FileReadString(Handle);                       //  4 Значение
         str_5 = FileReadString(Handle);                       //  5 Значение
         
// А здесь заполнение массива
arr[str_1][str_2][0] = str_3;
arr[str_1][str_2][1] = str_3;
arr[str_1][str_2][2] = str_4;

         if(FileIsEnding(Handle)==true)                        // Файловый указатель в конце файла
              break;                                           // Выход из цикла чтения

         ????????????????????????????????????????????????????
        }
    FileClose(Handle);                                         // Закрываем файл
    return;                                                    // Выход из функции
   }

Well, it's like this. And you'll probably need to convert string indexes to integers.

Reason: