Download MetaTrader 5

Different behavior of EA in the different platform - page 2

To add comments, please log in or register
m
105
m  

To GumRai

first mean:

if((present_time>=open_time)&& (present_time<close_time))OrderTicket();

I mean make trade between two specific pint- open and stop. In this case 13.30 and 19.00

second mean:

trailing stop

To angevoyageur


I think I use OrderSelect(), before rest Orderxxx(). I can't "see" your suggestion. First is the loop and after there is function call (buy,sell)

Alain Verleyen
Moderator
31203
Alain Verleyen  
kot_filemon:

To GumRai

first mean:

if((present_time>=open_time)&& (present_time<close_time))OrderTicket();

I mean make trade between two specific pint- open and stop. In this case 13.30 and 19.00

second mean:

trailing stop

To angevoyageur


I think I use OrderSelect(), before rest Orderxxx(). I can't "see" your suggestion. First is the loop and after there is function call (buy,sell)

Excerpt from your code :

int start()
  {
   double Type=OrderType();
     double Poczatek=0;
       double TrailingStop=250;
         int MagicNumber=OrderMagicNumber();

   double cz_otw=13.30;
      double cz_zam=19.00;

   int godzina=Hour();
    double minuty=Minute();
      double czas_obecny=godzina+minuty/100;
         if (czas_obecny>=cz_zam) return(0);
            if (czas_obecny<=cz_otw) return(0);
               if((czas_obecny>=cz_otw)&& (czas_obecny<cz_zam) ) OrderTicket(); 
...
start() function is called on each tick. You don't call OrderSelect() before using the highlighted functions.
whroeder1
14785
whroeder1  
and
if((czas_obecny>=cz_otw)&& (czas_obecny<cz_zam) ) OrderTicket(); 
is the same as
if(condition) 1029384756; 
meaningless
12
To add comments, please log in or register