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

 

There is another tricky option.

#include <WinUser32.mqh>

int delay = 180;
datetime read_now;
int hWnd = 0;

void init()
 {
  read_now = TimeLocal() + delay;
  hWnd = WindowHandle(Symbol(), Period());
  for (ini i = 0; i < 300; i++) PostMessageA(hWnd, RegisterWindowMessageA("MetaTrader4_Internal_Message"), 2, 1);
 }
void start()
 {
  while(!IsStopped())
   {
    int how_many_remains = read_now - TimeLocal();
    Comment(StringConcatenate(StringSubstr("-", (how_many_remains%60 >= 0), 0),
                              StringSubstr("0", (MathAbs(how_many_remains/60) > 9), 0),
                              MathAbs(how_many_remains/60), ":",
                              StringSubstr("0", (MathAbs(how_many_remains%60) > 9), 0),
                              MathAbs(how_many_remains%60)));
    Sleep(1000);
   }
 }
While this pile of messages is being processed, the init will finish and go to waiting for a tick at the start.
 
Zhunko:

Set it up on a timetable with your expert. The expert will work.

And your code also works, i.e. start() should not be started with init() + while(!IsStopped()), it is enough to change TimeCurrent() to TimeLocal() in the test EA and put while(!IsStopped()){} in your script in void start() (of course, start from another chart, Symbol() - Period() set for chart with EA). Thank you, now I've figured it out.
 
gyfto:
And your code also works, that is, start() should not be started with init() + while(!IsStopped()), it is enough to change TimeCurrent() to TimeLocal() in the test EA and put while(!IsStopped()){} in void start() in your script (of course, start from another chart, Symbol() - Period() set the chart with the EA). Thank you, now I've figured it out.

It works and it works. Because of the wrong time function, you can't see that it works.

Didn't look into your code. Who knows what you wanted to tell them...?

 
Zhunko:

So indecent.


I know )))

Zhunko:
void init()
 {
  ServiceRefreshChart(hWnd, 100);
 }
void start()
 {
  ServiceStopRefreshChart(hWnd);
  while(!IsStopped())
   {
    ...
    Sleep(1000);
   }
 }

Got it...

Zhunko:

There's another tricky option.


Danger of clinical death of CPU on VPS.

 
gyfto:

Danger of clinical death of CPU on VPS.

Is this your personal experience?

Just a large number of asynchronous messages to the window. This should not cause a system crash and increased CPU load.

The system sends hundreds of thousands of such messages to all the windows.

 
Zhunko:

I didn't look into your code. Who knows what you wanted to tell them...?

There's nothing there, it's just a handy shell to run WSH scripts for parsing.
Zhunko:

Is this your personal experience?


That's right, from life experience. If CPU load is 100%, you can't even go to VPS, you have to contact tech support and ask to restart VPS. And CPU load is achieved by my WSH scripts very easily, I have to watch every extra bit of memory... Good if I'm on VPS, but if I'm not there, then VM reboot is a scheduled emergency for TC. I'm used to it...
 
Okay.
I figured out the trigonometric function:
MathCos

But I don't understand how to make a sine wave using this function.


y = 2cos(x*x)


This problem is really messing with my nerves.

 
Link_x:

But I don't understand how to make a sine wave using this function.

y = 2cos(x*x)

This problem severely strained my nervous system.


The angle in radians has to be substituted. If you convert degrees to radians (180 degrees = pi radians) you have to:

1 radian=180/PI (PI =3.14.... take the exact value to the 20th digit and score it in #definе)

 
Link_x:

The product of minutes times seconds multiplied by hours.
The price movement is not chaotic, but "coded".
In order to decipher this movement, a synthesis of price movement with a pattern-moving line must be performed. I chose the time continuum.
Synthesis of price movement with time movement must be performed using a special formula that I will not reveal to you.
The indicator above is based on a reduced formula.
The full formula (I calculated to satisfy my interest) is 37 times more complicated than the reduced formula.

The indicator on the full formula was built today at 12:00 p.m. Moscow time.
The sight that I had imagined was revealed to my eyes.
I saw a pattern - moving lines whose subsequent movement can be calculated, and because their movement is directly related to price movement, price movement will be predictable.


But you don't have this work, you have some very different work there
 
Vinin:

But you don't have that piece, you've got some other piece there.

Is it lucky? Was it an accidental discovery? :)




ALXIMIKS , it's not clear to me, but thank you.

I noticed a great coincidence. Picture attached.
Files:
Reason: