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

 

Hi! This may be an off-topic question, but can you advise me on a forum? I'm new at this.

The situation is as follows. I have written my EA and put it for sale, but three months later I found out that my EA is being sold illegally on other websites (I've already found three sites).

I should be more precise, not only my EA is for sale, but I can find almost any EA on the Mql5 website.

Maybe there is information on whether Mql5 programmers are solving this problem?

Thank you.

 
Nerd Trader #:

Yeah, that's not good. Is that okay?

This is not equivalent to Sleep(100)? After all, the program will hang in a loop until the break is executed.

Equivalent.

And that's where we come to OOP, where each button is an instance of a button class, each with its own button press handler and tracking the duration of the delay in its own timer.

Or tracking the states of each button in the overall timer of the program - if not OOP

 
Mikhail Voropaev Mql5 programmers are solving this problem?

Thank you.

Please send me the URL of each such site in my personal message.

 
Artyom Trishkin #:

Equivalent.

And that's where we come to OOP, where each button is an instance of a button class, each with its own button handler and tracking the duration of the delay in its own timer.

Or tracking the state of each button in the timer of the program, if it is not OOP.

I understand about OOP, but I'm not sure about the self timer. What do you mean? Different start of timers and accounting for delays? But there is only one time counting. Or what else is unknown?

 
Valeriy Yastremskiy #:

The OOP is clear, but the custom timer is not. What do you mean? Different start of timers and accounting for delays? But there is only one time counting. Or what else is unknown?

My obtuseness ...

Certainly not "own timer", but its own handler running in the timer.

 
Artyom Trishkin #:

Please email me the URL of each such site.

I can give you some later. I save them all. Some of them are already off, though.
There are a lot of them that copy the marketplace . At a discount.
 
Valeriy Yastremskiy #:

The OOP is clear, but the custom timer is not. What do you mean? Different start of timers and accounting for delays? But there is only one time counting. Or what else is unknown?

I once wrote an article on this subject.

 
Sergey Gridnev #:
I once wrote an article on this topic.

Thank you, good localisation of applications)

 
MakarFX #:
and if "ms" is made global
Looks like OnTimer handles events in parallel with main thread and that's what you need for button animation, but it doesn't get better this way.
GetMicrosecondCount()-ms will anyway give a difference greater than 100000 and without pressing the button. It is possible to set the limits by adding more
&& GetMicrosecondCount()-ms<120000, the condition is fulfilled 1 time, but also independently without pressing.

P.S. "ms = 0" also does not make sense to zero.


 
Nerd Trader #:
It seems that OnTimer handles events in parallel with main thread and this is what you need for button animation, but it doesn't get better this way.
GetMicrosecondCount()-ms will anyway give a difference greater than 100000 and without pressing the button. It is possible to set the frame by adding more
&& GetMicrosecondCount()-ms<120000, the condition is fulfilled 1 time, but also independently without pressing.

P.S. "ms = 0" also does not make sense to zero.


or if

//+------------------------------------------------------------------+
void OnTimer()
  {
   if(ms!=0&&GetMicrosecondCount()-ms>100000)
     {
      ObjectSetInteger(0,"button1",OBJPROP_STATE,false);
      ms=0;
     }
  }
//+------------------------------------------------------------------+

Reason: