Questions from Beginners MQL5 MT5 MetaTrader 5 - page 1578

 
Vitaly Muzichenko #:

Try it

Thank you very, very much! I will test it with the open market. If it's not too much trouble, I didn't find this other indicator for mt5. Would it be possible to convert it by also adding an alert option to the signals? Kisses
 
lynxntech #:

How to collect a "Checksum" of parameters from e.g. such a series of parameters?

it is necessary for checking identical conditions in different terminals and passes in the tester

the upper true has "weight" more than the lower and subsequent ones, for example

heaped

enum CLOSE_TIME
  {
   NO_CLOSE,          
   AMERICA,           
   CLOSE_DAY           
  };
void OnStart()
  {
CLOSE_TIME CloseTime            = AMERICA; 
ENUM_TIMEFRAMES HandlePeriod_1  = PERIOD_M1;   
ENUM_TIMEFRAMES HandlePeriod_2  = PERIOD_M5;  
//---
bool b1=false;
int a1=251;
bool b2=true;
int a2=121;
bool b3=true;
int a3=90;
bool b4=true;
int a4=1;
uchar sum= (uchar)((b1+a1)*(b2+a2)*(b3+a3)*(b4+a4)+HandlePeriod_1+HandlePeriod_2+CloseTime);
Print("sum ",sum);
printf("code %x",sum); 
 
lynxntech #:

mucked up

serialise to json and calculate CRC or hash ?

 
Print("Checksum - ",CharToString(sum));
Maxim Kuznetsov #
:

serialise to json and calculate CRC or hash ?

I don't know how to do it, and this is a short visual result for comparison.

There are even shorter ones, one letter or character.
 
lynxntech #:

mucked up

The same result (parameters are different):

enum CLOSE_TIME
  {
   NO_CLOSE,          
   AMERICA,           
   CLOSE_DAY           
  };
void OnStart()
  {
   CLOSE_TIME CloseTime            = AMERICA; 
   ENUM_TIMEFRAMES HandlePeriod_1  = PERIOD_M5;   
   ENUM_TIMEFRAMES HandlePeriod_2  = PERIOD_M1;  
   //---
   bool b1=true;
   int a1=121;
   bool b2=false;
   int a2=251;
   bool b3=true;
   int a3=1;
   bool b4=true;
   int a4=90;
   uchar sum= (uchar)((b1+a1)*(b2+a2)*(b3+a3)*(b4+a4)+HandlePeriod_1+HandlePeriod_2+CloseTime);
   Print("sum ",sum);
   printf("1code %x",sum);
  }
 
Vladislav Boyko #:

Same result (parameters are different):

add

Well, if you flip it over, it won't work for me.

here is another result in the form of a single symbol

Print("Checksum - ",CharToString(sum));
Maxim Kuznetsov#:

serialise to json and calculate CRC or hash ?

I don't know anything about it, so the result is short for clarity.

 
Zuko Lee #:
Thank you very much, thank you very much! I will test on the open market. If you don't mind, I haven't found another indicator for mt5. Is it possible to redesign it by adding an alert option to the signals? Kisses

It looks like this

 
Vitaly Muzichenko #:

It looks like this

Exactly that :) Thank you very, very much! Could you add an alert option to it? Immensely grateful for you
 
Zuko Lee #:
Exactly :) Thank you very much! Could you please add a notification option to it? Immensely grateful to you

I really hope someone else will definitely do it in this thread, there are some good programmers here.

 
Vitaly Muzichenko #:

It's not working.

Apparently these objects are not deleted in the tester.

Everything is deleted there, send me the owls, I will write it normally, there is no need to touch history at all.