Questions from Beginners MQL4 MT4 MetaTrader 4 - page 148

 
Konstantin Nikitin:

Something like this, from what I understand you need

I wanted to do a test!!!
When the rx is in the 30-70 zone, then the EA trades, and when it goes beyond the 30-70 zone (overbought/oversold), then it does not trade!

 
ponochka:

I wanted to do a test!!!
When the Rx is in the 30-70 zone, the EA trades, and when it is outside the 30-70 zone (overbought/oversold), then it does not trade!

Define your own signs. At what conditions your positions will be opened.

 

Now here's another question!!! How do I limit the working time of the EA?

i.e., i want my EA to temporarily suspend its work from 10 to 11, but it will not open any more orders, but will operate with already opened orders as usual!

I know this is how it should be done:

void OnTick()
  {
if (Hour()<10 || Hour()>=11) return (0);
     ......остальной код....
  }
 
ponochka:

Now here's another question!!! How do I limit the working time of the EA?

i.e., i want my EA to temporarily suspend its work from 10 to 11, but it will not open any more orders, but will operate with already opened orders as usual!

I know this is how it should be done:

void OnTick()
  {
     ......здесь работаем с закрытием (тралом и прочим)....
if (Hour()>=10 && Hour()<11) return (0);
     ......остальной код, в частности для открытия....
  }
 
ponochka:

Now here's another question!!! How do I limit the working time of the EA?

i.e., i want my EA to temporarily suspend its work from 10 to 11, but it will not open any more orders, but will operate with already opened orders as usual!

I know this is how it should be done:

void OnTick()
  {
     ПровериВзятиеПозиций();
     ......остальной код....
  }
void ПровериВзятиеПозиций()
{
     if (Hour()<10 || Hour()>=11) return;
     /* проверяем */
}
 
Taras Slobodyanik:

ps. that reminds me - you also need to check the name of the created object to make sure it is not "your" object (prefix the name of your objects).
or instead of the name, compare the type of object.

Doesn't work... . Besides, the compiler generates an error... .

Who knows, what is the difference in procedures between initialising a new indicator and when the timeframe is changed?
 
Dear programmers, could you advise me how to pause the EA for a couple of hours?
 
ostamail:
Dear programmers, could you advise how to pause the EA for a couple of hours? Is there such an operator that will delay the operation of the owl?
return;
 
Artyom Trishkin:
return;

what returnee? for 2-3 hours how to pause?

 
ostamail:

what returnee? for 2 to 3 hours, how do you suspend work?

Here's an example

Вопросы от начинающих MQL4 MT4 MetaTrader 4
Вопросы от начинающих MQL4 MT4 MetaTrader 4
  • 2018.08.16
  • www.mql5.com
Если у Вас вопросы по MQL4, MT4, MetaTrader 4, пожалуйста пишите в этой теме. Особенно когда вопросы касаются торговых функций...
Reason: