[Archive!] Any rookie question, so as not to clutter up the forum. Professionals, don't pass it by. Couldn't go anywhere without you - 2. - page 137

 

Of course, I can check it myself, but maybe someone will give me a quick answer.

If I have array m[] with current number of elements already generated, say, 10,

and then I say

ArrayResize(m, 15)

will the original 10 elements of the array retain their values ?

--------------------------------------------------------------------------

All checked - the values are retained.


 
more:

Of course, I can check it myself, but maybe someone will give me a quick answer.

If I have array m[] with current number of already formed elements, say, 10,

and then say

ArrayResize(m, 15)

will the original 10 elements of the array retain their values ?

--------------------------------------------------------------------------

All checked - the values are retained.


Why are you specifying 15? You need 10.
 
There are some technical questions about MT.

1. data export. Everything is clear with DDE and saving quotes archive. I am interested in unloading certain quotes of a certain interval over a certain period using the embedded language. I understand that it is done with the help of scripts. On this website I found examples of scripts for unloading data.

Question: For the script to be executed automatically (in this case, the unloading), do I need to create an Expert Advisor that will execute this script?

2. The code of scripts etc. seems to be stored in *.mq4, while *.ex4 is probably a compiled file. I would like the following possibility: if necessary to change script code with any text editor - and for MT to execute already changed script. Ifthe assumption about *.mq4 and *.ex4 is correct, is it possible to perform compilation using non-interface methods and pass the modified script to MT for execution?

I am interested in the import/export of transactions through a file and a library - is there such a possibility (similar to the functionality in QUIK)? I did not find any clear indication of this possibility. Is it really necessary to organize the exchange through a file of its own format: The Expert Advisor reads and parses the file and, depending on its contents, it performs transactions? If it is possible, are there any examples?


4. And is there a syntax helper for MetaQuotelanguage ?


Thank you in advance for your help!
 
Mopo3:
There are some technical questions about MT.

1. data export. Everything is clear with DDE and saving quotes archive. I am interested in unloading certain quotes of a certain interval over a certain period using the embedded language. I understand that it is done with the help of scripts. On this website I found examples of scripts for unloading data.

Question: If I want the script to be executed automatically (in this case, the unloading), do I need to create an Expert Advisor that will execute this script?

2. The code of scripts etc. seems to be stored in *.mq4, while *.ex4 is probably a compiled file. I would like the following possibility: if necessary to change script code with any text editor - and for MT to execute already changed script. Ifthe assumption about *.mq4 and *.ex4 is correct, is it possible to perform compilation using non-interface methods and pass the modified script to MT for execution?

I am interested in import/export of transactions through a file and a library, is it possible (similar to the QUIK functionality)? I haven't found any clear indication of this possibility. Is it possible to organize the exchange through a file of its own format: the Expert Advisor reads and parses the file and, depending on its contents, it performs transactions? If it is possible, are there any examples?

4. And is there a syntax helper for MetaQuotelanguage ?

Thank you in advance for your help!

1. You can do it from anywhere (script, Expert Advisor, indicator).

2. You can do it, but why? Everything can be implemented directly in the MQL4 code.

It is possible. There are a lot of examples in the collection of files, and not only through a file.

4. F1. https://docs.mql4.com/ru/

 
And also the F1 button in the Editors)
 
alsu:
And also the F1 button in the Editors)
That's what I meant :-))
 
Zhunko:
That's what I meant :-))

Uh-oh. It's tough on a Monday.

 
Zhunko:

1. You can do it from anywhere (script, expert, indicator).

2. You can do it, but why? Everything can be implemented directly in MQL4 code.

Yes, it can. There are a lot of examples in the collection of files, and not only through a file.

4. F1. https://docs.mql4.com/ru/


1. I see, I will study the language.

2. A simple example: a third-party MTS where instruments, TFs, etc. are selected. It will also request quotes from MT, i.e. in this case change the code of the data upload script (I haven't found any external library to connect in a third-party MT management application yet). MT will have to compile the modified code and set it to run.

I take it that the issue of automatic compilation and execution is to look at https://docs.mql4.com/ru/?

3. I must not have looked hard enough. It seemed to me that all the examples illustrate exactly decision making on the MT side based on data analysis.

4. Thanks very much for https://docs.mql4.com/ru/. But F1 can hardly be called a syntax helper :)

 

Unfortunately, the author of this when retired from business, so I ask you a pro-I have after a loss-making deal opens, only one deal lot *2 - and then my orders are sometimes canceled - after time - they are all pending and often does not come to open deals lot *2 I think this is because after we open this deal, we keep the balance after workbalance_before= balance_after; and the function is already the next deal, is the usual, suggest - what need to change or fix - what would

Help me to change or correct - what should I change or correct - to open lot *2 until the order works, or open until the loss is blocked, thanks in advance for the answer!


As parameters, pass the initial volume (double lot), and the step (double x).
Insert the method directly into OrderSend instead of the volume parameter.

Пример вызова функции://+------------------------------------------------------------------+

double getMartinLot(double lot, double x){         //ФУНКЦИЯ УПРАВЛЕНИЯ ОБъЕМОМ ТОРГОВ ПО СИСТЕМЕ МАРТИНГЕЙЛА
   static double balance_before, balance_after;    //ДЛЯ ХРАНЕНИЯ СОСТОЯНИЯ БАЛАНСА ДО И ПОСЛЕ СДЕЛОК
   static double save_Lot;
   balance_after = AccountBalance();               //СОХРАНЕНИЕ ТЕКУЩЕГО СОСТОЯНИЯ БАЛАНСА
   if(balance_after >= balance_before){            //ПРОВЕРКА ИЗМЕНЕНИЯ БАЛАНСА
      save_Lot = lot;                              //ЕСЛИ ОН НЕ ИЗМЕНИЛСЯ ИЛИ СТАЛ БОЛЬШЕ, ТО СБРАСЫВАЕМ ЛОТ ДО БАЗОВОГО
   }else{
      save_Lot *= x;                               //ЕСЛИ СТАЛ МЕНЬШЕ ТО УВЕЛИЧИВАЕМ ЛОТ НА Х РАЗ
   }
   balance_before = balance_after;                 //СОХРАНЯЕМ СОСТОЯНИЕ БАЛАНСА ПОСЛЕ РАБОТЫ
   return(save_Lot);
}
//+------------------------------------------------------------------+

Pass in initial volume (double lot), and step (double x) as parameters.
Insert the method directly into OrderSend instead of the volume parameter.

Example function call:

if(OrdersTotal() == 0){
   OrderSend(Symbol(), OP_BUY, getMartinLot(0.1, 2), Ask, 10, Bid-25*Point, Bid+25*Point);
}

 
Mopo3:


1. I see, I will study the language.

2. A simple example: a third-party MTS in which instruments, TFs etc. are selected. It will also request quotes from MT, i.e. in this case change the code of the data upload script (I haven't found any external library to connect in the third-party MT management application yet). MT will have to compile the modified code and set it to run.

I take it that the issue of automatic compilation and execution is to look at https://docs.mql4.com/ru/?

3. I must not have looked hard enough. It seemed to me that all the examples illustrate exactly decision making on the MT side based on data analysis.

4. Thanks very much for https://docs.mql4.com/ru/. But F1 can hardly be called a syntax helper :)

2. I don't understand why you have to compile something on the fly. Make a set of ready-made scripts and run them, if you don't know how to manage the script parameters from the outside.

I manage to control MT4 from console application. I use the class library on the basis of which this library is built.

4. If something is not clear in the code, put the cursor on what is not clear and press F1. This is a syntax-helper.

Reason: