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

 
psyman:

I thought it would be much easier :-)

Then quite a childish question - my code doesn't involve any trading or graphics, what type of program should I use?

The scripts are one-off, but can they be run in a loop? I declared a custom indicator purely out of inertia, because I've never used Expert Advisors. I have never used them before, but they restart automatically which I do not need. i will need your advise.

ps

Can the objects be zero-sized so that they don't get in the way visually?

There may be many indicators on one chart, the Expert Advisor is one. The looped script is ... I do not know what to call ...

Objects can be located at time 0 and price 0 - you won't see it.

 

I have a similar case, no graphics and no messages on the screen for the user at all, but the trade is there. The signal files provide the interface between the terminals and the process controlling program, there are two MQL macro programs (4 or 5) running in an endless loop in the terminals. One is a script for receiving ticks, the second is an Expert Advisor sending trade orders to the server and receiving their execution results from the server. Collection of ticks must occur at the moments, when the terminal is waiting for the server's reply to a trade request (up to tens of seconds), so there are two macro programs. Considering whether it is MT4 or MT5, there are 4 different programs in total. All output from MQL to signal files and to files - protocols.

MQL cycles with Sleep(11) delay are executed during the whole trading week. When the terminal closes, the appropriate statistics is written in the protocols as the last line:

"...worked. 14456641 cycles in 439164 sec (30ms each)".

". 23403947 cycles in 436869 sec (18ms) and 1531 requests in 2295 sec (1499ms)".

 

I throw the indicator on the chart and... ALERT but the signal is 5 bars away. During further work it beeps as it should be.

How to make it stop beeping on start?

if(М_А>0.0)  
{
if(time!=Time[0])
   {
    time=Time[0]; 
    AL(Symbol()+" "+Period()+" УХ ТЫ",2);//
   }
 }

In function AL(), all possible alerts.

 
Ghabo:

I throw the indicator on the chart and... ALERT but the signal is 5 bars away. During further work it beeps as it should be.

How to make it stop beeping on start?

In the AL() function, all possible alarms.

Do onInit() initialization

void OnInit() {
  time==Time[0];
}
 
Artyom Trishkin:
Perhaps you neverness should go and have a rest after all. Enough with the flubbing and trolling.

Calm down, Artem!

You should get positive emotions out of life, especially when you don't like something.

That's what makes life varied.

 

How do you feel about discussing trading theory on this forum?

I'll be honest and straightforward - there will be problems.

Or the developers of MT4/MT5 don't deal with trading theory?

 
neverness:

How do you feel about discussing trading theory on this forum?

I'll be honest and straightforward - there will be problems.

Or MT4/MT5 developers do not deal with trading theory?

Another trolling.

 
Vitaly Muzichenko:

Another trolling.

Why is that?

It's honest, straightforward and clear.

What's trolling got to do with it? - There is no trolling.

Or do you think that there is no trading theory in the wild?

Vitaliy, you are going in the wrong direction.

Or maybe you do not understand something.

 
Vitaly Muzichenko:

Do initialization in OnInit()

But then when the signal appears on the current bar, there will be no alert.

On the hourly chart the signal can be in the middle of the hour.

No other solutions?

 
Vitaly Muzichenko:

Another trolling.

Vitaly!

Let's not do any trolling at all.

It's simple and straightforward.

You build me a sine wave trend, and I'll wire you 100 quid in your account.

I'm not kidding.

I'm transferring it right now. No trolling.

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

How's that? How dare you?

It's standard procedure in MT4 !

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

Artem!

Is it my fault again?