Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 1153

 
Alexey Viktorov:

If your code was decompiled, nothing prevents you from removing the macro and you won't have any problems. But read more about decompiling capabilities. Even if we suppose that it is possible, it costs as much as a dozen EAs. But it seems to me that this is a scam. Order and pay for decompilation and you will never see the site with this offer again.

Not really. The EA is constantly communicating with the web servervia WebRequest, and in the body of the request there is this digit, which is given by the macro. The web server knows in advance what the digit is and checks to see if it matches. My question is whether this macro will be in its place after decompilation or the line will be shifted, because if so the line number will be different and the server will not accept this request. Of course I know it costs a lot and I know it's a bit paranoid. But the customer is demanding))

 
As far as I understand, macros do not remain in the compiled program, they are swapped for their values before compilation. Consequently, the compiled, as well as hypothetically decompiled EA will not contain the macro that returns the line number, but the line number itself.
 

I just started to learn MQL4. I am trying to learn how to write scripts. I created a new script and pasted some code from another script into the script template, but after compiling it I get an error. I understand the error message appears in the MessageBox function, but I can't figure out what it is.

Can you please tell me what this error is and how to fix it?

#property copyright "Kishman Yuriy"

#property link "kishman_us@ukr.net"

#property version "1.00"

#property strict

//+------------------------------------------------------------------+

//| Script program start function |

//+------------------------------------------------------------------+

int start()

{ // example 3: counting the amount of "white", "black" and "gray" candlesticks

int black=0;

int white=0;

int grey=0;

for(a=0;a<Bars;a++)

{

if(Close[a]>Open[a])

white++;

else if(Close[a]<Open[a])

black++;

else

grey++;

}

MessageBox("black="+black+" white="+white+" grey="+grey, "candles");

return(0);

}


 
Yuriy Kishman:

I just started to learn MQL4. I am trying to learn how to write scripts. I created a new script and pasted some code from another script into the script template, but after compiling it I get an error. I understand the error message appears in the MessageBox function, but I can't figure out what it is.

Can you please tell me what this error is and how to fix it?

#property copyright "Kishman Yuriy"

#property link "kishman_us@ukr.net"

#property version "1.00"

#property strict

//+------------------------------------------------------------------+

//| Script program start function |

//+------------------------------------------------------------------+

int start()

{ // example 3: counting the amount of "white", "black" and "gray" candlesticks

int black=0;

int white=0;

int grey=0;

for(a=0;a<Bars;a++)

{

if(Close[a]>Open[a])

white++;

else if(Close[a]<Open[a])

black++;

else

grey++;

}

MessageBox("black="+black+" white="+white+" grey="+grey, "candles");

return(0);

}


The a variable is undeclared, in general, you should pay attention to the error message, it's at the bottom where the description (tools) is, it's also better to get rid of warnings, perhaps using (string) before numeric variables in the MessageBox function

Документация по MQL5: Константы, перечисления и структуры / Коды ошибок и предупреждений / Ошибки компиляции
Документация по MQL5: Константы, перечисления и структуры / Коды ошибок и предупреждений / Ошибки компиляции
  • www.mql5.com
Импортируемая функция не может иметь такого параметра (нельзя передавать указатель, класс или структуру, содержащую динамический массив, указатель, класс и т.д.) Недопустимый возвращаемый тип. Например, такая ошибка будет...
 
Andrey Sokolov:

Greetings. Can you advise me please?

Is it possible to set the colour of lines (not arrows) of orders in mt4?

There is a parameter in OrderCreate/Modify/Close - colour.

You can separately for each of them post factum, look in the list of objects and change the properties

if I understood the question correctly

 
Yuriy Kishman:

I just started to learn MQL4. I am trying to learn how to write scripts. I created a new script and pasted some code from another script into the script template, but after compiling it I get an error. I understand the error message appears in the MessageBox function, but I can't figure out what it is.

...

grey++;

}

MessageBox("black="+black+" white="+white+" grey="+grey, "candles");

return(0);

}


MessageBox("black="+(string)black+" white="+(string)white+" grey="+(string)grey,"candles"); 

Error reads "Type conversion from ... to ...".

 

I need help in recoding indicator for mt5 I will be very thankful to those who will help.

I have a free access to indicatorhttps://www.mql5.com/ru/code/9069 I will wait for your reply.

3 in 1: Stoch + CCI + RSI
3 in 1: Stoch + CCI + RSI
  • www.mql5.com
Описание: Используются весьма полезные характеистики этих трех индикаторов, но в одном "флаконе". Идея проста: берется взвешенная сумма трех индикаторов: Советы: Следите за диверами; Определяйте разгон тренда, импульса; Отрегулируйте развесовку индикаторов: если, например...
 
Almat Kaldybay:

the a variable is undeclared, but in general you should pay attention to the error message, it's at the bottom of the description (tools), it's also better to get rid of warnings, perhaps using (string) before numeric variables in the MessageBox function

Yes, thanks for the explanation. Declared variable a and put string before variables inMessageBox function itself.

 
Vitaly Muzichenko:

The error reads "Type conversion from ... to ...".

Thank you, that helped).

 
alexsandr11:

I need help in recoding indicator for mt5 I will be very thankful to those who will help.

I have a free access to indicatorhttps://www.mql5.com/ru/code/9069 I will wait for your reply.

Start solving it and come back with questions and your code. They won't do it for you here. Here they will.