[Archive!] Any rookie question, so as not to clutter up the forum. Professionals, don't pass it by. Couldn't go anywhere without you - 2. - page 411

 
Shniperson:

Gentlemen! How to make a time limit for trading... so that the Expert Advisor does not trade from 23-00 to 2-00 (terminal time)

bool market=false;
if(Hour()>=2 && Hour()<=23) market=true;
 
That way he'll be trading until midnight.
 

Hello, esteemed forum users.

Can you please tell me what to change in the code of the Expert Advisor (written for four-digit quotes) to make it work correctly on the quotes of a five-digit brokerage company?

Thank you.

 
obergan:

Can you please tell me what to change in the code of the Expert Advisor (written for four-digit quotes), so that it works correctly on the quotes of a five-digit brokerage company?

You should not change anything in the code. It is written correctly and takes everything into account.
 
sergeev:
You don't need to change anything in the code. It is written correctly and takes everything into account.

For example, if at the four digits puts TR of 35 points, then at the five digits puts the same 35, and not 350, which I wanted to get. If anyone has a chance, please look at the code.
 
obergan:
For example, if the four digits put TR 35 points, then the five digits put the same 35, and not 350, which I wanted to get. If anyone has an opportunity, please look at the code.

It is forbidden to post decompiled codes on the forum.
 

Can you tell me what the problem could be?

there is this code

// до старта объявляем 
extern int     Hour1 = 10;
extern int     Hour2 = 17;
bool StartTrade;

// в старте
   StartTrade=false;
   
   if (TimeHour(TimeCurrent())==Hour1){ 
      StartTrade=true;
   }
   if (TimeHour(TimeCurrent())==Hour2){
      StartTrade=true;
   }

// и далее
   if (StartTrade==true){
   // открытие ордеров
   }


But the order can open at a different time, and the next hour for example, than in the settings Hour1 and Hour2 - what can it be?

 
T-G:

Can you tell me what the problem could be?

there is this code

But the order may open at a different time and the next hour, for example, than in the settings Hour1 and Hour2 - what can it be?


maybe something else, something that is outside this code

Show all code

 
abolk:


maybe something else, something that is outside this code

show all the code

but if it's something else that's inside, can it make a difference?

 if (StartTrade==true){
   // открытие ордеров
 }
 
T-G:

But if it's something else that's inside, can it make a difference?


From the code shown, it is difficult to judge the EA's behaviour as you say
Reason: