[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 412

 
abolk:

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

Ok, let's try something else.

// до старта объявляем 
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){
   OrderSend(Symbol(), OP_BUY, 0.1, Ask, Slippage, Ask-SL*Point, Ask+TP*Point, EA_Comment, Ea_Magic, 0, Blue);
   }

I want the order to open at 10 and at 17 as it is set in the variables - now it sometimes opens at 10 and at 11 and at 18

 
T-G:

Ok, let's try something else

I want the order to open at 10 and at 17 as set in the variables - now it sometimes opens at 10 and at 11 and at 18


1. The signal may come at the end of 10, and the broker will open a deal at 11.
2. you can try to output the time before the command to open the order

in general, how fast do you need an answer to your question?
if time is running out, you may post your multiline code on the command

 
T-G:

Ok, let's try another way

I want the order to open at 10 and at 17 as set in the variables - now it sometimes opens at 10 and at 11 and at 18

Do not worry in vain - see the first post of this branch - there at the bottom of the links of the very first post (Victor) - there are links on this subject.
 
Please help me find a script to set stop to open position and profit as well as enable trailing. For example, as soon as the position is opened, the script set stop 15 pips, profit 45 pips and enabled trailing 15 pips.
 
abolk:


In general, how quickly do you need an answer to your question?
If time is patient, you can post your multiline code on command

The thing is I know my code and I know which block has an error so I cited it. Thanks for the reply I will read more about opening a spark plug!
 
T-G:
You mean the way I answered your question? The thing is, I know my code and I know which block has an error so I cited only that one. Thanks for the reply I will read more on the spark plug opening issue!

It's weird, I didn't ask you any questions.
 
And how to select the most recent order from the closed ones ? ? OrderSelect (...) ?
 
Shniperson:
And how to select the most recent order from the closed ones ? ? OrderSelect (...) ?

https://docs.mql4.com/ru/trading/OrderCloseTime
 

Good day ! I am looking for an EA that would work on a crossover of 4 averages (a signal is the crossover of 3 averages on the fourth example 13 55 77 cross 144) and the filter is a stochastic Magdi or something else.

 
eduard9898:

Hello ! I am looking for an EA that would work on a crossover of 4 averages (a signal is the crossover of 3 averages on the fourth example 13 55 77 crossover 144) and the filter is a stochastic Magdi or something else.


You twist the averageshere instead of stochastic or mcdi (stochastic and mcdi are there originally)... everything is already done there, you just hit conditions on averages in this inlude... And that's it.
Reason: